Last active
June 8, 2018 03:56
-
-
Save ryansgot/c9eb1703e3f9190641e7deb929b6ab97 to your computer and use it in GitHub Desktop.
ForSureDB Example App.kt (contentprovider)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.Application | |
import com.fsryan.forsuredb.FSDBHelper | |
import com.fsryan.forsuredb.ForSureAndroidInfoFactory | |
import com.fsryan.forsuredb.gsonserialization.FSDbInfoGsonSerializer | |
import com.fsryan.forsuredb.api.FSTableCreator | |
class App : Application() { | |
override fun onCreate() { | |
super.onCreate() | |
val authority = "com.fsryan.example.forsuredb.content" | |
val tables = TableGenerator.generate(authority) | |
val serializer = FSDbInfoGsonSerializer(); | |
if (BuildConfig.DEBUG) { | |
FSDBHelper.initDebug(this, "example-debug.db", tables, serializer) | |
} else { | |
FSDBHelper.init(this, "example.db", tables, serializer) | |
} | |
ForSureAndroidInfoFactory.init(this, authority) | |
ForSure.init(ForSureAndroidInfoFactory.inst()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment