I am trying to get the Internal and External Storage path of an Android device.
This is how I am getting the Internal Storage path in most of the devices
Environment.getExternalStorageDirectory().getPath()
The above method is working in most of the device but some device this method is giving issue that is it is returning the SD Card path.
Someone who could tell me how to exactly get the Internal storage path in those device whose Environment.getExternalStorageDirectory().getPath()
return External Storage path (SD Card path).
I am also aware of Environment.getDataDirectory().getPath()
but this method return value like /data
whereas the Environment.getExternalStorageDirectory().getPath()
for the same device returns /storage/sdcard0
which points to Internal Storage when SD Card is not present but when an SD Card is present it gives the path which points to SD Card and not Internal Storage.
Can anyone help me understand the difference between the above two and also help me to get the Internal Storage path of an Android device? Also, help me with a solution which works sam across all the devices.
EDIT : Anyone who feels this post is inappropriate please comment and let me know the reason so that I could keep that in mind for future.