开发者

what is the exact path to store files in SD card

I have a requirement that I need to copy some files to the SD card programatically.

I have used

  Environment.getExternalStorageDirectory()

to refer the SD card but In some devices it is referring to internal memory of the device.

Then I tried "/mnt/sdcard/" this path also still referring to Internal memory of the device.

I have done some investigation and came to know that "Envir开发者_C百科onment.getExternalStorageDirectory()" will refer to internal memory of the device.

But I want to always store my files in SD card for all the devices.

I just want to know the path which should always refer to the Sd card in all the devices.

Is there any hard coded way to do this..??

Please help me.


Android doesn't know anything about the way the data is physically stored (could be a SD card, a CD, a chipset, etc). The only thing it knows is about whether the storage is "internal" or "external" (more details here).

So the way you are doing is fine: if the system gives you a path to an internal chipset when you call getExternalStorageDirectory(), this means that your physical device is built that way. There is no workaround for that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜