Where to store application data on Android?

I use the user.home + app_name directory under Linux and Windows. However, the directory provided to me by Android for user.home is not allowed to write. So what is the common practice of storing application data? My situation is even more complicated. The data that I need to store does not belong to Android applications, it belongs to a web application installed on an Android device, so the proposal using the standard Android method may not work for me.

+4
source share
3 answers

Well, there are many ways to store data in Adroid: http://developer.android.com/guide/topics/data/data-storage.html

If you are using a web application on Android, you need to use the data store for web applications: http://diveintohtml5.ep.io/storage.html .

If you still want to keep the idea of ​​accessing the file system through a web application, perhaps this tutorial can help you: http://www.vogella.de/articles/AndroidFileSystem/article.html - remember the permissions.

Although, if you need to store data on an Android system, you should choose an Android application, rather than using a web application to manage your local data store. You can retrieve data from your web application using the URL connection (http://developer.android.com/reference/java/net/URLConnection.html) and manage storage through the Android application.

+5
source

Application data can be stored in three ways:

  • SharedPreferences
  • SQLite Database
  • file

All these files are stored in the /data/data/packagename/ directory.

+3
source

You can use the getFilesDir () method. But check out this article for more details.

0
source

All Articles