How to store data from my app

前端 未结 5 867
无人共我
无人共我 2020-12-06 19:02

Actually i want to know how to store data from my app in the device so that i can review the store data when i run the application again..

means in simple terms i wa

相关标签:
5条回答
  • 2020-12-06 19:28

    If you have to store small amount of data, you can use SharedPreferences in Android.

    If the data that you have to store is big/complex enough, try using SQLite database.

    Still need help?

    UPDATE: There's a tutorial that I wrote to demonstrate how to use SQLite database. check it out here. Although it copies existing database into device's memory, but other versions of it, which create database through code can also be devised from it.

    A better tutorial is here : http://www.vogella.com/tutorials/AndroidSQLite/article.html

    0 讨论(0)
  • 2020-12-06 19:29

    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.

    Data Storage

    0 讨论(0)
  • 2020-12-06 19:37

    Android comes with a built in SQLite database that you can use. I advice you to go trough this notepad tutorial. It teaches the basics of using Android SDK including different states of the android application as well as how to use SQLite with Android.

    0 讨论(0)
  • 2020-12-06 19:41

    For storing simple key = value pairs, you can use Properties.

    For data storage as in a database, you can use sqlite on android.

    0 讨论(0)
  • 2020-12-06 19:44

    1) If you want to store data in table format then you can use SQLite database in android

    2) If you don't want to store data in table format then you can store in SharedPreference

    more info about SharedPreference here and here

    0 讨论(0)
提交回复
热议问题