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?
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
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.
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?
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...