About Me
Thursday, October 1, 2015
Goodbye Blogger
Sunday, October 20, 2013
Android Meetup Talk: Tips for Better Android Development
Thursday, May 16, 2013
Installing IdeaVim on Android Studio Preview
Update: This post is no longer relevant. IdeaVim shows up in the Android Studio plugin repository and can be installed as expected.
The announcement of Android Studio at Google I/O 2013 marked the rise of IntelliJ Idea as the new standard for Android development. Being a long time Idea user, I'm glad to see Google moving away from Eclipse and Idea stepping into the lime light. The "What's New in Developer Tools" session from yesterday was essentially an introduction to Idea featuring the CTO of JetBrains and an Android Tools engineer touting the new screen layout preview skins, the resource string hints, and the like. This is a good talk for Eclipse users who want to upgrade to Android Studio, however it was quite tedious for seasoned Idea users.
I was excited about switching from my normal Idea environment to this new Android Studio and loaded up my Android project to find that the IdeaVim plugin no longer showed up in the Plugins repositories. This could be a deal breaker for me. The advantages of Android Studio are easily offset by the loss of productivity I'd suffer if I couldn't use IdeaVim. I'm sure support will be added eventually but that doesn't help me now.
Turns out that a manual installation of IdeaVim works. Here are the steps:
- Download IdeaVim plugin from JetBrains Plugins
- Extract and copy Vim.xml to $HOME/Library/Preferences/AndroidStudioPreview/keymap/ to get the Vim keymap
- Open the Plugins dialog in Android Studio and select "Install plugins from disk..." Locate your extracted IdeaVim.jar and load the plugin.
- Restart Android Studio and the plugin should be activated
It seems that I have IdeaVim working correctly. I haven't spent too much time in Android Studio to know if there are any issues with IdeaVim. I'll keep everyone posted.
Wednesday, June 6, 2012
Curing Depression at Random Hacks of Kindness Toronto
During an intense 36 hours, these 900 hackers for humanity came together in 132 different teams to address 124 unique problems and they built 138 solution." RHoK Blog
Sunday, February 12, 2012
A Simple Facebook Cover Photo Hack
Saturday, October 1, 2011
Bad Android Typography: A Tale of Text Justification
Forty-four Americans have now taken the presidential oath. The words have been spoken during rising tides of prosperity and the still waters of peace. Yet, every so often the oath is taken amidst gathering clouds and raging storms. At these moments, America has carried on not simply because of the skill or vision of those in high office, but because We the People have remained faithful to the ideals of our forbearers, and true to our founding documents.
The text above is fully justified with a left and right margin of 200px. Observe the spacing of words on each line and notice the inconsistency. Text justification involves aligning to the left and the right, stretching word spaces to obtain the most uniform amount of per word spacing. When the words are too "loose" it makes for a visually displeasing effect. Hyphenation is used in typography to reduce the looseness of lines. However, browsers don't hyphenate fully justified text. There have been efforts to hyphenate text using Javascript. A script called Hyphenator.js was developed to automatically hyphenate text and is available on Google Code.
On Android, using the standard TextView widget, the problem is worse. The TextView, which is a View used to display text, does not support full justification at all. This means if you wanted to make a reader application similar to the Amazon Kindle app using a TextView, you'd get text that looked like this:
The image on the left shows how mobile WebKit (the rendering engine which powers the WebView) lays out the fully justified text. The second image shows the layout hyphenated by the Hyphenator.js script. The use of two hyphens greatly improved the spacing for lines like "seen grasshoppers and" and "ladybugs. My uncle Bob". The hyphenated WebView text, while superior to the default TextView and the standard fully justified Web text, still has its flaws. The Amazon Kindle Android app does a better job of laying out the excerpt of Roger Ebert's "Life Itself: A Memoir".
So it seems that the problem with full justification on the Web plagues Android because developers must use a WebView to achieve it unless they are brave enough to roll their own text justification algorithm. In case you are interested, try solving this problem from Kleinberg's Algorithm Design concerning "pretty printing" of text:
But unless you are passioned by Markov Chains or Dynamic Programming, you'll probably stick to a WebView with text-align: justify.
[Update] I've just discovered that the new CSS3 Text W3C working draft describes support for hyphenation within the browser: http://www.w3.org/TR/css3-text/#hyphenation. In fact, it's been rolled out in the latest WebKit browsers and in Firefox. I haven't tested it out yet but the usage is fairly standard:
p {
-webkit-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
}
It's great to see typography on the Web moving forward.Thursday, September 15, 2011
Measuring FPS On The Web
CodeAurora Forum: Measuring FPS On The Web












