Hi All,
I would like to send a csv file to PC via bluetooth.
I use fileprovider, and this code:
The android device (android 7.0) is paired to the PC (win10). I started the file receive on the PC.
When my intent runs, I can select the PC, and the sending starts, but ends with error (after some minute): "file not sent" and on the PC there is no clue receiving any file.
What wrong I do?
I would like to send a csv file to PC via bluetooth.
I use fileprovider, and this code:
B4X:
Dim txw As TextWriter
'txw.Initialize2(File.OpenOutput(Starter.Provider.SharedFolder, csvnev,False),"Windows-1250")
txw.Initialize2(File.OpenOutput(Starter.Provider.SharedFolder, csvnev,False),"utf8")
txw.Write(sb.ToString)
txw.Close
Dim phone As Phone
Dim in As Intent
If phone.SdkVersion >= 24 Then
in.Initialize(in.ACTION_SEND, "")
in.SetType("text/plain")
in.PutExtra("android.intent.extra.STREAM", Starter.Provider.GetFileUri(File.Combine(Starter.Provider.SharedFolder,csvnev)))
in.Flags = 1 'FLAG_GRANT_READ_URI_PERMISSION
Else
in.Initialize(in.ACTION_SEND, "file://" & File.Combine(Starter.Provider.SharedFolder, csvnev))
in.SetType("text/plain")
End If
StartActivity(in)
When my intent runs, I can select the PC, and the sending starts, but ends with error (after some minute): "file not sent" and on the PC there is no clue receiving any file.
What wrong I do?