Connecting data
Android comes equipped with the SQLite library, which is a powerful tool for creating and managing complex databases. One could easily fill an entire chapter or even a whole book on the subject. Here we are not dealing with a large collection and it will be simpler and hopefully clearer to create our own data class.
Note
If you would like to learn more about SQLite, comprehensive documentation can be found at: http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html
Later we will create complex data structures, but for now we only need to see how the setup works, so we will create just three items. To add these, create a new Java class called Filling
and complete like so:
public class Filling { private int image; private int name; public Filling(int image, int name) { this.image = image; this.name = name; } }
These can be defined in the main activity like so:
static...