B4J Question KVS put/get image?

ilan

Expert
Licensed User
Longtime User
hi

i am using in my android app the key value store 2 class.
i am getting image with the GetBitmap function.

i want now to create the database in b4j and then use it in b4a.
how do i put an image to the database in b4j so i can read it when i upload the same database to my b4a app?

thanx
 

ilan

Expert
Licensed User
Longtime User
will this work?

B4X:
Public Sub PutImage(Key As String, Value As Image)
    Dim out As OutputStream
    out.InitializeToBytesArray(0)
    Value.WriteToStream(out)
    Put(Key, out.ToBytesArray)
    out.Close
End Sub
 
Upvote 0
Top