Reputation: 10129
I am doing an application which access the SD/Media card to display its images. But when device is connected via USB I cant access the media card. If thats the case, I want to show a message to user asking him to disconnect device form computer.
Thanks.
Upvotes: 2
Views: 257
Reputation: 11876
I am not sure about your second question about checking whether the device filesystem is mounted via USB on a computer, but as for the first question, to check the available filesystems, call FilesystemRegistry.listRoots(), which will return an Enumeration of String objects. If "SDCard/" is in the enumeration, then the SDCard is available.
Some devices can also store images on the device storage as well, which is distinct from the SDCard. In that case, check for "store/" as the filesystem root.
Upvotes: 1