How use File sdcard myfile without READ EXTERNAL STORAGE on android 11

0 votes
I need to get a file like this :

File file = new File("/sdcard/Download/Myfile.pdf");

This produce the following error on android 11 :

FILE NOT FOUND/sdcard/Download/GE-ACTIONS-03.pdf: open failed: EACCES (Permission denied)

Are there a possibility to get The File in this way ?
May 30 in Others by polo
• 1,500 points
20 views

1 answer to this question.

0 votes
You first need to use File.exists() and then File.canRead().

The latter will return false if your app did not create the file.

If so let the user pick the file with ACTION_OPEN_DOCUMENT
answered May 31 by nisha
• 2,160 points

Related Questions In Others

0 votes
1 answer

How can I use wow.js and animate.css without affecting SEO?

there are two animation classes in MDBs ...READ MORE

answered Feb 22 in Others by narikkadan
• 10,840 points
331 views
0 votes
1 answer

How do I display an alert dialog on Android?

You could use an AlertDialog for this ...READ MORE

answered Feb 22 in Others by Aditya
• 7,280 points
140 views
0 votes
1 answer
0 votes
1 answer

How can i create file at external storage in Android?

We have not had read/write filesystem access ...READ MORE

answered Jun 6 in Others by nisha
• 2,160 points
24 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
2,956 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,510 views
0 votes
1 answer

Is there a way to run Python on Android?

YES! An example via Matt Cutts via SL4A -- "here’s ...READ MORE

answered Sep 19, 2018 in Python by Priyaj
• 58,080 points
388 views
0 votes
1 answer

How can we get the current location in Android?

First you need to define a LocationListener to handle ...READ MORE

answered Sep 25, 2018 in Java by Parth
• 4,630 points
369 views
0 votes
1 answer
0 votes
1 answer

Open file in SDCard on Android

To open a file that is on ...READ MORE

answered Jun 20 in Others by nisha
• 2,160 points
8 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP