2. What is SQLite?
• SQLite is Open Source Database
embedded into Mobile Devices.
• SQLite supports SQL syntax, transactions
and prepared statements.
• SQLite consumes low memory approx.
250Kbyte.
3. SQLite Types
• TEXT (String in Java)
• INTEGER (long in Java)
• REAL (double in Java)
4. SQLite in Android
• SQLite comes with all Android devices
• Application database is stored at
DATA/data/APP_NAME/databases/FILENAME
5. SQLite in Android
• Two packages
– android.database
– android.database.sqlite
9. query()
Cursor cursor = database.query(
"users",
new String[] {"fullname"},
"username = ? and password = ?",
new String[]{username, password},
null, null, null) ;
10. rawQuery()
Cursor cursor = database.rawQuery(
"select fullname from users where username = ?
and password = ?",
new String[] { username, password }) ;
11. Cursor
A Cursor represents the result of a query and
basically points to one row of the query result.
• getCount()
• moveToFirst()
• moveToNext()
• …