SlideShare une entreprise Scribd logo
1  sur  19
Télécharger pour lire hors ligne
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



*__^

Contenu connexe

Tendances

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
 

Tendances (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
 

En vedette

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

En vedette (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
 

Similaire à Android Level 2

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

Similaire à 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
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
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
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
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
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 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
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

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