Created
March 3, 2018 02:47
-
-
Save cdmunoz/950b6e53a0eed396a8b103e07a8566ac to your computer and use it in GitHub Desktop.
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
| @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