An Android widget cannot render JSON. RemoteViews takes a TextView , and a TextView takes a string. So somewhere between "here is a nested object" and "here is a 60-character line", you need a formatting step.
Most widget apps solve this with a visual editor, or with code, or with Tasker. I wanted the third option nobody offers: a format string you can type on a phone keyboard in ten seconds.
This post is the design of that little language, and the two mistakes I made building it.
The constraint
The format has to do five things, and nothing else:
Pick a value out of a nested document: {main.temp}
Project a list onto lines: {stations.*.brand}
Repeat a row per item: #each orders β¦ #end
Do one arithmetic operation, because APIs return cents: {price / 1000}
Lay out multiple lines: \n , \t
Everything else β loops with accumulators, functions, conditionals over arrays β is out of scope.β¦