SlideShare a Scribd company logo
1 of 15
Data Storage
Lecture # 11
Software for Mobile Devices
Shared Preferences
• Shared Preferences are XML files to store private primitive
data in key-value pairs. Data Types include Booleans, floats,
ints, longs, and strings.
• Data saved in SharedPreferences file is accessible throughout
the application and persists even after the application closes
or across reboots.
• In order to use shared preferences, you have to call
a method getSharedPreferences() that returns a
SharedPreference instance pointing to the file that
contains the values of preferences.
How to use?
SharedPreferences sharedpreferences = getSharedPreferences
(“AppPreferences”, Context.MODE_PRIVATE);
• The first parameter is the key and the second
parameter is the MODE.
The data saved using SharedPreferences will be available
even after your application is killed.
The data persists when your application is upgraded!!
• You can save something in the sharedpreferences
by using SharedPreferences.Editor class
How to write something in shared
preference?
sharedpreferences.edit().putString("key", "value").apply();
SharedPreferences sharedpreferences =
getSharedPreferences(“AppPreferences”, Context.MODE_PRIVATE);
sharedpreferences.edit().putString("key", "value").commit();
Commit() saves data synchronously where as
apply() saves data in background (asynchronous).
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putString(Name, n);
editor.putString(Phone, ph);
editor.putString(Email, e);
editor.apply();
OR
Shared Preference Example
1. SharedPreferences sharedpreferences = getSharedPreferences
(“AppPreferences”, Context.MODE_PRIVATE);
1. String value = sharedpreferences.getString("key", "");
2. String value = sharedpreferences.getInt("key", 0);
Second Param is the Value to return if this preference does not exist.
Reading from Shared Preference
Using Sqlite for local data storage
SQLite is a opensource SQL database that stores data to a text file on a
device. Android comes in with built in SQLite database implementation.
SQLite supports all the relational database features. In order to access this
database, you don't need to establish any kind of connections for it like
JDBC,ODBC e.t.c
The main package is android.database.sqlite that contains the classes
to manage your own databases
Database - Helper class
For managing all the operations related to the database , an helper class
has been given and is called SQLiteOpenHelper. It automatically
manages the creation and update of the database.
public class DBHelper extends SQLiteOpenHelper {
public DBHelper(){
super(context,DATABASE_NAME,null,1);
}
public void onCreate(SQLiteDatabase db) {
}
public void onUpgrade(SQLiteDatabase database, int oldVersion,
int newVersion) {
}
}
Desktop sql viewer: https://sqlitebrowser.org/
https://stackoverflow.com/questions/17529766/view-
contents-of-database-file-in-android-studio
Creating a Database & Table
Inserting a Row in Table
1. Inserting data requires getting writable
instance (getWriteableDatabase()) on
database.
1. ContentValues() is used to define the
column name and its data to be stored.
Here, we are just setting the note value only
ignoring `id` and `timestamp` as these two
will be inserted automatically.
1. Every time the database connection has to
be closed once you are done with
database access. Calling db.close() closes
the connection.
Reading a Row in Table
1. Reading data requires getting readable
instance (getReadableDatabase()) on
database.
1. Db.query with params table and column
names with their values return the data set
to cursor.
1. Every time the database connection has to
be closed once you are done with
database access. Calling db.close() closes
the connection.
Cursors are what contain the result set of a query made
against a database in Android
db.close();
Database Libraries
1. Room
The Room persistence library provides an abstraction layer over SQLite to allow
for more robust database access while harnessing the full power of SQLite.
https://developer.android.com/training/data-storage/room/
2. Ormlite
ORMLite is lighter version of Object Relational Mapping which provide some
simple functionality for persisting java objects to SQL databases. It is ORM
wrapper over any mobile SQL related DB.
http://ormlite.com/android/examples/
http://ormlite.com/
1. GreenDao
greenDAO is an open source Android ORM making development for SQLite
databases fun again. It relieves developers from dealing with low-level
database requirements while saving development time.
http://greenrobot.org/greendao/
Tutorial: https://datarockets.com/blog/android-architecture-migrate-to-room-from-ormlite/
https://www.tldevtech.com/best-android-orm-libraries-to-use/
Permissions
Request permissions at runtime appropriately (in Android 6.0+)
1. Make sure you request permissions at the right time and appropriately educate
and inform your users about the need for permission requests.
Best practices
1. Educate the user before requesting a permission
2. Always check to see if the permission has been granted
3. Ensure users benefit from allowing a permission immediately
4. Help users undo permission denials
Tutorials: https://www.youtube.com/watch?v=iZqDdvhTZj0
https://www.youtube.com/watch?v=C8lUdPVSzDk
https://developer.android.com/training/permissions/requesting
Permissions
You should always check for and request permissions at runtime to guard against
runtime errors (SecurityException).
Dangerous Permissions
Dangerous permissions cover areas where the
app wants data or resources that involve the
user's private information, or could potentially
affect the user's stored data or the operation of
other apps
Only dangerous permissions require user
agreement.
An app must publicize the permissions it requires by
including <uses-permission> tags in the app manifest.
Requesting Permissions
Tutorials: https://www.youtube.com/watch?v=iZqDdvhTZj0
https://www.youtube.com/watch?v=C8lUdPVSzDk
https://developer.android.com/training/permissions/requesting
Homework
Create your semester project in Android Studio, integrate any database
library (Room, ormlite etc) for your project and write a simple
read/write/update operation.

More Related Content

Similar to Mobile Data Storage

Persistence on iOS
Persistence on iOSPersistence on iOS
Persistence on iOSMake School
 
Android datastorage
Android datastorageAndroid datastorage
Android datastorageKrazy Koder
 
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
 
Microsoft Entity Framework
Microsoft Entity FrameworkMicrosoft Entity Framework
Microsoft Entity FrameworkMahmoud Tolba
 
Database Performance Management in Cloud
Database Performance Management in CloudDatabase Performance Management in Cloud
Database Performance Management in CloudDr. Amarjeet Singh
 
Drupal 8 meets to symphony
Drupal 8 meets to symphonyDrupal 8 meets to symphony
Drupal 8 meets to symphonyBrahampal Singh
 
Database management system
Database management systemDatabase management system
Database management systemRizwanHafeez
 
Spring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applicationsSpring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applicationsmichaelaaron25322
 
How do I - Storage, FileSystem & SQL - Transcript.pdf
How do I - Storage, FileSystem & SQL - Transcript.pdfHow do I - Storage, FileSystem & SQL - Transcript.pdf
How do I - Storage, FileSystem & SQL - Transcript.pdfShaiAlmog1
 
Android Architecture Components
Android Architecture ComponentsAndroid Architecture Components
Android Architecture ComponentsDarshan Parikh
 
DSC - Shared Preferences and Room
DSC - Shared Preferences and RoomDSC - Shared Preferences and Room
DSC - Shared Preferences and RoomAgustinus Theodorus
 
High Availability And Oracle Data Guard 11g R2
High Availability And Oracle Data Guard 11g R2High Availability And Oracle Data Guard 11g R2
High Availability And Oracle Data Guard 11g R2Mario Redón Luz
 

Similar to Mobile Data Storage (20)

Persistence on iOS
Persistence on iOSPersistence on iOS
Persistence on iOS
 
Android datastorage
Android datastorageAndroid datastorage
Android datastorage
 
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
 
PHP Oracle
PHP OraclePHP Oracle
PHP Oracle
 
Microsoft Entity Framework
Microsoft Entity FrameworkMicrosoft Entity Framework
Microsoft Entity Framework
 
Sqllite
SqlliteSqllite
Sqllite
 
Database Performance Management in Cloud
Database Performance Management in CloudDatabase Performance Management in Cloud
Database Performance Management in Cloud
 
Drupal 8 meets to symphony
Drupal 8 meets to symphonyDrupal 8 meets to symphony
Drupal 8 meets to symphony
 
Entity Framework
Entity FrameworkEntity Framework
Entity Framework
 
PPT temp.pptx
PPT temp.pptxPPT temp.pptx
PPT temp.pptx
 
Database management system
Database management systemDatabase management system
Database management system
 
Spring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applicationsSpring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applications
 
How do I - Storage, FileSystem & SQL - Transcript.pdf
How do I - Storage, FileSystem & SQL - Transcript.pdfHow do I - Storage, FileSystem & SQL - Transcript.pdf
How do I - Storage, FileSystem & SQL - Transcript.pdf
 
Android - Saving data
Android - Saving dataAndroid - Saving data
Android - Saving data
 
Fundamentals of JAVA
Fundamentals of JAVAFundamentals of JAVA
Fundamentals of JAVA
 
Android Architecture Components
Android Architecture ComponentsAndroid Architecture Components
Android Architecture Components
 
DSC - Shared Preferences and Room
DSC - Shared Preferences and RoomDSC - Shared Preferences and Room
DSC - Shared Preferences and Room
 
Ef code first
Ef code firstEf code first
Ef code first
 
High Availability And Oracle Data Guard 11g R2
High Availability And Oracle Data Guard 11g R2High Availability And Oracle Data Guard 11g R2
High Availability And Oracle Data Guard 11g R2
 
Database in Android
Database in AndroidDatabase in Android
Database in Android
 

Recently uploaded

HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationAadityaSharma884161
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxLigayaBacuel1
 

Recently uploaded (20)

HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint Presentation
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptx
 

Mobile Data Storage

  • 1. Data Storage Lecture # 11 Software for Mobile Devices
  • 2. Shared Preferences • Shared Preferences are XML files to store private primitive data in key-value pairs. Data Types include Booleans, floats, ints, longs, and strings. • Data saved in SharedPreferences file is accessible throughout the application and persists even after the application closes or across reboots.
  • 3. • In order to use shared preferences, you have to call a method getSharedPreferences() that returns a SharedPreference instance pointing to the file that contains the values of preferences. How to use? SharedPreferences sharedpreferences = getSharedPreferences (“AppPreferences”, Context.MODE_PRIVATE); • The first parameter is the key and the second parameter is the MODE. The data saved using SharedPreferences will be available even after your application is killed. The data persists when your application is upgraded!!
  • 4. • You can save something in the sharedpreferences by using SharedPreferences.Editor class How to write something in shared preference? sharedpreferences.edit().putString("key", "value").apply(); SharedPreferences sharedpreferences = getSharedPreferences(“AppPreferences”, Context.MODE_PRIVATE); sharedpreferences.edit().putString("key", "value").commit(); Commit() saves data synchronously where as apply() saves data in background (asynchronous). SharedPreferences.Editor editor = sharedpreferences.edit(); editor.putString(Name, n); editor.putString(Phone, ph); editor.putString(Email, e); editor.apply(); OR
  • 5. Shared Preference Example 1. SharedPreferences sharedpreferences = getSharedPreferences (“AppPreferences”, Context.MODE_PRIVATE); 1. String value = sharedpreferences.getString("key", ""); 2. String value = sharedpreferences.getInt("key", 0); Second Param is the Value to return if this preference does not exist. Reading from Shared Preference
  • 6. Using Sqlite for local data storage SQLite is a opensource SQL database that stores data to a text file on a device. Android comes in with built in SQLite database implementation. SQLite supports all the relational database features. In order to access this database, you don't need to establish any kind of connections for it like JDBC,ODBC e.t.c The main package is android.database.sqlite that contains the classes to manage your own databases Database - Helper class For managing all the operations related to the database , an helper class has been given and is called SQLiteOpenHelper. It automatically manages the creation and update of the database. public class DBHelper extends SQLiteOpenHelper { public DBHelper(){ super(context,DATABASE_NAME,null,1); } public void onCreate(SQLiteDatabase db) { } public void onUpgrade(SQLiteDatabase database, int oldVersion, int newVersion) { } } Desktop sql viewer: https://sqlitebrowser.org/ https://stackoverflow.com/questions/17529766/view- contents-of-database-file-in-android-studio
  • 8. Inserting a Row in Table 1. Inserting data requires getting writable instance (getWriteableDatabase()) on database. 1. ContentValues() is used to define the column name and its data to be stored. Here, we are just setting the note value only ignoring `id` and `timestamp` as these two will be inserted automatically. 1. Every time the database connection has to be closed once you are done with database access. Calling db.close() closes the connection.
  • 9. Reading a Row in Table 1. Reading data requires getting readable instance (getReadableDatabase()) on database. 1. Db.query with params table and column names with their values return the data set to cursor. 1. Every time the database connection has to be closed once you are done with database access. Calling db.close() closes the connection. Cursors are what contain the result set of a query made against a database in Android db.close();
  • 10. Database Libraries 1. Room The Room persistence library provides an abstraction layer over SQLite to allow for more robust database access while harnessing the full power of SQLite. https://developer.android.com/training/data-storage/room/ 2. Ormlite ORMLite is lighter version of Object Relational Mapping which provide some simple functionality for persisting java objects to SQL databases. It is ORM wrapper over any mobile SQL related DB. http://ormlite.com/android/examples/ http://ormlite.com/ 1. GreenDao greenDAO is an open source Android ORM making development for SQLite databases fun again. It relieves developers from dealing with low-level database requirements while saving development time. http://greenrobot.org/greendao/ Tutorial: https://datarockets.com/blog/android-architecture-migrate-to-room-from-ormlite/ https://www.tldevtech.com/best-android-orm-libraries-to-use/
  • 11. Permissions Request permissions at runtime appropriately (in Android 6.0+) 1. Make sure you request permissions at the right time and appropriately educate and inform your users about the need for permission requests. Best practices 1. Educate the user before requesting a permission 2. Always check to see if the permission has been granted 3. Ensure users benefit from allowing a permission immediately 4. Help users undo permission denials Tutorials: https://www.youtube.com/watch?v=iZqDdvhTZj0 https://www.youtube.com/watch?v=C8lUdPVSzDk https://developer.android.com/training/permissions/requesting
  • 12. Permissions You should always check for and request permissions at runtime to guard against runtime errors (SecurityException).
  • 13. Dangerous Permissions Dangerous permissions cover areas where the app wants data or resources that involve the user's private information, or could potentially affect the user's stored data or the operation of other apps Only dangerous permissions require user agreement. An app must publicize the permissions it requires by including <uses-permission> tags in the app manifest.
  • 15. Homework Create your semester project in Android Studio, integrate any database library (Room, ormlite etc) for your project and write a simple read/write/update operation.