Skip to content

Instantly share code, notes, and snippets.

@cdmunoz
Created March 3, 2018 02:47
Show Gist options
  • Select an option

  • Save cdmunoz/950b6e53a0eed396a8b103e07a8566ac to your computer and use it in GitHub Desktop.

Select an option

Save cdmunoz/950b6e53a0eed396a8b103e07a8566ac to your computer and use it in GitHub Desktop.
@Module
class AppModule(val app: Application) {
@Provides
@Singleton
fun provideApplication(): Application = app
@Provides
@Singleton
fun provideCryptocurrenciesDatabase(app: Application): Database = Room.databaseBuilder(app,
Database::class.java, "cryptocurrencies_db").build()
@Provides
@Singleton
fun provideCryptocurrenciesDao(database: Database): CryptocurrenciesDao = database.cryptocurrenciesDao()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment