Category : repository

EDIT: I NEED TO PASS A CONTEXT AS A PARAMETER TO THE CLASS (DataStore and repository is the same class, don’t get confused) I have two activities, A and B and one repository. Activity A opens activity B and activity B saves data in the repository(DataStore a part of android jetpack). I am using LiveData ..

Read more

I tried to create a registration using MVVM + Repository pattern with DI, and I used @ViewModelInject and everything was OK, but now @ViewModelInject is deprecated and I changed @ViewModelInject to @HiltViewModel + @Inject constructor() and faced with the error: [Dagger/MissingBinding] *.AuthRepository cannot be provided without an @Provides-annotated method. I tried to add a @Provides ..

Read more

I am creating a Room based language learning app. Here is how my Entity looks: @Entity(tableName = "word_table") public class WordEntity { @PrimaryKey(autoGenerate = true) private int id; private String word; private String translation; private String category; public WordEntity(String word, String translation, String category) { this.word = word; this.translation = translation; this.category = category; } ..

Read more

I have a working Activity (TwalksRouteActivity) that accepts a record id (routeID) from a bundle (passed from a Fragment), pulls the associated record from my repository (routesRepository), and passes an associated value/column (routeName) to my UI. This works fine. However, as I understand best practice (I am learning Android development), the call to my Repository ..

Read more