Skip to content

Instantly share code, notes, and snippets.

@motorro
Created March 12, 2020 15:40
Show Gist options
  • Save motorro/1fc02cb17e7fcf19ef7dc572d3bad6e6 to your computer and use it in GitHub Desktop.
Save motorro/1fc02cb17e7fcf19ef7dc572d3bad6e6 to your computer and use it in GitHub Desktop.
New database instance
val db = Room
.databaseBuilder(getApplication(), CitiesDb::class.java, "cities.db")
.createFromAsset("databases/cities.db")
.fallbackToDestructiveMigration() // On version update - just copy over
.build()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment