• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Android Database
 

Android Database

on

  • 1,108 views

 

Statistics

Views

Total Views
1,108
Views on SlideShare
989
Embed Views
119

Actions

Likes
0
Downloads
51
Comments
0

3 Embeds 119

http://android-az.com 60
http://www.hackathonazerbaijan.org 53
http://androidage2.hackathonazerbaijan.org 6

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Android Database Android Database Presentation Transcript

    • Rajab Davudov
    • 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.
    • SQLite Types• TEXT (String in Java)• INTEGER (long in Java)• REAL (double in Java)
    • SQLite in Android• SQLite comes with all Android devices• Application database is stored atDATA/data/APP_NAME/databases/FILENAME
    • SQLite in Android• Two packages – android.database – android.database.sqlite
    • SQLiteOpenHelpler• onCreate()• onUpgrade()• getReadableDatabase()• getWriteableDatabase()
    • SQLiteDatabase• insert()• update()• delete()• query()• rawQuery()
    • insert()ContentValues values = new ContentValues() ;values.put("username", username) ;values.put("fullname", fullname) ;values.put("password", password) ;database.insert("users", null, values) ;
    • query()Cursor cursor = database.query( "users", new String[] {"fullname"}, "username = ? and password = ?", new String[]{username, password}, null, null, null) ;
    • rawQuery()Cursor cursor = database.rawQuery("select fullname from users where username = ?and password = ?",new String[] { username, password }) ;
    • CursorA Cursor represents the result of a query andbasically points to one row of the query result.• getCount()• moveToFirst()• moveToNext()• …
    • Think, Design, Code !!!
    • 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