Several previous articles described the main three ways to store data in Android applications: Sharedpreferences, internal storage, and external SD card storage. What kind of way do you use it in your application? Here are some suggestions:
1. If you have data in the form of a key-value pair, use the Sharedpreferences object. For example, if you want to store some of the user's attributes, such as name, color, birthday, or last date, then the Sharedpreferences object is the best way to store the data.
2. If you want to store some special data, it's a good choice to use internal storage. For example, your application (such as an RSS reader) may download some pictures from the web for display. In this case, saving the picture to the internal store would be a good solution. It is also possible that you store the data that the user created himself, such as the user saving some of his own notes.
3. There are times when you need to share your application data with other users. For example, you might develop software that records the coordinates of places that users have been to, and you can share that data with other users. In this case, save your files to the SD card so that you can easily transfer the data to other devices for later use.