Android TextView And HTML Links

Android’s TextView widget is actually quite robust. It supports various fonts, styles, colors, etc., allowing you to have newlines, bold sections, and more (even defined from XML); however, sometimes the text you are dumping into a TextView is HTML. Fortunately, it’s easy to add HTML to a TextView:

textView.setText(Html.fromHtml(htmlString));

Html.fromHtml() returns a Spanned and the TextView does the rest for you. Continue reading

Posted in Code Samples | Tagged , , , | 2 Comments

Apple Insider Slant

Occasionally, I try to view websites that are very pro-Apple, partly to learn what’s new in that world (and what excites its inhabitants) and partly to get a good laugh. This screenshot is an example where I couldn’t help but laugh before I even got to an article. Now that’s quality entertainment!

In case you don’t immediately see what I did, I highlighted the relevant areas. On one day, there is a post talking about discounts on MacBook Airs, another post talking about how the MacBook Airs have been “flying off the shelves,” and another that shows discounts mean your product isn’t selling (presumably this only applies when your product is not made by Apple). This also requires you to ignore the fact that the discount was a Black Friday deal and not a permanent price change (go ahead, check the product page).

Posted in Opinion / Just Talking | Tagged , , , , | Leave a comment

Motherboard Change

On Thanksgiving I decided to change out the most painful of hardware components to replace: the motherboard. I had previously built my computer with a Gigabyte GA-X58A-UD3R motherboard, which came recommended by Tom’s Hardware, among other sources. It was a relatively low-end motherboard with a LGA 1366 socket, and it was great… for a while. After a few months, the onboard NIC died. That wasn’t too big of a deal for me, but then I started to have other issues. The computer would occasionally lock up without obvious cause. I noticed that the RAM was being overclocked (well, CAS settings) and underpowered by the motherboard’s auto settings, so I manually set those. That didn’t solve the problem though. I eventually gave in and decided to update the BIOS, hoping for some good luck. Continue reading

Posted in Hardware | Tagged , , , , | Leave a comment

Animating Android Activities

A relatively common task is to have some kind of animation between Activities in Android. The default animation isn’t necessarily always the same across devices, and sometimes it is desirable to customize this. A quick look at the docs will lead you to the overridePendingAnimation method of Activity. Perfect! You just activate this method immediately after calling finish() or startActivity() and it works exactly how you would expect… well, unless the device isn’t running at least Android 2.0. It’s very easy to miss the “Since API Level 5″ note in the documentation (you should definitely take advantage of the “filter by API level” feature in the top right of the Android developer site) and adding this method to your code and trying to run it on a previous version of Android will result in a force-closed Activity. Continue reading

Posted in Code Samples | Tagged , , , , | Leave a comment