SlideShare a Scribd company logo
SQLite Database
What is SQLite?

• Open Source Database
• SQLite is available on every Android device
• It supports standard relational database features like
   – SQL syntax
   – transactions
   – SQL statements
Advantages of Using SQLite


• Very light weight database
• Requires very little memory
   – Approx. 250KB
• SQLite Database is automatically managed by
  Android Platform
SQLite Data Types
SQLite Data Types

• SQLite supports only three data types
   – TEXT                (like String)
   – INTEGER             (like int)
   – REAL                (like double)
• SQLite itself does not validate the data types
SQLiteOpenHelper
SQLiteOpenHelper Class

• It is a helper class used to manage database creation
  and version management
• We override the onCreate() and onUpgrade()
  methods in this class
• These methods are automatically called by the
  framework
SQLiteOpenHelper Class

• onCreate()
• This method is called
   – if the database does not exists
• onUpgrade()
• This method is called
   – if the database version is increased
SQLiteDatabase
SQLiteDatabase Class

• SQLiteDatabase is the base class for working with a
  SQLite database
• It provides various methods like :
   –   Open()
   –   Insert()
   –   Update()
   –   Close()
Content Values
ContentValues

• ContentValues are used to insert or update database
  entries
• Records are stored as key-value pair in
  ContentValues
• Where :
   – Key represents Column-Id
   – Value represents data for the Column-Id
Cursor
Cursor

• A query returns a Cursor object
• This Cursor points to a single row of the result
  fetched by the query
• Benefit :
   – No need to load all data into memory
Using the Content Providers
Content Providers-What are they

• A content provider manages access to a central repository of
  data.
• content providers are primarily intended to be used by other
  applications, which access the provider using a provider client
  object.
• An application accesses the data from a content provider with
  a ContentResolver client object
Content Providers Continued:

• The ContentProvider uses the path part of the content URI to
  choose the table to access
• Add a content provider uses permission to the manifest
• Provides methods to insert,update,delete,query
Coding Example :




 Demo Application !
•Q & A..?

More Related Content

What's hot

Lift SSIS package to Azure Data Factory V2
Lift SSIS package to Azure Data Factory V2Lift SSIS package to Azure Data Factory V2
Lift SSIS package to Azure Data Factory V2
Manjeet Singh
 
What is JavaScript? Edureka
What is JavaScript? EdurekaWhat is JavaScript? Edureka
What is JavaScript? Edureka
Edureka!
 
From Renamer Plugin to Polyglot IDE
From Renamer Plugin to Polyglot IDEFrom Renamer Plugin to Polyglot IDE
From Renamer Plugin to Polyglot IDE
intelliyole
 
ETL in the Cloud With Microsoft Azure
ETL in the Cloud With Microsoft AzureETL in the Cloud With Microsoft Azure
ETL in the Cloud With Microsoft Azure
Mark Kromer
 
SQL
SQLSQL
Database Project of a Corporation or Firm
Database Project of a Corporation or Firm Database Project of a Corporation or Firm
Database Project of a Corporation or Firm
Saqib Nadeem
 
CouchDB Vs MongoDB
CouchDB Vs MongoDBCouchDB Vs MongoDB
CouchDB Vs MongoDB
Gabriele Lana
 
MYSQL
MYSQLMYSQL
Урок 26. Елементи керування “кнопка”. Поняття об’єкту та його властивостей і ...
Урок 26. Елементи керування “кнопка”. Поняття об’єкту та його властивостей і ...Урок 26. Елементи керування “кнопка”. Поняття об’єкту та його властивостей і ...
Урок 26. Елементи керування “кнопка”. Поняття об’єкту та його властивостей і ...
Василь Тереховський
 
ASP.NET MVC.
ASP.NET MVC.ASP.NET MVC.
ASP.NET MVC.
Ni
 
Entity Framework Core
Entity Framework CoreEntity Framework Core
Entity Framework Core
Kiran Shahi
 
LINQ in C#
LINQ in C#LINQ in C#
LINQ in C#
Basant Medhat
 
Azure Synapse Analytics Overview (r2)
Azure Synapse Analytics Overview (r2)Azure Synapse Analytics Overview (r2)
Azure Synapse Analytics Overview (r2)
James Serra
 
MySQL Workbench Tutorial | Introduction To MySQL Workbench | MySQL DBA Traini...
MySQL Workbench Tutorial | Introduction To MySQL Workbench | MySQL DBA Traini...MySQL Workbench Tutorial | Introduction To MySQL Workbench | MySQL DBA Traini...
MySQL Workbench Tutorial | Introduction To MySQL Workbench | MySQL DBA Traini...
Edureka!
 
Understand front end developer
Understand front end developerUnderstand front end developer
Understand front end developer
Hsuan Fu Lien
 
Microsoft Data Integration Pipelines: Azure Data Factory and SSIS
Microsoft Data Integration Pipelines: Azure Data Factory and SSISMicrosoft Data Integration Pipelines: Azure Data Factory and SSIS
Microsoft Data Integration Pipelines: Azure Data Factory and SSIS
Mark Kromer
 
Moving from SQL Server to MongoDB
Moving from SQL Server to MongoDBMoving from SQL Server to MongoDB
Moving from SQL Server to MongoDB
Nick Court
 
An introduction to MongoDB
An introduction to MongoDBAn introduction to MongoDB
An introduction to MongoDB
Universidade de São Paulo
 
Sql Basics | Edureka
Sql Basics | EdurekaSql Basics | Edureka
Sql Basics | Edureka
Edureka!
 

What's hot (20)

Lift SSIS package to Azure Data Factory V2
Lift SSIS package to Azure Data Factory V2Lift SSIS package to Azure Data Factory V2
Lift SSIS package to Azure Data Factory V2
 
What is JavaScript? Edureka
What is JavaScript? EdurekaWhat is JavaScript? Edureka
What is JavaScript? Edureka
 
From Renamer Plugin to Polyglot IDE
From Renamer Plugin to Polyglot IDEFrom Renamer Plugin to Polyglot IDE
From Renamer Plugin to Polyglot IDE
 
ETL in the Cloud With Microsoft Azure
ETL in the Cloud With Microsoft AzureETL in the Cloud With Microsoft Azure
ETL in the Cloud With Microsoft Azure
 
SQL
SQLSQL
SQL
 
Database Project of a Corporation or Firm
Database Project of a Corporation or Firm Database Project of a Corporation or Firm
Database Project of a Corporation or Firm
 
CouchDB Vs MongoDB
CouchDB Vs MongoDBCouchDB Vs MongoDB
CouchDB Vs MongoDB
 
MYSQL
MYSQLMYSQL
MYSQL
 
Урок 26. Елементи керування “кнопка”. Поняття об’єкту та його властивостей і ...
Урок 26. Елементи керування “кнопка”. Поняття об’єкту та його властивостей і ...Урок 26. Елементи керування “кнопка”. Поняття об’єкту та його властивостей і ...
Урок 26. Елементи керування “кнопка”. Поняття об’єкту та його властивостей і ...
 
ASP.NET MVC.
ASP.NET MVC.ASP.NET MVC.
ASP.NET MVC.
 
Entity Framework Core
Entity Framework CoreEntity Framework Core
Entity Framework Core
 
LINQ in C#
LINQ in C#LINQ in C#
LINQ in C#
 
Azure Synapse Analytics Overview (r2)
Azure Synapse Analytics Overview (r2)Azure Synapse Analytics Overview (r2)
Azure Synapse Analytics Overview (r2)
 
MySQL Workbench Tutorial | Introduction To MySQL Workbench | MySQL DBA Traini...
MySQL Workbench Tutorial | Introduction To MySQL Workbench | MySQL DBA Traini...MySQL Workbench Tutorial | Introduction To MySQL Workbench | MySQL DBA Traini...
MySQL Workbench Tutorial | Introduction To MySQL Workbench | MySQL DBA Traini...
 
Understand front end developer
Understand front end developerUnderstand front end developer
Understand front end developer
 
Microsoft Data Integration Pipelines: Azure Data Factory and SSIS
Microsoft Data Integration Pipelines: Azure Data Factory and SSISMicrosoft Data Integration Pipelines: Azure Data Factory and SSIS
Microsoft Data Integration Pipelines: Azure Data Factory and SSIS
 
Moving from SQL Server to MongoDB
Moving from SQL Server to MongoDBMoving from SQL Server to MongoDB
Moving from SQL Server to MongoDB
 
An introduction to MongoDB
An introduction to MongoDBAn introduction to MongoDB
An introduction to MongoDB
 
SQL
SQLSQL
SQL
 
Sql Basics | Edureka
Sql Basics | EdurekaSql Basics | Edureka
Sql Basics | Edureka
 

Viewers also liked

Android Training (Animation)
Android Training (Animation)Android Training (Animation)
Android Training (Animation)
Khaled Anaqwa
 
Android webinar class_1
Android webinar class_1Android webinar class_1
Android webinar class_1Edureka!
 
Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)
Khaled Anaqwa
 
Android share preferences
Android share preferencesAndroid share preferences
Android share preferences
Ajay Panchal
 
ANDROID presentation prabal
ANDROID presentation prabalANDROID presentation prabal
ANDROID presentation prabalPrabal Tyagi
 

Viewers also liked (6)

Android Training (Animation)
Android Training (Animation)Android Training (Animation)
Android Training (Animation)
 
Android webinar class_1
Android webinar class_1Android webinar class_1
Android webinar class_1
 
Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)
 
Android share preferences
Android share preferencesAndroid share preferences
Android share preferences
 
ANDROID presentation prabal
ANDROID presentation prabalANDROID presentation prabal
ANDROID presentation prabal
 
Mvc architecture
Mvc architectureMvc architecture
Mvc architecture
 

Similar to Android webinar class_6

SQLite Opening .pptx
SQLite Opening .pptxSQLite Opening .pptx
SQLite Opening .pptx
ImranS18
 
Android Database
Android DatabaseAndroid Database
Android Database
Dr Karthikeyan Periasamy
 
Shshsjsjsjs-4 - Copdjsjjsjsjsjakakakaaky.pptx
Shshsjsjsjs-4 - Copdjsjjsjsjsjakakakaaky.pptxShshsjsjsjs-4 - Copdjsjjsjsjsjakakakaaky.pptx
Shshsjsjsjs-4 - Copdjsjjsjsjsjakakakaaky.pptx
086ChintanPatel1
 
Sql Server2008
Sql Server2008Sql Server2008
Sql Server2008
Microsoft Iceland
 
Sqlite
SqliteSqlite
Sqlite
Kumar
 
Week 7 Data PersistenceSQLite.pptx
Week 7 Data PersistenceSQLite.pptxWeek 7 Data PersistenceSQLite.pptx
Week 7 Data PersistenceSQLite.pptx
ALIEMOSESBANGURA
 
Bringing DevOps to the Database
Bringing DevOps to the DatabaseBringing DevOps to the Database
Bringing DevOps to the Database
Michaela Murray
 
php databse handling
php databse handlingphp databse handling
php databse handling
kunj desai
 
World2016_T5_S5_SQLServerFunctionalOverview
World2016_T5_S5_SQLServerFunctionalOverviewWorld2016_T5_S5_SQLServerFunctionalOverview
World2016_T5_S5_SQLServerFunctionalOverviewFarah Omer
 
Sq lite database
Sq lite databaseSq lite database
Sq lite database
AYESHA JAVED
 
SQL Server Upgrade and Consolidation - Methodology and Approach
SQL Server Upgrade and Consolidation - Methodology and ApproachSQL Server Upgrade and Consolidation - Methodology and Approach
SQL Server Upgrade and Consolidation - Methodology and Approach
Indra Dharmawan
 
Sql data base
Sql data baseSql data base
Sql data base
Ali Jafar
 
Introduction to Azure Data Lake and U-SQL for SQL users (SQL Saturday 635)
Introduction to Azure Data Lake and U-SQL for SQL users (SQL Saturday 635)Introduction to Azure Data Lake and U-SQL for SQL users (SQL Saturday 635)
Introduction to Azure Data Lake and U-SQL for SQL users (SQL Saturday 635)
Michael Rys
 
SilverStripe From a Developer's Perspective
SilverStripe From a Developer's PerspectiveSilverStripe From a Developer's Perspective
SilverStripe From a Developer's Perspective
ajshort
 
SQLDay2013_Denny Cherry - Table indexing for the .NET Developer
SQLDay2013_Denny Cherry - Table indexing for the .NET DeveloperSQLDay2013_Denny Cherry - Table indexing for the .NET Developer
SQLDay2013_Denny Cherry - Table indexing for the .NET DeveloperPolish SQL Server User Group
 
Rdbms
RdbmsRdbms
Query editor for multi databases
Query editor for multi databasesQuery editor for multi databases
Query editor for multi databases
Aarthi Raghavendra
 
Entity framework code first
Entity framework code firstEntity framework code first
Entity framework code firstConfiz
 
Database
DatabaseDatabase

Similar to Android webinar class_6 (20)

SQLite Opening .pptx
SQLite Opening .pptxSQLite Opening .pptx
SQLite Opening .pptx
 
Android Database
Android DatabaseAndroid Database
Android Database
 
Shshsjsjsjs-4 - Copdjsjjsjsjsjakakakaaky.pptx
Shshsjsjsjs-4 - Copdjsjjsjsjsjakakakaaky.pptxShshsjsjsjs-4 - Copdjsjjsjsjsjakakakaaky.pptx
Shshsjsjsjs-4 - Copdjsjjsjsjsjakakakaaky.pptx
 
Sql Server2008
Sql Server2008Sql Server2008
Sql Server2008
 
Sqlite
SqliteSqlite
Sqlite
 
Week 7 Data PersistenceSQLite.pptx
Week 7 Data PersistenceSQLite.pptxWeek 7 Data PersistenceSQLite.pptx
Week 7 Data PersistenceSQLite.pptx
 
Bringing DevOps to the Database
Bringing DevOps to the DatabaseBringing DevOps to the Database
Bringing DevOps to the Database
 
php databse handling
php databse handlingphp databse handling
php databse handling
 
World2016_T5_S5_SQLServerFunctionalOverview
World2016_T5_S5_SQLServerFunctionalOverviewWorld2016_T5_S5_SQLServerFunctionalOverview
World2016_T5_S5_SQLServerFunctionalOverview
 
Sq lite database
Sq lite databaseSq lite database
Sq lite database
 
Revision
RevisionRevision
Revision
 
SQL Server Upgrade and Consolidation - Methodology and Approach
SQL Server Upgrade and Consolidation - Methodology and ApproachSQL Server Upgrade and Consolidation - Methodology and Approach
SQL Server Upgrade and Consolidation - Methodology and Approach
 
Sql data base
Sql data baseSql data base
Sql data base
 
Introduction to Azure Data Lake and U-SQL for SQL users (SQL Saturday 635)
Introduction to Azure Data Lake and U-SQL for SQL users (SQL Saturday 635)Introduction to Azure Data Lake and U-SQL for SQL users (SQL Saturday 635)
Introduction to Azure Data Lake and U-SQL for SQL users (SQL Saturday 635)
 
SilverStripe From a Developer's Perspective
SilverStripe From a Developer's PerspectiveSilverStripe From a Developer's Perspective
SilverStripe From a Developer's Perspective
 
SQLDay2013_Denny Cherry - Table indexing for the .NET Developer
SQLDay2013_Denny Cherry - Table indexing for the .NET DeveloperSQLDay2013_Denny Cherry - Table indexing for the .NET Developer
SQLDay2013_Denny Cherry - Table indexing for the .NET Developer
 
Rdbms
RdbmsRdbms
Rdbms
 
Query editor for multi databases
Query editor for multi databasesQuery editor for multi databases
Query editor for multi databases
 
Entity framework code first
Entity framework code firstEntity framework code first
Entity framework code first
 
Database
DatabaseDatabase
Database
 

More from Edureka!

What to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaWhat to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | Edureka
Edureka!
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | Edureka
Edureka!
 
Top 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaTop 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | Edureka
Edureka!
 
Tableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaTableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | Edureka
Edureka!
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | Edureka
Edureka!
 
Top 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaTop 5 PMP Certifications | Edureka
Top 5 PMP Certifications | Edureka
Edureka!
 
Top Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaTop Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | Edureka
Edureka!
 
Linux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaLinux Mint Tutorial | Edureka
Linux Mint Tutorial | Edureka
Edureka!
 
How to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaHow to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| Edureka
Edureka!
 
Importance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaImportance of Digital Marketing | Edureka
Importance of Digital Marketing | Edureka
Edureka!
 
RPA in 2020 | Edureka
RPA in 2020 | EdurekaRPA in 2020 | Edureka
RPA in 2020 | Edureka
Edureka!
 
Email Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEmail Notifications in Jenkins | Edureka
Email Notifications in Jenkins | Edureka
Edureka!
 
EA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | Edureka
Edureka!
 
Cognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaCognitive AI Tutorial | Edureka
Cognitive AI Tutorial | Edureka
Edureka!
 
AWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaAWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | Edureka
Edureka!
 
Blue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaBlue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | Edureka
Edureka!
 
Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka
Edureka!
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Edureka!
 
Kubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaKubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | Edureka
Edureka!
 
Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | Edureka
Edureka!
 

More from Edureka! (20)

What to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaWhat to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | Edureka
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | Edureka
 
Top 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaTop 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | Edureka
 
Tableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaTableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | Edureka
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | Edureka
 
Top 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaTop 5 PMP Certifications | Edureka
Top 5 PMP Certifications | Edureka
 
Top Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaTop Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | Edureka
 
Linux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaLinux Mint Tutorial | Edureka
Linux Mint Tutorial | Edureka
 
How to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaHow to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| Edureka
 
Importance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaImportance of Digital Marketing | Edureka
Importance of Digital Marketing | Edureka
 
RPA in 2020 | Edureka
RPA in 2020 | EdurekaRPA in 2020 | Edureka
RPA in 2020 | Edureka
 
Email Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEmail Notifications in Jenkins | Edureka
Email Notifications in Jenkins | Edureka
 
EA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | Edureka
 
Cognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaCognitive AI Tutorial | Edureka
Cognitive AI Tutorial | Edureka
 
AWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaAWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | Edureka
 
Blue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaBlue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | Edureka
 
Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
 
Kubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaKubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | Edureka
 
Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | Edureka
 

Android webinar class_6

  • 2. What is SQLite? • Open Source Database • SQLite is available on every Android device • It supports standard relational database features like – SQL syntax – transactions – SQL statements
  • 3. Advantages of Using SQLite • Very light weight database • Requires very little memory – Approx. 250KB • SQLite Database is automatically managed by Android Platform
  • 5. SQLite Data Types • SQLite supports only three data types – TEXT (like String) – INTEGER (like int) – REAL (like double) • SQLite itself does not validate the data types
  • 7. SQLiteOpenHelper Class • It is a helper class used to manage database creation and version management • We override the onCreate() and onUpgrade() methods in this class • These methods are automatically called by the framework
  • 8. SQLiteOpenHelper Class • onCreate() • This method is called – if the database does not exists • onUpgrade() • This method is called – if the database version is increased
  • 10. SQLiteDatabase Class • SQLiteDatabase is the base class for working with a SQLite database • It provides various methods like : – Open() – Insert() – Update() – Close()
  • 12. ContentValues • ContentValues are used to insert or update database entries • Records are stored as key-value pair in ContentValues • Where : – Key represents Column-Id – Value represents data for the Column-Id
  • 14. Cursor • A query returns a Cursor object • This Cursor points to a single row of the result fetched by the query • Benefit : – No need to load all data into memory
  • 15. Using the Content Providers
  • 16. Content Providers-What are they • A content provider manages access to a central repository of data. • content providers are primarily intended to be used by other applications, which access the provider using a provider client object. • An application accesses the data from a content provider with a ContentResolver client object
  • 17. Content Providers Continued: • The ContentProvider uses the path part of the content URI to choose the table to access • Add a content provider uses permission to the manifest • Provides methods to insert,update,delete,query
  • 18. Coding Example : Demo Application !

Editor's Notes

  1. such as development toolkits for other programming languages, and can write and contribute their own plug-in modules.
  2. such as development toolkits for other programming languages, and can write and contribute their own plug-in modules.