5

My goal is to save data from app in a text file for further analysis. I used the exact code as given here for saving data:

The data is stored and retrieved according to the app, but I am not able to find MySampleFile.txt (even using the search functionality) on the phone.

I can't find it in Android -> data -> com.*.*. I have a Samsung Galaxy S3. Is anything different in this phone?

Should I make any modifications in the phone?

Mario Kutlev
  • 4,459
  • 6
  • 42
  • 60
user2155669
  • 75
  • 1
  • 1
  • 5

2 Answers2

8

Do the following to be able to see your data stored in the phone's internal memory.

  1. Turn on USB Debugging on your phone.
  2. Connect your phone to the system.
  3. Open DDMS perspective in your Eclipse.
  4. Select your device from the devices tab on the left.
  5. On the right, the last tab will be File Explorer. Open that.
  6. Traverse to data/data/your.app.package to find the data you want to see.

P.S:- NEVER root your phone, unless you're a developer who loves to mess around with the System apps.

Rahul
  • 43,125
  • 11
  • 82
  • 101
  • Firstly thanks for this. I didn't about file explorer. But I still can't access it. When I press the arrow next to data/, it just disappears. Is it because of permission?( under the field called permission, it reads drwxrwx--x). – user2155669 Mar 19 '13 at 10:41
  • I really doubt that. Even if its a read only permission, you can atleast be able to see it. Only if the folder is empty, it'll disappear. Also make sure that there are no loose connections and your device has the status **online**. – Rahul Mar 19 '13 at 10:45
  • 1
    The phone it online. But the same thing happens whether it is external or internal storage. This answer taught me something though. Wish it worked. Thanks anyway! – user2155669 Mar 19 '13 at 11:02
6

To see data, you phone must be root. Samsung Galaxy S3 is not a root from vendor, you need to root your phone to access internal memory/storage, you can only access external memory/storage in your phone i.e. sdcard

But, i would suggest you to use Emulator rather root your phone.

Here, are some links about what is rooting, you can go through these:

http://gizmodo.com/5982287/reasons-to-root-your-android-device
http://lifehacker.com/5789397/the-always-up+to+date-guide-to-rooting-any-android-phone
http://en.wikipedia.org/wiki/Android_rooting

But again I would suggest to use Emulator unless you are not expert enough to root and Install firmwares again when you don't want your phone root.

Please use Emulator to see data->com.package

From Windows Menu->ShowView->Others->android->fileExplorer you can see the file in your device

Specify permission in AndroidManifest.xml:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Akbari Dipali
  • 2,165
  • 1
  • 20
  • 26
  • But if I go to Android->data, I find folders like com.amazon.kindle and com.imangi.templerun and so on. I'm guessing they're folders for app data. I need to do something similar for my com.example.app. – user2155669 Mar 19 '13 at 10:32
  • you can only see files that you store in your (external storage)sdcard by going in mnt->sdcard->data. not in internal storage. – Akbari Dipali Mar 19 '13 at 10:39
  • Have you wrote the code to store files in sdcard/ internal storage? – Akbari Dipali Mar 19 '13 at 10:40
  • And also not forget to specify permission in manifest file. Please see edited code – Akbari Dipali Mar 19 '13 at 10:41
  • please see edited ans to see permissions. if you forget to specify permission, than, storing code won't work in your app and won't create any folder also – Akbari Dipali Mar 19 '13 at 10:43
  • Since I'm using sensor data, I can't use an emulator. – user2155669 Mar 19 '13 at 10:45
  • And I'm using the Internal Storage. I don't think permission to write is a problem because I'm performing a read operation as well and that works fine. However, I'm not able to locate that particular file. – user2155669 Mar 19 '13 at 10:46
  • As I have wrote in answer, to view internal storage file your phone must be root, you can not see it in your phone as galaxy s3 is not root by vendor. To locate your files in your phone, you can write it to external storage as internal is not accessible for your phone as it is not a root phone – Akbari Dipali Mar 19 '13 at 10:49
  • If you want your files, you can read them by code and store it in external storage and then, locate that file – Akbari Dipali Mar 19 '13 at 10:50
  • data/data/com.package indicates internal memory and only be accessible if phone is root – Akbari Dipali Mar 19 '13 at 10:52
  • data/mnt/sdcard/com.package indicates external storage which can be accessible in your phone – Akbari Dipali Mar 19 '13 at 10:53
  • Are you clear with internal and external storage and its accessibility? – Akbari Dipali Mar 19 '13 at 11:08
  • I think so. I can write and read from either internal or external storage through an app. But to actually access the text file from my file explorer, I need to go for external storage or root my phone for internal storage. – user2155669 Mar 19 '13 at 11:25
  • "unless you are not expert enough" should be "unless you are expert enough", but I cannot edit it, as edits need to be a minimum of 6 characters. – GregT Sep 01 '17 at 12:04