I currenlty have a few problems with developing an APP and using the external SD card.
The first problem is that I check if there is a SD card mounted. This function returns a true even if there is no SD card inserted. I've used/tried the following code:
from developer.android.com
Every Android-compatible device supports a shared "external storage" that you can use to save files. This can be a removable storage media (such as an SD card) or an internal (non-removable) storage. Files saved to the external storage are world-readable and can be modified by the user when they enable USB mass storage to transfer files on a computer.
Maybe that is a problem?
I'm using a LG L5 (E610)
I've added the correct permission to the manifest file.
My other issue could be related to this issue
Any help is very much appreciated. Thank you.
But a small but persistent number of Android owners are blaming SD card-related problems for causing their smartphones to spontaneously crash and lose precious data.
You said:
The first problem is that I check if there is a SD card mounted. This function returns a true even if there is no SD card inserted.
I think you stumbled upon something that takes some time to grasp, because it's not cristal clear at all.
In Android you will find 2 kinds of memory:
You will find 3 kinds of devices in the wild:
Based on what you said I think you are on the 3rd kind of device. So your physical sdcard will be found in this kind of path: /mnt/sdcard/external_sd/
. Sadly, this is device specific, I don't think there is something in the Android API to get this path.
Also, bear in mind than, since Android 3.X, we don't need to "mount" this shared memory anymore. So your shared memory will always be there for Android as we are now using MTP protocol.
This is why isExternalStorageAvailable() returns true, even if your sdcard is removed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With