Hey there.
So let's see what ways you can save data in Android here.
I have six ways listed.
And the first goes on safe in some state.
This method is used to save data using a key value pair and is used to save data during change the orientation
of the phone or if activity is destroyed by the Android system due to lack of resources.
Using this method it is possible to see where is that both primitive and complex objects but of fires.
Data are stored as long as they user in the application.
As soon as the user clicks the back button that is exists from the application or restarts the phone.
All data will disappear if you need to save data.
After the user has left the application you need to save the data to the file system.
Yeah an android can do this with a few methods.
The first of them using the shared preferences clause that is general surgeons can be translated shared
preferences creates a file that you specify and you can save in this file.
Key and value pairs simple data like boolean string and so on.
And this data will be stored permanently until the application will be deleted from that for shared
preferences is mainly used.
If you want to save a single numeric value or separate takes value for example you can say email and
name of a user in this file so that by default you enter this data into the fields.
But sometimes you need to say more complex data not in the form of a spare key and value.
For example if you say several objects and these objects have many fields then you can get confused
by a store and this method.
And in this case it is better to use the data database.
Andrew It uses the database Esko lied.
It is the relational database that can store organized structures of complex data.
This data will also be stored until the application is removed from the file.
If you have a need to store a large amount of data for example multimedia files audio files or reader
files or some large volumes of text for example e books you need to store size data in the internal
storage that is on the phone's hard drive or in external storage ledgers for example on is the card
that can be inserted into into the file and the data is also stored until the application is deleted.
This is an internal storage in external storage.
Data can be stored even after the application is deleted.
For example photos video files or text files that can be stored separately from the application.
And finally the last way to store data is to store data on a server in a cloud storage.
And in this case access to this data may be possible not only from one device not only from the phone
for example but from a computer tablet or from several phones and a data is stored completely separately.
That is it will be stored until it is deleted from the server.
And further we will consider these methods of saving data in more detail.