Where does application data file actually stored on android device?
Asked Answered
S

5

22

I have developed an Android app using Appcelerator Titanium. This app will create a file in applicationDataDirectory and install a database as well.

If run on emulator, I can locate those files using "adb" command. But how about on Android device? Can I use the "My Files" app to view those file I created? (since I can see files created by other application there.)

Moreover, I expect once I removed the app on device, it will automatically remove the related files and database. Is that true?

Because I found that even I removed the app from the device, the database seems left behind. I can tell because after deleting app and re-run on device(from Titanium), it show previous data.

I am using Ti SDK 2.0.1GA2, Android Runtime V8. And using Samsung Galaxy Tab for testing. Thanks in advance.

Shuffle answered 30/5, 2012 at 6:36 Comment(0)
U
29

Application Private Data files are stored within <internal_storage>/data/data/<package>

Files being stored in the internal storage can be accessed with openFileOutput() and openFileInput()

When those files are created as MODE_PRIVATE it is not possible to see/access them within another application such as a FileManager.

Untouchability answered 30/5, 2012 at 6:52 Comment(3)
You can access /data/data with a file manager app but you will need to root the phone first.Myrlemyrlene
You will then need a competent file manager app you can use. ASTRO file manager is popular but it has no root access support so it's useless for power users. You should be able to use ES File Explorer or File Expert. I have recently had problems viewing /data/data or other protected folders with ES File Explorer and have pretty much abandoned it, and I am now using File Expert. They both require that you go into settings and enable root explorer option (and sometimes also mount the file system as writable). So you need to do that first and you're all set.Myrlemyrlene
@Untouchability Firstly I apologize for asking this as a comment. I read your post on meta regarding banning of an account and I have a question. My friend's account was suspended for 7 days for voting irregularities. My question is, will he be able to answer the questions again? I remember that he deleted the answers which he did not receive any votes. How is this going to affect his answering the questions. Please explain me. Thanks.Lavalley
F
8

On Android 4.4 KitKat, I found mine in: /sdcard/Android/data/<app.package.name>

Finney answered 25/4, 2014 at 9:48 Comment(1)
not all applications save the data in same place. if it was installed on sdcard the info will be on the card sdcard/android/data else on root/data/dataCornetist
T
0

Use Context.getDatabasePath(databasename). The context can be obtained from your application.

If you get previous data back it can be either a) the data was stored in an unconventional location and therefore not deleted with uninstall or b) Titanium backed up the data with the app (it can do that).

Tonina answered 24/6, 2014 at 13:35 Comment(0)
P
0

You can get if from your document_cache folder, subfolder (mine is 1946507). Once there, rename the "content" by adding .pdf to the end of the file, save, and open with any pdf reader.

Potoroo answered 27/9, 2015 at 21:52 Comment(0)
H
0

This is a simple way to identify the application related storage paths of a particular app.

Steps:

  1. Have the android device connected to your mac or android emulator open
  2. Open the terminal
  3. adb shell
  4. find .

The "find ." command will list all the files with their paths in the terminal.

./apex/com.android.media.swcodec
./apex/com.android.media.swcodec/etc
./apex/com.android.media.swcodec/etc/init.rc
./apex/com.android.media.swcodec/etc/seccomp_policy
./apex/com.android.media.swcodec/etc/seccomp_policy/mediaswcodec.policy
./apex/com.android.media.swcodec/etc/ld.config.txt
./apex/com.android.media.swcodec/etc/media_codecs.xml
./apex/com.android.media.swcodec/apex_manifest.json
./apex/com.android.media.swcodec/lib
./apex/com.android.media.swcodec/lib/[email protected]
./apex/com.android.media.swcodec/lib/libcodec2_soft_common.so
./apex/com.android.media.swcodec/lib/[email protected]
./apex/com.android.media.swcodec/lib/libcodec2_soft_vorbisdec.so
./apex/com.android.media.swcodec/lib/libcodec2_soft_h263dec.so
./apex/com.android.media.swcodec/lib/libhidltransport.so
./apex/com.android.media.swcodec/lib/libcodec2_soft_h263enc.so
./apex/com.android.media.swcodec/lib/libcodec2_vndk.so
./apex/com.android.media.swcodec/lib/[email protected]
./apex/com.android.media.swcodec/lib/libmedia_codecserviceregistrant.so
./apex/com.android.media.swcodec/lib/libhidlbase.so
./apex/com.android.media.swcodec/lib/libcodec2_soft_aacdec.so
./apex/com.android.media.swcodec/lib/libcodec2_soft_vp9dec.so
.....

After this, just search for your app with the bundle identifier and you can use adb pull command to download the files to your local directory.

Harmattan answered 31/8, 2020 at 2:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.