0

The internal storage path for Samsung galaxy S3 with 4.1.2 keeps on changing.

/mnt/sdcard0/ /mnt/sdcard/ /storage/sdcard0/ /storage/sdcard/

I don't have external card inserted in this phone. And randomly i get the above path locations in Astro file manager App and also the logcat.

Actually my android application transfers file from from one mobile to other using Wifi-Direct technology. When I transfer from Samsung galaxy s3 mini to Samsung galaxy s3 it works well. But the reverse is not happening because it says the "file is not available in specific directory" even if the file does exists.

A sample log from logcat: D/fileUri after substring>>>( 7422): /mnt/sdcard/Download/flash_transfer.apk D/sender socket fileName>>>( 7422): flash_transfer.apk E/wifidirectdemo( 7422): /mnt/sdcard/Download/flash_transfer.apk: open failed: ENOENT (No such file or directory)

But sometimes it shows /storage/sdcard0. Not sure how it changes frequently due to which file transfer is getting interrupted.

Which is the right path for internal sd card for android 4.1.2?

SAMBA
  • 503
  • 2
  • 8
  • 15

1 Answers1

2

The internal storage path for Samsung galaxy S3 with 4.1.2 keeps on changing.

That is external storage, not internal storage, from the standpoint of the Android SDK.

Which is the right path for internal sd card for android 4.1.2?

There is no "internal sd card" on most Android devices.

Assuming that you mean external storage, the root of external storage is found at the path returned by Environment.getExternalStorageDirectory(). If these files are supposed to go where the user expects "downloads" to go, you can find that location on any device using Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);. Never hardcode paths in Android.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Then when we say Samsung Galaxy S3, with 16GB Memory - does that mean internal storage or external storage. Also when I put 8GB micro SD card what type of memory it is and how both are classified and termed as? – SAMBA Nov 16 '13 at 03:24
  • 1
    @SAMBA That 16GB is external storage as far as Android is concerned. For the SD card, there's no standardized way of ascertain its path, and given Google's stand on SD card, it probably will never be standardized. – Kai Nov 16 '13 at 03:35
  • In the link you provided it says Internal Storage Store private data on the device memory. External Storage Store public data on the shared external storage. – SAMBA Nov 16 '13 at 03:40
  • The main issue is sometimes i get /mnt/sdcard0/ and sometimes i get /storage/sdcard0/ when i see the file path using "Astro file manager app" . But when i use "File Manager app" i constantly get /storage/sdcard0/. Even if file does exists it says "file is not available in specific directory". – SAMBA Nov 16 '13 at 03:47
  • Issue Closed. It works with both /storage/sdcard0/ and /mnt/sdcard0/. – SAMBA Nov 16 '13 at 03:57