Your SlideShare is downloading. ×
Android Database
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Android Database

1,010

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,010
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
63
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Rajab Davudov
  • 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 atDATA/data/APP_NAME/databases/FILENAME
  • 5. SQLite in Android• Two packages – android.database – android.database.sqlite
  • 6. SQLiteOpenHelpler• onCreate()• onUpgrade()• getReadableDatabase()• getWriteableDatabase()
  • 7. SQLiteDatabase• insert()• update()• delete()• query()• rawQuery()
  • 8. insert()ContentValues values = new ContentValues() ;values.put("username", username) ;values.put("fullname", fullname) ;values.put("password", password) ;database.insert("users", null, values) ;
  • 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. CursorA Cursor represents the result of a query andbasically points to one row of the query result.• getCount()• moveToFirst()• moveToNext()• …
  • 12. Think, Design, Code !!!
  • 13. Rajab Davudov Senior Developer at Azerfon radjab@gmail.comhttps://play.google.com/store/apps/developer?id=RADJABhttp://gplus.to/radjabhttp://www.fb.me/rajab.davudovhttp://www.linkedin.com/in/radjab

×