I can not open a pdf file in the folder File.DirAssets & "/products/product.pdf, there is an error or you can not open a file in that folder?
B4X:
Dim In As Intent
In.Initialize(In.ACTION_VIEW, "file://" & aFile)
In.SetType("application/pdf")
In.SetComponent("android/com.android.internal.app.ResolverActivity")
StartActivity(In)
I can not open a pdf file in the folder File.DirAssets & "/products/product.pdf, there is an error or you can not open a file in that folder?
B4X:
Dim In As Intent
In.Initialize(In.ACTION_VIEW, "file://" & aFile)
In.SetType("application/pdf")
In.SetComponent("android/com.android.internal.app.ResolverActivity")
StartActivity(In)
I don't think you can open a file from the File.DirAssets folder, you may want to copy the file to either the internal folder or your package name folder.
It must be copied to the "external storage" (File.DirRootExternal or DirDefaultExternal). Other apps cannot access internal folders or the assets folder.
That´s the point. YOU (your app) can read the files from your assets. No matter what type of files.
But with the intent you start ANOTHER app which should show the file. This app do need access to your Assets or Internal files to read the file but it hasnt this permission.
So; if you relay on an external app the files should be copied to a place where the external app has access to this file. No matter if it is an Image, Textfile, PDF or whatever.