How to store data from my application

Actually, I want to know how to store data from my application on the device so that I can view the storage data when the application starts again.

means in simple words, I want to say that suppose I have a text box where I write some kind of information. Now, when I click the submit button, this information will be saved, so when I open the application, the saved data should appear in the text box.

In all terms, I want to say that I just want to store data the way we use a database to store data. Therefore, please, anyone suggest me how this can be done in android.

if possible show an example

Relations Anshuman

+6
source share
5 answers

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

If the data you have to store is large / complex, try using a SQLite database.

Still need help?

UPDATE: There's a tutorial that I wrote to demonstrate how to use SQLite database . check here . Although it copies the existing database to the device’s memory, other versions can also be created from it that create the database through code.

The best tutorial is here: http://www.vogella.com/tutorials/AndroidSQLite/article.html

+8
source

1) If you want to save the data in a table format, you can use the SQLite database in android

2) If you do not want to store data in table format, you can save it in SharedPreference

more information about SharedPreference here and here

+3
source

Android comes with a built-in SQLite database that you can use. I suggest you go through this notepad tutorial . He teaches the basics of using the Android SDK, including the various states of the android application, as well as how to use SQLite with Android.

0
source

You can use Properties to store simple key = value pairs.

To store data, as in a database, you can use sqlite on android .

0
source

Android provides several options for saving persistent application data. The decision you choose depends on your specific needs, for example, whether the data should be private to your application or accessible to other applications (and the user) and how much space your data requires.

The data storage options are as follows:

General settings

Store private primitive data in key-value pairs.

Internal storage

Store personal data in the device’s memory.

External storage

Store public data on shared external storage.

SQLite Databases

Store structured data in a private database.

Network connection

Store data on the network using your own network server.

Data store

0
source

Source: https://habr.com/ru/post/891513/


All Articles