December 2013
Beginner
416 pages
12h 45m
English
As you’ve seen, you can create a database by using the SQLiteOpenHelper class. The methods of this class are called automatically by Android whenever the database needs to be created or updated.
You create the database file by calling the constructor of SQLiteOpenHelper, passing the database name and database version. The database is stored by default in the /data/data/APPLICATION_NAME/databases directory. In your application the database will be created at /data/data/com.androiddevbook.onyourbike.chapter5/databases/OnYourBike.db.
To create the database tables themselves, you need to use SQL. The SQL to create a table takes this form:
create table <tablename> ( <fieldname> <datatype>, ...
Read now
Unlock full access