MC Unit 5 Notes
MC Unit 5 Notes
Questions to be discussed:
1. What do you mean by data persistent?
2. Explain different data storage options in an android.
3. What is SQLite database? Discuss its advantage & disadvantage.
4. Discuss various operations performed on SQLite database
5. What is APK? How to develop APK files?
Diploma : CSE (All Paper) By : Alok Sir (Mob. No.: +91-80 84 370 470)
2 CTH EDUCATION
Storing the data persistently:
Persistent storage is any data storage device that retains data after power to that device is shut off.
It is also sometimes referred to as non-volatile storage.
Android provides several options for you to save persistent application data.
Your data storage options are the following:
1. Shared Preferences
2. Internal Storage
3. External Storage
4. Content provider
5. SQLite Databases
Shared Preferences:
Store private primitive data in key-value pairs.
The Shared Preferences class provides a general framework that allows you to save and retrieve
persistent key-value pairs of primitive data types.
You can use Shared Preferences to save any primitive data: boolean, floats, int, long, and string.
Internal Storage:
Store private data on the device memory.
You can save files directly on the device's internal storage.
By default, files saved to the internal storage are private to your application
and other applications cannot access them (nor can the user).
When the user uninstalls your application, these files are removed.
External Storage:
Store public data on the shared external storage.
External storage is used to store application data, such as SD card.
In general there are two types of External Storage:
1. Primary External Storage
2. Secondary External Storage
Diploma : CSE (All Paper) By : Alok Sir (Mob. No.: +91-80 84 370 470)
3 CTH EDUCATION
Content provider:
A content provider component supplies data from one application to others on request.
Such requests are handled by the methods of the Content Resolver class.
A content provider can use different ways to store its data and the data can be stored in a database, in
files, or even over a network.
Sometimes it is required to share data across applications then content providers become very useful.
What is database?
It is an organized collection of structured information or data that stored electronically in computer.
A database is usually controlled and managed by database management system (DBMS).
Most commonly used database is SQL.
SQLite database is used in android.
Diploma : CSE (All Paper) By : Alok Sir (Mob. No.: +91-80 84 370 470)
4 CTH EDUCATION
SQLite Advantages SQLite Disadvantages
Lightweight SQLite is used to handle low to medium traffic HTTP requests.
Better Performance Database size is restricted to 2GB in most cases.
No Installation Needed
Portable
What is APK?
APK stand for Android Application Package.
It is a package file format used by android OS for distribution and installation of mobile app.
It is similar to executable file .exe in windows operating system.
The extension of APK file is .apk.
It is installed on android operating system.
Diploma : CSE (All Paper) By : Alok Sir (Mob. No.: +91-80 84 370 470)