Keule
March 29, 2023, 1:08pm
1
Hi there,
i am going to reopen that case.
i want to open some pdf files, located in Documents/subfolder/file-x.pdf
the pdf-files getting uploaded by pc or by another app.
i have found this:
1. Introduction
I was doing some work with @Juan_Antonio 's KIO4_PDF extension and realised that it was possible to view ANY pdf available on the device (within reason, depending on location, Android version / API). I came up with some blocks to make it possible to view an entire pdf in a webviewer. (There are already straightforward methods for viewing pdfs locally and from online resources )
In discussion with Juan, and with his help and code, I then developed this extension which would do the…
but i don't think this helps, because i do not have those files in the assets (and i do not know what assets are =D)
i tried different ways to open those files:
i have also a file component added for setting file scope to legacy, after i did that, Adobe PDF Reader opens and gives an Error like "File can not open"
Maybe you can give me some help, how i can fix my problems.
In the End i want to Download some pdf files from a nextcloud to the phone (done by synchronisation app) and open those files via my app.
What have you tried with this ViewPDF extension? the pdf file don't have to be in assets or asd.
and Assets means you upload the file to Media when developing the app.
1 Like
Taifun
March 29, 2023, 2:02pm
3
Keule:
i want to open some pdf files, located in Documents/subfolder/file-x.pdf
the pdf-files getting uploaded by pc or by another app.
Which means you have to use SAF to access the files, see also Some basics on Android storage system
1.Introduction
Description: Basically AI2 wrapper of Storage Access Framework. Using this extension, you can get read and/or write access to a single document or tree document (and all of its children recursively).
Latest Version: 1.3
Released: 2021-09-16T18:30:00Z (UTC)
Last Updated: 2023-11-15T18:30:00Z (UTC)
2.Blocks
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
[image]
3.Documentation
Events
ErrorOccurred
Event indicating error/excep…
Taifun
2 Likes
Keule
March 29, 2023, 2:13pm
4
Thank you for the hint.
maybe you can help me a bit. What does SAF exactly do? is it to set permissions to my app or is it a tool to open those files?
How do the blocks have to look like? as an example? - i just want to have read access on all files under /Documents/fuehrerscheinpruefung
Taifun
March 29, 2023, 2:15pm
5
Read both threads carefully, find examples in the SAF thread, try something yourself and then come back with a screenshot of what you tried and your questions
Taifun
3 Likes
patel
March 29, 2023, 2:47pm
6
If your app is only intended for private use have a look also here How to request and grant MANAGE_EXTERNAL_STORAGE permission
1 Like
Keule
April 1, 2023, 7:08pm
7
hey, thank you for your reply.
i tried this:
but seems not to work...
Keule
April 1, 2023, 7:17pm
8
hi there, thank you for your reply,
i tried this:
but also not working, Permission denied.
Keule
April 2, 2023, 6:44am
9
I am going to use my app with assets now, seems working so far.
now i have one last problem. My app is in total about 45 MB, but appinventor can only make apps with max 30 MB.
Do i have any possibility to create my apk otherwise?
patel
April 2, 2023, 7:47am
10
This runs well on android 11, but not with companion, you have to instal the apk
Keule
April 2, 2023, 3:26pm
12
Awesome, thank you so much, this helps a lot!
Keule
April 4, 2023, 9:38am
13
hi there,
On Android 12 this is working, but unfortunately not on Android 13.
On A13 it is only asking for audio and video permissions, not for "edit all files".
in the end, my listviewer keeps empty.
any hint?
the activitystarter.action is set in the designer, so i did not add it here again.
Fahrerhandbuch4.aia (33.1 KB)
Taifun
April 19, 2023, 11:59am
15
As already said earlier, you have to use SAF
Taifun
patel
April 19, 2023, 4:30pm
16
Keule:
any idea someone?
You missed activity action here
Anke
April 19, 2023, 5:49pm
18
No , this does not work on any Android version > 10.
Try this one:
Blocks
Keule
April 30, 2023, 5:25pm
19
Thank you very much, seems working so far in my dev environment. (just had to move the makedirectory block to somewhere else)
I will do the live testing next week.