How can i get internal storage access?

Dear Experts,

I'm creating an app where people can read books for free. They can browse and pick files from their device or they can go online and read from there. I'm having trouble getting internal storage access. Getting an error message that says I have to go to settings and probably approve it from there.

I have developed another app where I needed permission for battery optimization. And it was done so easily. A pop-up comes up and I just have to press the allow button. I'm wondering if there are any similar extensions that can help me get access to internal storage without any hassle to the user.

Thank you for your time! :pray: :innocent:

Kind regards
Ashfak

What do you mean by "internal storage" ?

Show your relevant blocks, what you have tried, error messages etc.

Where do these books come from? Who has stored them on the device and where? If they were not stored by your app itself, you will no longer be able to access these (non-media) files on Android 11+ without using SAF or requesting and granting a special permission (not normally approved by Google).

See also here:

My app has two options. One is where users can browse and pick books/pdf files from their device. This is where the app needs special permission. The second option is online where no special permission is needed.

I am looking for a way or an exyension that will allow users to grant permission with just a tap. I used wakelock extension for one of my apps and they have a great option where useres will get a pop up message where they can tap on the allow button to grant acesss to battery optimization. I am looking for something similar.

Please see the error message below. I will share block screenshots if you want.

Here's the error message. I will share the blocks screenshot as soon as i can.

Yes.
But have you really read my guides? I don't think so. So read... and you will understand (hopefully).

Yes, too much information! But it helped a bit. added SAF extension to the app. Struggling with media/file picker option.

We are waiting...

After reading the articles you mentioned and some related ones I realized I need to do it from scratch. So, I deleted all the blocks. And now I am super confused about how to make it happen. :sweat_smile:

Here's what I'm trying to achieve. When the screen initializes it will open up the media picker to give user a list of all the pdf files on their downloads folder. After they select a pdf file it will be opened on a webviewer. I am sharing a screenshot where you will be able to see all the extensions and some blocks. Not sure how to fill those up! Would really appreciate your guidance. :innocent: :pray: :pray: :yellow_heart: :yellow_heart:

What android version are you targeting/working on?

Is your app not intended for publishing on Google Play Store?

Obviously you didn't read these guides, at least not carefully enough:

  1. On Android 11+ there is no longer a WRITE_EXTERNAL_STORAGE permission.

  2. On Android 13+ there is no longer a READ_EXTERNAL_STORAGE permission.

  3. On Android 11+ storage permissions are no longer required for non-media files that the app itself has created. All other non-media files can only be accessed with SAF.

  4. If you do not intend to publish the app on the Play Store, SAF can be bypassed by declaring, requesting and granting a special permission (MANAGE_EXTERNAL_STORAGE) (see here). Once this is done, the app has unrestricted access to all directories and files (including non-media files).

2 Likes

Sorry, I'm not a very technical person at least in this field. Just learning new things every day. Probably that's why it seemed a bit difficult to understand but I'll go through the article again and let you know if I need more guidance.

Thank you :innocent: :pray: :pray: :heart:

@TIMAI2 Yes it's intended for publishing on the google play store. I'm targeting android 10+.

Then you will need to use SAF

Can you tell me what's wrong here?

The extension cannot read a contenturi, which is returned by the filepicker.

Hi I've read viewpdf and viewbigpdf documents several times. Unfortunately, I couldn't find anything regarding the file picker component. I've tried many different combinations and none of it works. I'd really appreciate your guide.

Thank you

Read post 11 (again) carefully.

1 Like

and read post 16 again, carefully. You will need to convert the contenturi generated by the filepicker to a file path, there are extensions available that can do that. Or you could use another method (file component) to list directories/files from which you can pick.

1 Like