0

I have an app that writes files to the shared storage via getExternalStorageDirectory(). My problem is accessing and copying the files to a computer:

I can access these files from the computer if the phone has an SD card (tested on a Galaxy S5). However, I cannot access these files if the phone does not have an SD card (tested on a Nexus 5X). Strangely, I can view my app's files from the phone in both cases.

Am I using the wrong method to get the base directory? Or is it the phone? All I need is for the files to be copied from the phone to the computer. Any help is appreciated.

Note: Both running Android 6.0.1 if that helps.

Jaxian
  • 1,146
  • 7
  • 14
ricefarmer369
  • 63
  • 2
  • 8
  • 1
    https://stackoverflow.com/questions/32789157/how-to-write-files-to-external-public-storage-in-android-so-that-they-are-visibl – CommonsWare Jul 13 '16 at 22:29
  • Thank you! Not sure how I missed that question before posting my own. The static method `MediaScannerConnection.scanFile(context, path, null, null)` is what I went with. – ricefarmer369 Jul 14 '16 at 17:12

1 Answers1

2

You can access to primary shared/external storage directory using android's monitor.

You must open the monitor application while your app is running.

Open your android sdk folder then you will see a folder called tools, open it and search monitor, if you are in a mac you can open it /Users/YOUR-USER/Library/android-sdk-macosx/monitor.

After you opened the monitor application look for these folders data/data/yourAppPackage and there you will find app_data, chache, databases, shared_prefs.

Once you have opened monitor application

enter image description here

I hope that helps

ricardoorellana
  • 2,270
  • 21
  • 35
  • Unfortunately this is not exactly what I wanted. I needed it to be available immediately after plugging in via the OS file explorer without Device Monitor. Thank you for the suggestion though. – ricefarmer369 Jul 14 '16 at 17:15
  • @ricefarmer369 I see, well why not try with this official software https://www.android.com/filetransfer/ ? – ricardoorellana Jul 14 '16 at 17:47