SlideShare a Scribd company logo
1 of 19
Download to read offline
Android Camp
  Mohamed Ibrahim
   Mobile Developer
      Core-Member
Of
            R ev iew      al
      ui ck           ent
 A  Q         un  dam
       as e F
Da tab
Type of Database in Android
● Internal Database

       like(Sqlite)

● External Database

       like(Content Provider)
URI

"File://[package]/[res id]"




"File://[package]/[res type]/[res name]"
Internal Database


● Preferences

● Files

● SQLite

● Network
What is SQLite !
                         
●  SQLite is an open source Database
●  Supports standard relational Database
●  Requires only little memory at runtime
   (250KB)
● Support the data types :
   ○ TEXT
   ○ INTEGER
   ○ REAL
● SQLite doesn't validate if the types written in
  in the columns are actually of the defined
type
Why SQLite !!
                                  Si
                                     ng
          rce                          le
    n sou                                   Fil
                                               e
O pe
                less than 250KB


   Faster

                   no setup or administration
SQLite Architecture

● Package
  ○ android.database.sqlite


● SQLiteDatabase
  ○ insert _ delete _ update _query _ execSQL


● SQLiteOpenHelper
  ○   Create
  ○   Upgrade
  ○   open
  ○   close
Let's Code
Now
SQLiteOpenHelper
subclass of SQLiteDatabase used to create ,upgrade,open and close database.
 ● constructor parameters
     ○ Context
     ○ String name //database name
     ○ CursorFactory factory // null
     ○ version //data base version
we delete all constructor parameters except context but we wrote database
name ,factory and version in the super of SQLiteDatabase

●   Have 2 basis methods
    ○   onCreate      //create our database and take one parameter
                       //(SQLiteDatabase)
    ○   onUpgrade //used when we want to add new column or table
                   //it take 3 parameter (SQLiteDatabas,old,new version)
SQLiteDatabase
● Exposes methods to manage a SQLite DataBase:

     ○ insert
     insert(String tableName,String nullColumnHack,ContentValues values)
     ○ delete
     delete(String tableName,String whereClause,String[] whereArgs)
     ○ update
     update(String tableName,ContentValues values,String whereClause,String
[]
     whereArgs )
     ○ execSQL
     execSQL(String sql)
     ○ query
     query(String tableName, String[] columns,String selection,String[ ]
     selectionArg,String groupby,String having,String orderBy)
Cursor




         moveToFirst
Devmix
                               ssion on
                  bout this se
Wait a rticle a
website
                              mix.org
                       www.dev
Thanks



*__^

More Related Content

What's hot

Alternatives to Relational Databases
Alternatives to Relational DatabasesAlternatives to Relational Databases
Alternatives to Relational Databases
Adam Hutson
 
Introduction to NoSQL Databases
Introduction to NoSQL DatabasesIntroduction to NoSQL Databases
Introduction to NoSQL Databases
Derek Stainer
 

What's hot (19)

Rails meets no sql
Rails meets no sqlRails meets no sql
Rails meets no sql
 
Open Source 1010 and Quest InSync presentations March 30th, 2021 on MySQL Ind...
Open Source 1010 and Quest InSync presentations March 30th, 2021 on MySQL Ind...Open Source 1010 and Quest InSync presentations March 30th, 2021 on MySQL Ind...
Open Source 1010 and Quest InSync presentations March 30th, 2021 on MySQL Ind...
 
Open Source World June '21 -- JSON Within a Relational Database
Open Source World June '21 -- JSON Within a Relational DatabaseOpen Source World June '21 -- JSON Within a Relational Database
Open Source World June '21 -- JSON Within a Relational Database
 
Mule json transformers
Mule json transformersMule json transformers
Mule json transformers
 
JSON Processing and mule
JSON Processing and muleJSON Processing and mule
JSON Processing and mule
 
Cassandra
CassandraCassandra
Cassandra
 
Postgres level up
Postgres level upPostgres level up
Postgres level up
 
Introduction to mongo db
Introduction to mongo dbIntroduction to mongo db
Introduction to mongo db
 
Alternatives to Relational Databases
Alternatives to Relational DatabasesAlternatives to Relational Databases
Alternatives to Relational Databases
 
MongoDB basics & Introduction
MongoDB basics & IntroductionMongoDB basics & Introduction
MongoDB basics & Introduction
 
working with database using mysql
working with database using mysql working with database using mysql
working with database using mysql
 
IBM DB2 LUW/UDB DBA Training by www.etraining.guru
IBM DB2 LUW/UDB DBA Training by www.etraining.guruIBM DB2 LUW/UDB DBA Training by www.etraining.guru
IBM DB2 LUW/UDB DBA Training by www.etraining.guru
 
Mongo db basics
Mongo db basicsMongo db basics
Mongo db basics
 
Compiling EdgeQL
Compiling EdgeQLCompiling EdgeQL
Compiling EdgeQL
 
NoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryNoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love Story
 
Introduction to NoSQL Databases
Introduction to NoSQL DatabasesIntroduction to NoSQL Databases
Introduction to NoSQL Databases
 
MySQL Workbench for DFW Unix Users Group
MySQL Workbench for DFW Unix Users GroupMySQL Workbench for DFW Unix Users Group
MySQL Workbench for DFW Unix Users Group
 
SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database ...
SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database ...SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database ...
SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database ...
 
BITS: Introduction to relational databases and MySQL - SQL
BITS: Introduction to relational databases and MySQL - SQLBITS: Introduction to relational databases and MySQL - SQL
BITS: Introduction to relational databases and MySQL - SQL
 

Viewers also liked

ანი ოქროჭელიძე მე 10 კლასი პომპეი
ანი ოქროჭელიძე მე 10 კლასი პომპეიანი ოქროჭელიძე მე 10 კლასი პომპეი
ანი ოქროჭელიძე მე 10 კლასი პომპეი
Tamta Gachechiladze
 

Viewers also liked (20)

Tech computer
Tech computerTech computer
Tech computer
 
Shelter of Hope ministries
Shelter of Hope ministriesShelter of Hope ministries
Shelter of Hope ministries
 
cloud for entrepreneur
cloud for entrepreneurcloud for entrepreneur
cloud for entrepreneur
 
CLIF Notes July 2012
CLIF Notes July 2012CLIF Notes July 2012
CLIF Notes July 2012
 
Media evaluation
Media evaluationMedia evaluation
Media evaluation
 
Community Leaders Information Forum: Dec 2012 Notes
Community Leaders Information Forum: Dec 2012 NotesCommunity Leaders Information Forum: Dec 2012 Notes
Community Leaders Information Forum: Dec 2012 Notes
 
Connected Bikes: Connecting riders to their communities
Connected Bikes: Connecting riders to their communitiesConnected Bikes: Connecting riders to their communities
Connected Bikes: Connecting riders to their communities
 
Dj
DjDj
Dj
 
April 18, 2013 Mountaineer
April 18, 2013 MountaineerApril 18, 2013 Mountaineer
April 18, 2013 Mountaineer
 
Ensayo
EnsayoEnsayo
Ensayo
 
Presentación1
Presentación1Presentación1
Presentación1
 
Medicion
MedicionMedicion
Medicion
 
In Search of the Perfect Post
In Search of the Perfect PostIn Search of the Perfect Post
In Search of the Perfect Post
 
October 2014 CLIF Briefing
October 2014 CLIF BriefingOctober 2014 CLIF Briefing
October 2014 CLIF Briefing
 
1a part
1a part1a part
1a part
 
DonorPro WebSolutions Portfolio Tour
DonorPro WebSolutions Portfolio TourDonorPro WebSolutions Portfolio Tour
DonorPro WebSolutions Portfolio Tour
 
წალენჯიხის ტურისტული რესურსები
წალენჯიხის ტურისტული რესურსებიწალენჯიხის ტურისტული რესურსები
წალენჯიხის ტურისტული რესურსები
 
Excel v1.0
Excel v1.0Excel v1.0
Excel v1.0
 
ანი ოქროჭელიძე მე 10 კლასი პომპეი
ანი ოქროჭელიძე მე 10 კლასი პომპეიანი ოქროჭელიძე მე 10 კლასი პომპეი
ანი ოქროჭელიძე მე 10 კლასი პომპეი
 
Seo
SeoSeo
Seo
 

Similar to Android Level 2

android sqlite
android sqliteandroid sqlite
android sqlite
Deepa Rani
 
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfytxjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
WrushabhShirsat3
 

Similar to Android Level 2 (20)

Sq lite database
Sq lite databaseSq lite database
Sq lite database
 
android sqlite
android sqliteandroid sqlite
android sqlite
 
Sq lite
Sq liteSq lite
Sq lite
 
Obevo Javasig.pptx
Obevo Javasig.pptxObevo Javasig.pptx
Obevo Javasig.pptx
 
Asp .Net Database Connectivity Presentation.pptx
Asp .Net Database Connectivity Presentation.pptxAsp .Net Database Connectivity Presentation.pptx
Asp .Net Database Connectivity Presentation.pptx
 
Is SQLcl the Next Generation of SQL*Plus?
Is SQLcl the Next Generation of SQL*Plus?Is SQLcl the Next Generation of SQL*Plus?
Is SQLcl the Next Generation of SQL*Plus?
 
unit-ii.pptx
unit-ii.pptxunit-ii.pptx
unit-ii.pptx
 
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfytxjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
xjtrutdctrd5454drxxresersestryugyufy6rythgfytfyt
 
Introducing U-SQL (SQLPASS 2016)
Introducing U-SQL (SQLPASS 2016)Introducing U-SQL (SQLPASS 2016)
Introducing U-SQL (SQLPASS 2016)
 
Sqlite
SqliteSqlite
Sqlite
 
3 CityNetConf - sql+c#=u-sql
3 CityNetConf - sql+c#=u-sql3 CityNetConf - sql+c#=u-sql
3 CityNetConf - sql+c#=u-sql
 
Online Oracle Training For Beginners
Online Oracle Training For BeginnersOnline Oracle Training For Beginners
Online Oracle Training For Beginners
 
Sql server basics
Sql server basicsSql server basics
Sql server basics
 
Homework help on oracle
Homework help on oracleHomework help on oracle
Homework help on oracle
 
Sql data base
Sql data baseSql data base
Sql data base
 
SQLcl the next generation of SQLPlus?
SQLcl the next generation of SQLPlus?SQLcl the next generation of SQLPlus?
SQLcl the next generation of SQLPlus?
 
Sq lite module5
Sq lite module5Sq lite module5
Sq lite module5
 
Oracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAsOracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAs
 
Oracle Database 12c - New Features for Developers and DBAs
Oracle Database 12c  - New Features for Developers and DBAsOracle Database 12c  - New Features for Developers and DBAs
Oracle Database 12c - New Features for Developers and DBAs
 
Android sq lite-chapter 22
Android sq lite-chapter 22Android sq lite-chapter 22
Android sq lite-chapter 22
 

Recently uploaded

Recently uploaded (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 

Android Level 2

  • 1. Android Camp Mohamed Ibrahim Mobile Developer Core-Member
  • 2. Of R ev iew al ui ck ent A Q un dam as e F Da tab
  • 3.
  • 4. Type of Database in Android ● Internal Database like(Sqlite) ● External Database like(Content Provider)
  • 6. Internal Database ● Preferences ● Files ● SQLite ● Network
  • 7. What is SQLite !   ● SQLite is an open source Database ● Supports standard relational Database ● Requires only little memory at runtime (250KB) ● Support the data types : ○ TEXT ○ INTEGER ○ REAL ● SQLite doesn't validate if the types written in in the columns are actually of the defined type
  • 8. Why SQLite !! Si ng rce le n sou Fil e O pe less than 250KB Faster no setup or administration
  • 9.
  • 10.
  • 11.
  • 12.
  • 13. SQLite Architecture ● Package ○ android.database.sqlite ● SQLiteDatabase ○ insert _ delete _ update _query _ execSQL ● SQLiteOpenHelper ○ Create ○ Upgrade ○ open ○ close
  • 15. SQLiteOpenHelper subclass of SQLiteDatabase used to create ,upgrade,open and close database. ● constructor parameters ○ Context ○ String name //database name ○ CursorFactory factory // null ○ version //data base version we delete all constructor parameters except context but we wrote database name ,factory and version in the super of SQLiteDatabase ● Have 2 basis methods ○ onCreate //create our database and take one parameter //(SQLiteDatabase) ○ onUpgrade //used when we want to add new column or table //it take 3 parameter (SQLiteDatabas,old,new version)
  • 16. SQLiteDatabase ● Exposes methods to manage a SQLite DataBase: ○ insert insert(String tableName,String nullColumnHack,ContentValues values) ○ delete delete(String tableName,String whereClause,String[] whereArgs) ○ update update(String tableName,ContentValues values,String whereClause,String [] whereArgs ) ○ execSQL execSQL(String sql) ○ query query(String tableName, String[] columns,String selection,String[ ] selectionArg,String groupby,String having,String orderBy)
  • 17. Cursor moveToFirst
  • 18. Devmix ssion on bout this se Wait a rticle a website mix.org www.dev