Using the Internal Storage
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.
To create and write a private file to the internal storage:
1.Call openFileOutput() with the name of the file and the operating mode. This returns a FileOutputStream.
2.Write to the file with write().
3.Close the stream with close().
Wednesday, June 1, 2011
Androi Data Storage
Android provides several options for you to save persistent application data. The solution you choose depends on your specific needs, such as whether the data should be private to your application or accessible to other applications (and the user) and how much space your data requires.
Your data storage options are the following:
Shared Preferences
Store private primitive data in key-value pairs.
Internal Storage
Store private data on the device memory.
External Storage
Store public data on the shared external storage.
SQLite Databases
Store structured data in a private database.
Network Connection
Store data on the web with your own network server.
Android provides a way for you to expose even your private data to other applications — with a content provider. A content provider is an optional component that exposes read/write access to your application data, subject to whatever restrictions you want to impose. For more information about using content providers, see the Content Providers documentation.
Your data storage options are the following:
Shared Preferences
Store private primitive data in key-value pairs.
Internal Storage
Store private data on the device memory.
External Storage
Store public data on the shared external storage.
SQLite Databases
Store structured data in a private database.
Network Connection
Store data on the web with your own network server.
Android provides a way for you to expose even your private data to other applications — with a content provider. A content provider is an optional component that exposes read/write access to your application data, subject to whatever restrictions you want to impose. For more information about using content providers, see the Content Providers documentation.
Labels:
Androi Data Storage,
android 3.1,
development
Android 3.1 PlatformIn this document
Android 3.1 PlatformIn this document
Revisions
API Overview
API Level
Built-in Applications
Locales
Emulator Skins
Reference
API Differences Report »
See Also
Optimizing Apps for Android 3.0
API Level: 12
For developers, the Android 3.1 platform is available as a downloadable component for the Android SDK. The downloadable platform includes an Android library and system image, as well as a set of emulator skins and more. The downloadable platform includes no external libraries.
To get started developing or testing against Android 3.1, use the Android SDK Manager to download the platform into your SDK. For more information, see Adding SDK Components. If you are new to Android, download the SDK Starter Package first.
For a high-level introduction to Android 3.1, see the Platform Highlights.
Reminder: If you've already published an Android application, please test and optimize your application on Android 3.0 and Android 3.1 as soon as possible. You should do so to be sure your application provides the best experience possible on the latest Android-powered devices. For information about what you can do, read Optimizing Apps for Android 3.0.
Revisions
API Overview
API Level
Built-in Applications
Locales
Emulator Skins
Reference
API Differences Report »
See Also
Optimizing Apps for Android 3.0
API Level: 12
For developers, the Android 3.1 platform is available as a downloadable component for the Android SDK. The downloadable platform includes an Android library and system image, as well as a set of emulator skins and more. The downloadable platform includes no external libraries.
To get started developing or testing against Android 3.1, use the Android SDK Manager to download the platform into your SDK. For more information, see Adding SDK Components. If you are new to Android, download the SDK Starter Package first.
For a high-level introduction to Android 3.1, see the Platform Highlights.
Reminder: If you've already published an Android application, please test and optimize your application on Android 3.0 and Android 3.1 as soon as possible. You should do so to be sure your application provides the best experience possible on the latest Android-powered devices. For information about what you can do, read Optimizing Apps for Android 3.0.
Subscribe to:
Posts (Atom)