Changes

Jump to: navigation, search

An Android Room Database and Repository Tutorial

44 bytes removed, 18:52, 16 January 2019
no edit summary
The user interface layout created in the previous chapter was the first step in creating a rudimentary inventory app designed to store the names and quantities of products. When completed, the app will provide the ability to add, delete and search for database entries while also displaying a scrollable list of all products currently stored in the database. This product list will update automatically as database entries are added or deleted.
== Modifying Modifying the Build Configuration ==
Begin by launching Android Studio and opening the RoomDemo project started in the previous chapter. Before adding any new classes to the project, the first step is to add some additional libraries to the build configuration, specifically the Room persistence library and the RecyclerView library. Locate and edit the module level build.gradle file (app -> Gradle Scripts -> build.gradle (Module: app)) and modify it as follows:
import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.MutableLiveData;
import android.arch.lifecycle.ViewModel;
 
public class MainViewModel extends AndroidViewModel

Navigation menu