Just Another Day in Android-land: Expandable TextView with Custom Ellipsis

After over 4 months of my first notorious “death march” our team can at last have life. I finally have time to write a custom component for my future use. It is a customized TextView with a few customization on the function that trim down excessive characters. Suppose the UI can only display a limited lines of characters by specifying android:maxLine attribute, The TextView can be clicked to show the whole text. Also the ellipsis (…) at the end of the text while trimmed, aka ellipsized, can be customized.

Read More

Android Development: How the Spinner and PopupWindow finally clarify my misconception about Context

In my recent development, I have received a requirement to put Spinner inside a PopupWindow. I expected an easy task. When the popupwindow is shown, there was no error whatsoever. But whenever I click on the spinner, the program F.O.R.C.E.D C.L.O.S.E.D. (On a side note, Forced Close should be replaced by a swear word). The logcat gives a BadTokenException and asked if my Activity is still running. You must be kidding me, I was calling the Spinner when the Activity is running, and of course it is in the UI thread. I am not able to pinpoint the problem, and Google doesn’t really help much this time. I was forced to use my brain at last. I was excited.

Read More

PHP is English

Recently many software gurus(e.g.: [Jeff Atwood](http://www.codinghorror.com/blog/2012/06/the-php-singularity.html & Fabien Potencier) whom I admired debates how good/bad PHP is. Some criticized, with strong technical reasons that PHP should be cast to hell and leave them rot like what we did to COBOL. I wholeheartedly agree with them. PHP is simply not suitable for large projects. My experience with plain PHP, Wordpress and Drupal makes me want to strangle myself over and over.

Read More