Android Data Persistence
While developing an android application always a question arise, how possibly efficient way we handle users data very well? Question that really matter for your application to be a likely to the user in terms of better use, require less time for start, take no time to get user left data again and most important security of the users data. All this terms which define your application main functionality are considered in the category of Android Data Persistence.
It is an important topic in application development as,
- User typically expect to reuse the data in the future.
- Data that user defined on their likely choices i.e. TextStyles, Backgrounds, TextFonts, Size, Sound, Titles, Notifications etc.
- Give quick access in the small time.
- Keeping them safe while use is away from the application and loading that all in no/minimal time when visits app again gives user a reliable, effective and fast user interface.
The way other technology provide this kind of functionality, Android provides three basic way for Android Data Persistence that can be use in accordance with relatable data. Those are,
- Shared Preferences : Light weight mechanism that stores data in (KEY, VALUE) pair mechanism.
- File System : Typical file system that require read/write operations to perform for data transfer.
- SQLite Database : A relational database system that can store data in the forms of different tables.
This article is just about basic intro of Android Data Persistence. In the following articles i’ll talk more about each of this above technique in depth and more with example. The following are the things that we will see,
- How to save simple data using SharedPreferences object?
- Use of Preference Activity.
- How to write and read data from files?
- Creating and using SQLite Database for your Android Application.
“Bless for you, Peace for the World” – Purvik