Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Access External Storage

I am facing some storage issue. i am working on an application where i have to access phone's on board external storage and an External sdCard storage which i am getting with this code

Environment.getExternalStorageDirectory();

But when onBoard external memory exists then this code returns the path of onBoard memory not the external sdCard while the sdCard is mounted

now the problem is.. i want to access both memories onBoard and external sdcard is there any way to access both memories

like image 667
Farrukh Avatar asked Jan 01 '13 05:01

Farrukh


People also ask

How do I manage external storage permissions in Android?

Users can see which apps have the READ_EXTERNAL_STORAGE permission in system settings. On the Settings > Privacy > Permission manager > Files and media page, each app that has the permission is listed under Allowed for all files. If your app targets Android 11, keep in mind that this access to "all files" is read-only.

What does access to external storage mean?

External storage is often used to store information that's accessed less frequently by applications running on a desktop, laptop, server or mobile device, such as an Android or iOS smartphone or tablet.


1 Answers

Try out this:

String m_str = Environment.getExternalStorageDirectory()
               .getAbsolutePath().toString();           //return path sdcard/mnt
like image 171
GrIsHu Avatar answered Oct 03 '22 16:10

GrIsHu