Skip to content

Instantly share code, notes, and snippets.

@ryansgot
Last active June 8, 2018 05:05
Show Gist options
  • Save ryansgot/54810916ce19bc36cfbcd4602178d68a to your computer and use it in GitHub Desktop.
Save ryansgot/54810916ce19bc36cfbcd4602178d68a to your computer and use it in GitHub Desktop.
ForSureDB Example App.kt (directdb)
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 tables = TableGenerator.generate()
val serializer = FSDbInfoGsonSerializer();
if (BuildConfig.DEBUG) {
FSDBHelper.initDebug(this, "example-debug.db", tables, serializer)
} else {
FSDBHelper.init(this, "example.db", tables, serializer)
}
ForSure.init(ForSureAndroidInfoFactory.inst())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment