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, 2022 in Others by polo
• 1,480 points
285 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, 2022 by nisha
• 2,190 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, 2022 in Others by narikkadan
• 53,520 points
1,222 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, 2022 in Others by Aditya
• 7,660 points
664 views
0 votes
1 answer

How to run seed.rb file on Amazon ec2

To gain access to the Amazon instance, ...READ MORE

answered Mar 24, 2022 in Others by Edureka
• 13,630 points
172 views
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, 2022 in Others by nisha
• 2,190 points
1,364 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,075 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,100 points
1,738 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,100 points
523 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
469 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, 2022 in Others by nisha
• 2,190 points
296 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