Android Question Bluetooth AsyncStreams WriteStream to transfer image crashes Android 12 receiver

synasir

Member
Licensed User
Longtime User
Dear all,

I have written an app to transfer images over bluetooth using Bluetooth AsyncStream WriteStream. Before this, the receiver was using Android 10 and it works but changing the receiver to Android 12 immediately crashed the receiver with no error message (even #BridgeLogger: true does not display anything). Code or no code between NewStream will crash the receiver.

Text transfer using AsyncStream Write works as normal.

I am using B4X 9.5

Sender


Sender:
Dim MsgtoSend2 As String
        
            MsgtoSend2 = "M&&"           
                
            
            If Map1FTP = True Then
                
                Dim totalSizeForSending1 As Long = File.Size(File.DirRootExternal & "/SSS/", "image.jpg")
                Dim In1 As InputStream = File.OpenInput(File.DirRootExternal & "/SSS/", "image.jpg")
                countingStream1.Initialize(In1)
                
                If AStream1.IsInitialized = True Then
 
                    AStream1.Write(MsgtoSend2.GetBytes("UTF8"))
                    AStream1.WriteStream(countingStream1, totalSizeForSending1)
                    Map1FTP = False
        
                End If
                Return
                
            End If


Receiver

[CODE lang="b4x" title="Receiver"]

Sub AStream_NewStream (Dir As String, FileName As String)
    
    

    
    
End Sub
 

synasir

Member
Licensed User
Longtime User
1. Updated to the lastest version
2. Using File.DirInternal

Still crashes and no error messages when using USB debug mode.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…