Is it possible to send and receive images using MQTT? I've been trying to do so but always get an error saying that the object i used cannot be serialized with serializator.ConvertObjectToBytes. I've tried with ImageView, Bitmap, Object, InputStream and Type (with ImageView inside).
These are 2 examples of what I've tried:
Also I can't receive the image in the server because I can't compare the object to an image because what the server receives is a Byte Array:
These are 2 examples of what I've tried:
B4X:
' Dim img As ImageView
' img.Initialize("")
' img.Bitmap = LoadBitmap(fd.FilePath, fd.ChosenName)
'
' mqtt.Publish(mytopic, serializator.ConvertObjectToBytes(img))
Dim iStream As InputStream
iStream = File.OpenInput(fd.FilePath, fd.ChosenName)
mqtt.Publish(mytopic, serializator.ConvertObjectToBytes(iStream))
Also I can't receive the image in the server because I can't compare the object to an image because what the server receives is a Byte Array:
B4X:
If obj Is Image Then 'The example uses CircleData that is a Type with basic data types
End If