(1) [class] FileProvider - share files | B4X Programming Forum
https://www.b4x.com/android/forum/threads/class-fileprovider-share-files.97865/
https://blog.csdn.net/danffer1985/article/details/137457442
https://developer.android.google.cn/training/secure-file-sharing/setup-sharing?hl=nb
how to read filebody from other app?
use this? Provider.GetFileUri(FileToSend)
s= File.ReadString ("content://com.example.myapp.fileprovider/myimages/demo.txt")
content://com.example.myapp.fileprovider/myimages/default_image.jpg
https://www.b4x.com/android/forum/threads/class-fileprovider-share-files.97865/
https://blog.csdn.net/danffer1985/article/details/137457442
https://developer.android.google.cn/training/secure-file-sharing/setup-sharing?hl=nb
how to read filebody from other app?
use this? Provider.GetFileUri(FileToSend)
s= File.ReadString ("content://com.example.myapp.fileprovider/myimages/demo.txt")
content://com.example.myapp.fileprovider/myimages/default_image.jpg
B4X:
Private Sub btnViewImage_Click
Dim FileName As String = "b4a.png"
File.Copy(File.DirAssets, FileName, Provider.SharedFolder, FileName)
Dim in As Intent
in.Initialize(in.ACTION_VIEW, "")
Provider.SetFileUriAsIntentData(in, FileName)
'Type must be set after calling SetFileUriAsIntentData
in.SetType("image/*")
StartActivity(in)
End Sub
Private Sub btnShareFile_Click
Dim FileToSend As String = "Message.txt"
File.WriteString(Provider.SharedFolder, FileToSend, "jaklsdjalksdjalskdjasld")
Dim in As Intent
in.Initialize(in.ACTION_SEND, "")
in.SetType("text/plain")
in.PutExtra("android.intent.extra.STREAM", Provider.GetFileUri(FileToSend))
in.Flags = 1 'FLAG_GRANT_READ_URI_PERMISSION
StartActivity(in)
End Sub