Is there a way to get a Json Map in the order it was put into. It's not really an issue, but for API browsers and documentation it's nicer to return Json results (and errors following RFC 7807) in the order people expect.
Consider this code:
B4X:
Dim m As Map
m.Initialize
m.Put("first", "testvalue")
m.Put("last", "testvalue")
Dim j As JSONGenerator
j.Initialize(m)
Log(j.ToPrettyString(4))
It will not help. The order is based on the strings hash code.
While B4J Map preserves the order of items, the underlying map created by the JSON SDK doesn't preserve the order. There is no simple way to make it preserve the order (without sacrificing performance).
Thanks for that link FrostCodes! Didn't notice that thread!
Altough I seem to be doing something wrong, as it doesn't work for me. See that thread for more details.