SlideShare une entreprise Scribd logo
1  sur  15
Télécharger pour lire hors ligne
Android Development
Beyond the Basics
S.Vanjikumaran
Saving the Data
● Most Android apps need to save data!! even
if only to save information about the app
state during onPause() so the user's
progress is not lost.
● Most non-trivial apps also need to save user
settings, and some apps must manage large
amounts of information in files and
databases.
Saving Key-Value Sets
● If you have a relatively small collection of
key-values that you'd like to save, you
should use the SharedPreferences APIs.
Saving Files
● Android uses a file system that's similar to
disk-based file systems on other platforms.
This lesson describes how to work with the
Android file system to read and write files
with the File APIs.
Saving Data in SQL Database
● Saving data to a database is ideal for
repeating or structured data, such as contact
information. This class assumes that you are
familiar with SQL databases in general and
helps you get started with SQLite databases
on Android. The APIs you'll need to use a
database on Android are available in the
android.database.sqlite package.
What is SQLite?
● SQLite is an Open Source Database
● supports standard relational database
features
● It requires only little memory at runtime
● SQLite supports the data types
SQLite in Android
● SQLite is available on every Android device
● SQLite database in android does not require
any database setup
SQLite Architecture
SQL 101
● DML
● DDL
First Ever Database in Android
● What you need to know?
○ android.database.sqlite package
●
First Ever Database in Android
● Defines the table name and column names
for a single table
First Ever Database in Android
● Create a Database Using a SQL Helper
First Ever Database in Android
● Insert data into the database by passing a
ContentValues object to the insert() method
First Ever Database in Android
● Read Information from a Database
First Ever Database in Android
● When you need to modify a subset of your
database values, use the update() method.

Contenu connexe

Similaire à Android development beyond the basics

Android local databases
Android local databasesAndroid local databases
Android local databasesFatimaYousif11
 
Iphone programming: Core Data Tutorial for iOS
Iphone programming: Core Data Tutorial for iOSIphone programming: Core Data Tutorial for iOS
Iphone programming: Core Data Tutorial for iOSKenny Nguyen
 
12_Data_Storage_Part_2.pptx
12_Data_Storage_Part_2.pptx12_Data_Storage_Part_2.pptx
12_Data_Storage_Part_2.pptxFaezNasir
 
Android developer fundamentals training overview Part II
Android developer fundamentals training overview Part IIAndroid developer fundamentals training overview Part II
Android developer fundamentals training overview Part IIYoza Aprilio
 
Implementation of sql server based on sqlite engine on
Implementation of sql server based on sqlite engine onImplementation of sql server based on sqlite engine on
Implementation of sql server based on sqlite engine oneSAT Publishing House
 
SQLite in Flutter.pptx
SQLite in Flutter.pptxSQLite in Flutter.pptx
SQLite in Flutter.pptxNabin Dhakal
 
Dicoding Developer Coaching #26: Android | Menyimpan Database dengan Lebih Si...
Dicoding Developer Coaching #26: Android | Menyimpan Database dengan Lebih Si...Dicoding Developer Coaching #26: Android | Menyimpan Database dengan Lebih Si...
Dicoding Developer Coaching #26: Android | Menyimpan Database dengan Lebih Si...DicodingEvent
 
Android App Development 05 : Saving Data
Android App Development 05 : Saving DataAndroid App Development 05 : Saving Data
Android App Development 05 : Saving DataAnuchit Chalothorn
 
Database Systems - Introduction to SQL (Chapter 3/1)
Database Systems - Introduction to SQL (Chapter 3/1)Database Systems - Introduction to SQL (Chapter 3/1)
Database Systems - Introduction to SQL (Chapter 3/1)Vidyasagar Mundroy
 
Great IDEs for SQL Query Performance Tuning and Practice.pdf
Great IDEs for SQL Query Performance Tuning and Practice.pdfGreat IDEs for SQL Query Performance Tuning and Practice.pdf
Great IDEs for SQL Query Performance Tuning and Practice.pdfTosska Technology
 
Microsoft ignite 2018 SQL Server 2019 big data clusters - intro session
Microsoft ignite 2018  SQL Server 2019 big data clusters - intro sessionMicrosoft ignite 2018  SQL Server 2019 big data clusters - intro session
Microsoft ignite 2018 SQL Server 2019 big data clusters - intro sessionTravis Wright
 

Similaire à Android development beyond the basics (20)

Android local databases
Android local databasesAndroid local databases
Android local databases
 
Iphone programming: Core Data Tutorial for iOS
Iphone programming: Core Data Tutorial for iOSIphone programming: Core Data Tutorial for iOS
Iphone programming: Core Data Tutorial for iOS
 
12_Data_Storage_Part_2.pptx
12_Data_Storage_Part_2.pptx12_Data_Storage_Part_2.pptx
12_Data_Storage_Part_2.pptx
 
Android developer fundamentals training overview Part II
Android developer fundamentals training overview Part IIAndroid developer fundamentals training overview Part II
Android developer fundamentals training overview Part II
 
Implementation of sql server based on sqlite engine on
Implementation of sql server based on sqlite engine onImplementation of sql server based on sqlite engine on
Implementation of sql server based on sqlite engine on
 
SQLite in Flutter.pptx
SQLite in Flutter.pptxSQLite in Flutter.pptx
SQLite in Flutter.pptx
 
SQLite database in android
SQLite database in androidSQLite database in android
SQLite database in android
 
Sqlite Multiple Table
Sqlite Multiple TableSqlite Multiple Table
Sqlite Multiple Table
 
Save data locally
Save data locallySave data locally
Save data locally
 
Database in Android
Database in AndroidDatabase in Android
Database in Android
 
Dicoding Developer Coaching #26: Android | Menyimpan Database dengan Lebih Si...
Dicoding Developer Coaching #26: Android | Menyimpan Database dengan Lebih Si...Dicoding Developer Coaching #26: Android | Menyimpan Database dengan Lebih Si...
Dicoding Developer Coaching #26: Android | Menyimpan Database dengan Lebih Si...
 
SSDT unleashed
SSDT unleashedSSDT unleashed
SSDT unleashed
 
Android App Development 05 : Saving Data
Android App Development 05 : Saving DataAndroid App Development 05 : Saving Data
Android App Development 05 : Saving Data
 
Database Systems - Introduction to SQL (Chapter 3/1)
Database Systems - Introduction to SQL (Chapter 3/1)Database Systems - Introduction to SQL (Chapter 3/1)
Database Systems - Introduction to SQL (Chapter 3/1)
 
U nit 1_dbms
U nit 1_dbmsU nit 1_dbms
U nit 1_dbms
 
Great IDEs for SQL Query Performance Tuning and Practice.pdf
Great IDEs for SQL Query Performance Tuning and Practice.pdfGreat IDEs for SQL Query Performance Tuning and Practice.pdf
Great IDEs for SQL Query Performance Tuning and Practice.pdf
 
Storage 8
Storage   8Storage   8
Storage 8
 
PHP Oracle
PHP OraclePHP Oracle
PHP Oracle
 
Sqlite
SqliteSqlite
Sqlite
 
Microsoft ignite 2018 SQL Server 2019 big data clusters - intro session
Microsoft ignite 2018  SQL Server 2019 big data clusters - intro sessionMicrosoft ignite 2018  SQL Server 2019 big data clusters - intro session
Microsoft ignite 2018 SQL Server 2019 big data clusters - intro session
 

Plus de Vanjikumaran Sivajothy

Plus de Vanjikumaran Sivajothy (10)

Peaceful Distributed Microservice Architecture
Peaceful Distributed Microservice ArchitecturePeaceful Distributed Microservice Architecture
Peaceful Distributed Microservice Architecture
 
Demystifying API Management for Serverless Services
Demystifying  API Management  for Serverless ServicesDemystifying  API Management  for Serverless Services
Demystifying API Management for Serverless Services
 
Best Practice With PLSQL
Best Practice With PLSQLBest Practice With PLSQL
Best Practice With PLSQL
 
Sign Language recognition Presentation
Sign Language recognition Presentation Sign Language recognition Presentation
Sign Language recognition Presentation
 
Framework for hand gesture controlled video game
Framework for hand gesture controlled video gameFramework for hand gesture controlled video game
Framework for hand gesture controlled video game
 
Software architectures
Software architecturesSoftware architectures
Software architectures
 
Middleware Simplified
Middleware SimplifiedMiddleware Simplified
Middleware Simplified
 
OAuth2 simplified
OAuth2   simplifiedOAuth2   simplified
OAuth2 simplified
 
Hello androidforyarlmeetup
Hello androidforyarlmeetupHello androidforyarlmeetup
Hello androidforyarlmeetup
 
Foss con2011
Foss con2011Foss con2011
Foss con2011
 

Dernier

Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 

Dernier (20)

Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 

Android development beyond the basics

  • 1. Android Development Beyond the Basics S.Vanjikumaran
  • 2. Saving the Data ● Most Android apps need to save data!! even if only to save information about the app state during onPause() so the user's progress is not lost. ● Most non-trivial apps also need to save user settings, and some apps must manage large amounts of information in files and databases.
  • 3. Saving Key-Value Sets ● If you have a relatively small collection of key-values that you'd like to save, you should use the SharedPreferences APIs.
  • 4. Saving Files ● Android uses a file system that's similar to disk-based file systems on other platforms. This lesson describes how to work with the Android file system to read and write files with the File APIs.
  • 5. Saving Data in SQL Database ● Saving data to a database is ideal for repeating or structured data, such as contact information. This class assumes that you are familiar with SQL databases in general and helps you get started with SQLite databases on Android. The APIs you'll need to use a database on Android are available in the android.database.sqlite package.
  • 6. What is SQLite? ● SQLite is an Open Source Database ● supports standard relational database features ● It requires only little memory at runtime ● SQLite supports the data types
  • 7. SQLite in Android ● SQLite is available on every Android device ● SQLite database in android does not require any database setup
  • 10. First Ever Database in Android ● What you need to know? ○ android.database.sqlite package ●
  • 11. First Ever Database in Android ● Defines the table name and column names for a single table
  • 12. First Ever Database in Android ● Create a Database Using a SQL Helper
  • 13. First Ever Database in Android ● Insert data into the database by passing a ContentValues object to the insert() method
  • 14. First Ever Database in Android ● Read Information from a Database
  • 15. First Ever Database in Android ● When you need to modify a subset of your database values, use the update() method.