mobile


Today is my last day with HBO in Poland. I could not even imagine how bad can commercial mobile application be until I found HBO GO PL Android. This is such FAIL that I am not going to pay anymore for this crap. I have waited over a year for things to get better. I bet most of the 5 star ratings are fake. You don’t give a shit about user feedback, so users will to the same with you. Goodbye HBO..

Screen Shot 2016-09-04 at 18.02.41

On the other hand Netflix has just entered Polish VoD market with a far better application. They responded to my feedback in less than minute and implemented suggested (localization) changes in two days. Now that is good cooperation! Learn from that!

mobile


There are two easy ways to replace text on-the-fly in Android. This may be required if you want to insert some text/values into displayed text, or construct a data packet of some sort. Both require some code to replace given part of the string.

First is to use HTML/XML tags and then handle them with your own implementation of Html.handleTag(). Unfortunately, String conversion removes the tag in the background, so you need to escape < mark with &lt; in the string resource. This approach is good when you want to put variables inside a string and then process them later in one place using tag handling – that is when you want to have a tag handled at processing time – so you only change tags and one processing routine.

Second is to use Format Strings instead of XML/HTML tags. It seems simpler, faster, and evades hidden conversion problems. getString(resource, ...) works like a well known printf(string, ...). This approach is good when you want to process each string manually at runtime, but strings and variables are hardcoded.

[1] http://stackoverflow.com/questions/7899563/android-converting-between-strings-spannedstrings-and-spannablestrings/34556513#34556513