How do you send a pdf to the system pdfviewer?

i have it stored in my asd: /pdf/-dir.

I am working on a service app for providing offline readable information to technicans.

At the moment i copy the the desired pdf from the above mentioned dir to "/Documents" in Scope "shared" and use this location as datauri for activity starter.
Which kinda works.
But the cleanup (Activity stopped/cancel) afterwards does not work. Maybe its locked by the reader.
Also i cann't be shure not to overwrite an existing file in /Documents by accident.

So whats a better way?
Can i send it without filesystem? (prefered)
Can i use a reachable system-temp-dir where the system does the cleanup?
or something?

Many thanks in advance

Why ?

and what do you mean by system pdfviewer, users may not have one installed in which case the default browser may take over ?

Could be - but what you mean by: Why?

How can other apps open files in your apps asd?

(why?)

You can view pdfs stored in your ASD from within your app. There are several extensions available that provide this.

I know that.
But thats not an answer to my question.

Any ideas to the problem?

If you want to use the activity starter, this is the way to go

You only can overwrite files, your app owns, see also Some basics on Android storage system
Also you first can check, if the file exists before overwriting

Use an extension to view the pdf directly from ASD, see the extensions directory App Inventor Extensions | Pura Vida Apps

You could copy the pdf always to the same target directory and use always the same filename

Taifun

:question:

What does this question have to do with your topic? Besides, I don't understand what it's really about. Among other things, not where the PDF file comes from (how does it get into the ASD). Explain in more detail and show us your blocks in particular.

Nothing, but with the "answer" above which has nothing to do with the topic.

The files got downloaded/unzipped/installed by my blocks from my cloud drive.

But isn't the easy question, if there is access to a system-temp-dir, standing by itself?

Somebody could say "yes this way" or "no" or not before version 267.

It take the answers to this point as a very elongated "no" or shouldn't i?

If I read that correctly, your question/topic is:
"How do you send a pdf to the system pdfviewer?"

So again, what is it really about? Or in other words, what is the goal? Is this question so difficult to answer?

Btw, what is a “system-temp-dir” supposed to be (and how should it be useful)?

I am working on a service app for providing offline readable information to technicans.

At the moment i copy the the desired pdf from the above mentioned dir to "/Documents" in Scope "shared" and use this location as datauri for activity starter.
Which kinda works.
But the cleanup (Activity stopped/cancel) afterwards does not work. Maybe its locked by the reader.
Also i cann't be shure not to overwrite an existing file in /Documents by accident.

So whats a better way?
Can i send it without filesystem? (prefered)
Can i use a reachable system-temp-dir where the system does the cleanup?

It doesn't become clearer by repeating the exact same statements. Show your blocks.

Which "system-temp-dir" and what does "the system does the cleanup" mean?

It looks like you have overseen my previous answer?

What about downloading them directly to shared storage, so then there is no cleanup necessary?

There is no such thing as a system temp dir

Taifun

Whatever that means.

Overseen?
Nope, but sorry, i just reposted my initial question not reduced enough.

Your answer is at the moment the most useful one of the thread.
But i hoped for something better so i delayed the answer to you.
I think i will do as you suggested.

Maybe it try a dotted directory like ".temp" in "documents" for putting the file in.

A problem could be if i copy it always to the same name and its already open by the pdf-app... So i have to check this first...

PS:

What about downloading them directly to shared storage, so then there is no cleanup necessary

I dont like this idea. Then anybody can delete files and fiddle around with it... Maybe just by accident...