Tuesday, 3 April 2012

Data Storage in Android


DATA STORAGES:
===============

1. Shared Preferences
             Store private primitive data in key-value pairs.
             The data will still be available in the device even if your application is killed.
             Types of data that can be saved are booleans, floats, ints, longs, and strings.
             The stored data can be used in different activity of your application.

2. Internal Storage (files)
            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.

3. External Storage (SD card)
            Store public data on the shared external storage.
            Files saved to the external storage are world-readable and can be modified by the user when they enable
            USB mass storage to transfer files on a computer.

4. SQLite Databases
             Store structured data in a private database.
             It is simply stored in a .db file, and accessed and queried through a simple library within the application.
            It is very quick and convenient for smaller applications, like Android apps.
           
5. Network Connection
             Store data on the web with your own network server.

             To do network operations, use classes in the following packages:
                 java.net.*
                 android.net.*




No comments:

Post a Comment