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, 2022 in Android by Edureka
• 13,620 points
1,042 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
1 answer
0 votes
0 answers
–2 votes
0 answers

Android Webiew does not load indexed Sdcard (file://sdcard)

When attempting to use mobile browsers to ...READ MORE

Nov 8, 2022 in Android by Edureka
• 13,620 points
1 flag 25,155 views
0 votes
1 answer
0 votes
1 answer

Open Contact information in Contact List using Phone Number of Contact Android Studio

You must first obtain the contact's CONTACT ...READ MORE

answered Nov 7, 2022 in Android by Edureka
• 12,690 points
1,055 views
0 votes
1 answer

Android Open External Storage directory(sdcard) for storing file

you can't do that. A workaround is to ...READ MORE

answered Jun 9, 2022 in Others by nisha
• 2,210 points
2,617 views
0 votes
1 answer

Android Open External Storage directory for storing file

To get the internal SD card you ...READ MORE

answered Jun 9, 2022 in Others by nisha
• 2,210 points
1,663 views
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
3,768 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,020 points
2,467 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