I use to work on a multi language (English, Malay, Chinese) Android mobile app previously, which required to keep the value in database. There is no perfect solution to design a database to support this.
Instead of using the well known Butter Knife, this time I try to use Android Data Binding Library on my existing open source project, the steps are quite simple.
Step 1:
Extends from my previous post Retrofit 2 + AutoValueGson, I’m trying to add a database for the project. I choose to use ContentProvider due to the benefit of ContentObserver, with the help of SQLDelight to generate all the necessary fields in Java model.
For a standard mobile app that required database as a storage, the sample code normally look like this:
public class DatabaseHelper extends SQLiteOpenHelper { private static final String DATABASE_NAME = "anonymous.db"; private static final…