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
1,117 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,210 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
• 63,600 points
2,507 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,680 points
1,448 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,690 points
658 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,210 points
3,446 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,764 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,461 views
0 votes
1 answer

Is there a way to run Python on Android?

YES! here’s a barcode scanner written in six ...READ MORE

answered Sep 19, 2018 in Python by Priyaj
• 58,020 points
1,019 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,640 points
922 views
0 votes
1 answer
–1 vote
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,210 points
40,106 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