In B4i, it is not possible to add a Null value to a map. Why? It is possible in B4A and B4J, why can't I do it in B4i?
Next, this map is converted to json and some of the points must contain a null value (this is required by the server to which I send it), but I cannot do this in B4i ...
It looks like a bug. Will check it for the next update.
Workaround:
B4X:
Private MyNull As String = "~null~" 'global variable
Private Sub MapToJson(map As Map) As String
Return map.As(JSON).ToString.Replace($""${MyNull}""$, "null")
End Sub
Dim Map As Map = CreateMap("test": MyNull)
Log(MapToJson(Map))
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.