Bug? KeyValueStore.b4xlib manifest missing XUI Views dependency

agraham

Expert
Licensed User
Longtime User
KeyValueStore doesn't depend on XUI Views.
Oh yes it does! Lines 118 to 141 reference B4XBitmap and fail compilation without XUI Views selected in the Libraries tab.
B4X:
#if not(B4J) OR UI
Public Sub PutBitmap(Key As String, Value As B4XBitmap)
    Dim out As OutputStream
    out.InitializeToBytesArray(0)
    Value.WriteToStream(out, 100, "PNG")
    Put(Key, out.ToBytesArray)
    out.Close
End Sub

Public Sub GetBitmap(Key As String) As B4XBitmap
    Dim b() As Byte = Get(Key)
    If b = Null Then Return Null
    Dim in As InputStream
    in.InitializeFromBytesArray(b, 0, b.Length)
#if B4J
    Dim bmp As Image
#else
    Dim bmp As Bitmap
#End If
    bmp.Initialize2(in)
    in.Close
    Return bmp
End Sub
#End If
 

agraham

Expert
Licensed User
Longtime User
You are of course correct about it being the right choice for a cross-platform API but as I only do Android in B4X (I'm still using my extended version of Basic4ppc on desktop and will be forever grateful to you for that šŸ‘) it is another level to learn on top of a level that I am familiar with from past times, and being a grumpy old man of increasingly compromised intellectual abilities I tend to stick what I already know šŸ˜Ÿ
 
Top