Hi
I have followed the fileprovider tutorial by @Erel and changed the Manifest file to exactly what is in the example.
I then tried to load a pdf file with this code
Where filename has no path
then I tried it like this
and the file and path is
the main.pdffolder is
where my pdf files do arrive . I have checked the file by going directly to it and opening it and it opens.
At the moment all what happens it is goes to the app to open the pdf and then displays the filename and close back to my app
I also tried making the files path in manifest to my path
but that fails on Compile
According to@Erel's post the active folder is
how can I change this to File.DirDefaultExternal
In my app all data is sent to these folders where I read from and write to
Please off any advise where to look next
Thank you
I have followed the fileprovider tutorial by @Erel and changed the Manifest file to exactly what is in the example.
I then tried to load a pdf file with this code
B4X:
Dim in As Intent
in.Initialize(in.ACTION_VIEW, "")
Starter.Provider.SetFileUriAsIntentData(in, filename)
in.SetType("application/pdf")
StartActivity(in)
then I tried it like this
B4X:
Dim pdffile As String = Main.pdffolder&filename
Log(pdffile)
Dim in As Intent
in.Initialize(in.ACTION_VIEW, "")
Starter.Provider.SetFileUriAsIntentData(in, pdffile)
in.SetType("application/pdf")
StartActivity(in)
and the file and path is
/storage/emulated/0/Android/data/b4a.chat/files\pdf\AC176F06-875F-B44A-8A5E-725D2DFA7BAB.pdf
the main.pdffolder is
B4X:
Public pdffolder As String = File.DirDefaultExternal&"\pdf\"
where my pdf files do arrive . I have checked the file by going directly to it and opening it and it opens.
At the moment all what happens it is goes to the app to open the pdf and then displays the filename and close back to my app
I also tried making the files path in manifest to my path
B4X:
<files-path name="name" path= DirDefaultExternal&"/pdf" />
but that fails on Compile
According to@Erel's post the active folder is
files-path = File.DirInternal
how can I change this to File.DirDefaultExternal
In my app all data is sent to these folders where I read from and write to
B4X:
shared = Starter.rp.GetSafeDirDefaultExternal("")
Main.imagefolder=shared&"\images\"
Main.pdffolder = shared&"\pdf\"
Main.profilefolder = shared&"\profiles\"
Main.thumbnailfolder =shared&"\thumbnails\"
Please off any advise where to look next
Thank you
Last edited: