SlideShare une entreprise Scribd logo
1  sur  19
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..?

Contenu connexe

Tendances

ASP.NET Web API
ASP.NET Web APIASP.NET Web API
ASP.NET Web API
habib_786
 
Retrieving data using the sql select statement
Retrieving data using the sql select statementRetrieving data using the sql select statement
Retrieving data using the sql select statement
Syed Zaid Irshad
 

Tendances (20)

Selenium WebDriver with Java
Selenium WebDriver with JavaSelenium WebDriver with Java
Selenium WebDriver with Java
 
API_Testing_with_Postman
API_Testing_with_PostmanAPI_Testing_with_Postman
API_Testing_with_Postman
 
Solucionando a Teoria do Caos com Cypress.io
Solucionando a Teoria do Caos com Cypress.ioSolucionando a Teoria do Caos com Cypress.io
Solucionando a Teoria do Caos com Cypress.io
 
Query Optimization in SQL Server
Query Optimization in SQL ServerQuery Optimization in SQL Server
Query Optimization in SQL Server
 
REST API testing with SpecFlow
REST API testing with SpecFlowREST API testing with SpecFlow
REST API testing with SpecFlow
 
Asp.Net Core MVC with Entity Framework
Asp.Net Core MVC with Entity FrameworkAsp.Net Core MVC with Entity Framework
Asp.Net Core MVC with Entity Framework
 
SQL Differences SQL Interview Questions
SQL Differences  SQL Interview QuestionsSQL Differences  SQL Interview Questions
SQL Differences SQL Interview Questions
 
Selenium WebDriver
Selenium WebDriverSelenium WebDriver
Selenium WebDriver
 
C# operators
C# operatorsC# operators
C# operators
 
C# Access modifiers
C# Access modifiersC# Access modifiers
C# Access modifiers
 
TestNG Annotations in Selenium | Edureka
TestNG Annotations in Selenium | EdurekaTestNG Annotations in Selenium | Edureka
TestNG Annotations in Selenium | Edureka
 
Design Pattern (Strategy & Template)
Design Pattern (Strategy & Template)Design Pattern (Strategy & Template)
Design Pattern (Strategy & Template)
 
Developing an ASP.NET Web Application
Developing an ASP.NET Web ApplicationDeveloping an ASP.NET Web Application
Developing an ASP.NET Web Application
 
javathreads
javathreadsjavathreads
javathreads
 
ASP.NET Web API
ASP.NET Web APIASP.NET Web API
ASP.NET Web API
 
Retrieving data using the sql select statement
Retrieving data using the sql select statementRetrieving data using the sql select statement
Retrieving data using the sql select statement
 
salesforce triggers interview questions and answers
salesforce triggers interview questions and answerssalesforce triggers interview questions and answers
salesforce triggers interview questions and answers
 
Oracle Forms: Master Detail form
Oracle Forms: Master Detail formOracle Forms: Master Detail form
Oracle Forms: Master Detail form
 
Web api
Web apiWeb api
Web api
 
Selenium WebDriver with C#
Selenium WebDriver with C#Selenium WebDriver with C#
Selenium WebDriver with C#
 

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

Similaire à Android webinar class_6

Shshsjsjsjs-4 - Copdjsjjsjsjsjakakakaaky.pptx
Shshsjsjsjs-4 - Copdjsjjsjsjsjakakakaaky.pptxShshsjsjsjs-4 - Copdjsjjsjsjsjakakakaaky.pptx
Shshsjsjsjs-4 - Copdjsjjsjsjsjakakakaaky.pptx
086ChintanPatel1
 
World2016_T5_S5_SQLServerFunctionalOverview
World2016_T5_S5_SQLServerFunctionalOverviewWorld2016_T5_S5_SQLServerFunctionalOverview
World2016_T5_S5_SQLServerFunctionalOverview
Farah Omer
 
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
Polish SQL Server User Group
 
Entity framework code first
Entity framework code firstEntity framework code first
Entity framework code first
Confiz
 

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

Plus de Edureka!

Plus de 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 !

Notes de l'éditeur

  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.