Android Open External Storage directory sdcard for storing file

0 votes

For programmatic file saving, I want to open the directory path for an external storage device. I tried, but I couldn't get the SD card route. How can I go about this? Does this have a solution?

private File path = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) + "");

or

private File path = new File(Environment.getExternalStorageDirectory() + "");

I tried getting path from above both methods but both are pointing internal memory.

When we open storage memory if sdcard is peresent it will shows like below- enter image description here

device storage & sd memory card.

I'm trying to code my way to the SD memory path. I granted permissions in the manifest.

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
Sep 21 in Android by Edureka
• 11,040 points
11 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Android

0 votes
0 answers

Android Studio: Where is the Compiler Error Output Window?

When I "Run" my project in Android ...READ MORE

Sep 21 in Android by Edureka
• 11,040 points
11 views
0 votes
0 answers

Error - Android resource linking failed (AAPT2 27.0.3 Daemon #0)

I have this error I am try reinstall ...READ MORE

Sep 21 in Android by Edureka
• 11,040 points
34 views
0 votes
0 answers

"unable to locate adb" using Android Studio

I've been attempting to test my software ...READ MORE

Sep 21 in Android by Edureka
• 11,040 points
15 views
0 votes
0 answers
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Running docker on Android

According to the documentation, the Android kernel is ...READ MORE

answered Aug 1, 2018 in Docker by Kalgi
• 52,350 points
2,990 views
0 votes
1 answer

Task Canceled Exception while invoking AWS Lambda

I'm guessing either the TaskCanceledException instance is ...READ MORE

answered Sep 19, 2018 in AWS by Priyaj
• 58,080 points
1,606 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP