TinyDB GetEntries()

Hello,
This app works well on iOS, but not on Android.
The Runtime Error occurs on Android.
TinyDBTest2.aia (2.4 KB)

When I use "call JsonTextDecodeWithDictionaries", this app works well on both iOS and Android.
Is this a bug in the Android version, or the current specification of App Inventor?

Thank you.

In Android, the underlying value is not returned as an AI2 list when you get the value from a key, this needs to be decoded back to a list. GetEntries is returned as a dictionary.

Could be a bug, or could be by design ?

Do you have an actual example of this? As you can see in your image the value in the bubble for GetEntries shows the native JSON list, not a stringified copy.

Note that App Inventor auto-coerces values between types in method calls, so the fact that you pass the result of get value for key (which should be a list in this case) into JsonTextDecode causes the list value returned by the get block into a string so that it can be parsed back into a list.

This seems to be the issue:

image

If you try to get a list value from here it fails

image

1 Like

We came across similar issues before:

1 Like

Hmm. I'll have to take a look then. That should be a list (and looks like a list), so I have a feeling something bad is going on in some of the JSON handling code...