Reputation:
I'm using moto g phone which is marshmallow version I want to get path of my external memory card but I'm only able to access internal memory(after writing some permissions for marshmallow) i have tried many combinations like below for accessing external memory card
sdpath="/storage/sdcard1";
sdpath="/storage/extSdCard";
sdpath="/storage/usbcard1";
sdpath=System.getenv("SECONDARY_STORAGE");
I have accessed internal memory by writing sdpath="/storage/emulated/0"; but not able to access external memory card by above codes how can i access memory card in android marshmallow as i headr that google have changed accessing permissions from android 6.0 thanks in advance for your valuable reply.
Upvotes: 0
Views: 1176
Reputation: 1006819
how can i access memory card in android marshmallow
Use getExternalFilesDirs()
, getExternalCacheDirs()
, or getExternalMediaDirs()
on Context
to get at app-specific locations on removable storage.
Or, use the Storage Access Framework, to allow the user to choose a location, which may or may not be on removable storage.
Upvotes: 1