I want to open a pdf file in app inventor

It runs

@Anke
Is there an absolute file path to assets for a compiled app under Android 11+ ?
Your chart indicates:

/data/data/<pkg_name>

or is the only way to use assetPath in an extension ?

I don't get it. Where is the problem or what are you getting at?

For example if I have an asset: image1.png, I can set a path to it:

/data/data/<pkg_name>/image1.png

I tried this but the image did not show in an image component

I am aware that for such components you can use the helper blocks or //, just interested in a path to assets....

Thank you very much.But I have some questions.Excuse me for talkative.One : I read the code but I dont see a list!"for each item in list" refers to which list?Two:what is ASD?excuse me I am novice.Three:please show me a reference about working with files:storage ,copy,read, delete,pick and so on.From where did you learn "copy to asd"?Four :Can I put the "copy to ASD" on initialize of apk ? for no engaging with this by user?
Thank you again and I don't force you to answer to my questions .You have more important works. But I hope!

did you read suggested link ?

1 Like

You can copy the PDFs from the assets (internal storage) to the PrivateDir (internal storage)

/data/user/0/<packageName>/files/

without storage permissions on all Android versions (with Companion & the APK):

Left (APK) .......................................... right (Companion):

Its apk works but once!why?
I must reinstall to view pdfs again!

three exclamations looks like you are very angry with somebody.

no i am confused.

Please clarify on what you mean by this phrase.

Also, please try not to use drastic punctuation in your posts, since it may offend people.

1 Like

Did you see and do this?

2 Likes

I think I must write and try this code. I wish it replies.

I didn't run companion.I install apk directly.

I try this apk but unfortunately after run for first time I closed it and when i wanted to run it for second time , the pdfs buttons were disabled and the app didn't show the pdfs.

I try this code but it shows only one pdf (him1) for each button I press.H found that in the storage/emulated/0/android/data/... there were on file with three name!

If you think this code works well please send me aia because I don't have TaifunFile extension.thanks.

If you know that this code works well please send me aia .Working with all android version is best.

Thank you all and I hope you solve my problem..

From the example I posted here:

To answer your questions:

image

The list is generated from the csv row in text, of the three pdf files in the assets.

The ASD is the application specific directory, a directory location you can save files in your app, and to be able to (easily) read and write with them. It can be more difficult if you move them elsewhere. You can access the file path to the ASD using these blocks with the file component, or directly with the ViewPDF extension

image

the path will look something like this:

/storage/emulated/0/Adnroid/data/<package_name>/files

Some basics on Android storage system

Yes, just move the blocks for Button2 to the Screen1.Initialise block