How to open a pdf file from asd in a third party app using activity starter?

You cannot access non-media files that were not created by the app itself from one of the Shared folders on Android 11+ without using SAF.

Check the path, mostly it is happening because of wrong path.
Correct path file:///…
You can open pdf from asd, no need to copy anywhere.

Please only give advice if you know what you are talking about.

Sorry, But we can open pdf from asd in a third party app on Android 11+ with help of activity starter and this is the topic of discussion.

Please read carefully first and then reply.

As @dora_paz already said:

To be even more precise:

which is ONLY accessible by your own app

2 Likes

In this app, first click test for button 1 to create pdf. then click button 2.then click show pdf.
It will work.

f
as @Lollipop said, it works now

It’s not clear to me to what extent this is supposed to be a solution.

It is of course no problem to open the PDF with the same app (let’s say App1). However, that is / was (?) not the topic. It’s about opening this PDF file with another app (let’s say App2) from the foreign ASD (app1). And that’s definitely not possible with the APK.

yes as you said i was also not expecting a solution after i read some articles from community. however it works now !

It is possible if App1 request App2 to open pdf from App1’s asd.
He wanted to do the same thing. Open Pdf from App1’s ASD in App2 through App1

Post these two apps (app1 and app2) where app2 can open a PDF from app1’s ASD.

If this is really going to work (which I doubt) then it looks like I need a longer break from this forum. :wink:

1 Like

Post these two apps.

App2 is any pdf reader and App1 is already posted.

Everything has to be done by myself. :upside_down_face:

I hard-coded the ASD for both apps:
openPdfApp1.apk (5.2 MB)
openPdfApp2.apk (5.2 MB)

file:///storage/emulated/0/Android/data/io.kodular.bodymindpower.openPdfApp1/files/myPDF.pdf

Steps to test:
Install App1, open it, open PDF
install App2, open it, open PDF

Does App2 work / open PDF (from the ASD of App1):question:

No, as I have already said and recently demonstrated.

Note: It makes no sense at all to test this with Companion, because all Kodular apps always have the same ASD with Companion:
/storage/emulated/0/Android/data/io.makeroid.companion/files

So the ASD is accessible to any app with Companion.
However, all compiled Kodular apps have different ASDs.

How to open a pdf file from asd in a third party app using activity starter?

or why go to all that trouble when you can view the pdf in your app?

No, It is not working and it will not work.
But it is possible with help of activity starter or sharing component which is happening in App1.
Example. We can share pdf, png from our app’s ASD to telegram, whatsapp etc. But they can’t access it directly.

How to open a pdf file from asd in a third party app using activity starter?

But then the topic should have been like this:

How do you share a pdf file (or any file) from the ASD (or from any path of the Shared storage) with any messaging app using activity starter (or even directly)?

Since this PDF file must have been created by App1 itself (otherwise it would not be in App1’s ASD), the creator of App1 knows the path to the PDF file and can also share it directly (without activity starter).

So, to make it even shorter, the question should have been:

How do I share a self-created (non-media) file?
This question has certainly been asked and answered thousands of times?

Note: You can share a media file (like png, jpg, mp3 etc) from any path (even from the root dir of the external storage).

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.