Tuesday, July 31, 2012

Worth updating to Android SDK Tools 20.0.1: fixed multiple emulator instances, and VirtualBox too?

Android SDK Tools 20.0.1 didn't download for me via the Android SDK Manager. (This was a week ago so it might be updated now.) I had to uninstall SDK Tools from Android SDK Manager, then manually install 20.0.1 from http://developer.android.com/sdk/index.html. I should mention I'm running Windows 7 64-bit.

It was worth doing the manual update because the biggest regression, inability to run multiple emulator instances simultaneously, was fixed. Phew. I was getting tired of having this decent PC with tons of RAM--which I had upgraded specifically for running virtual machines and emulators!--and not being able to run multiple emulator instances.

Then surprisingly, although maybe completely coincidentally, when I tried running an Ubuntu guest on VirtualBox, it was really snappy. I didn't remember it being this fast before. I do remember having the same Ubuntu guest in the past be somewhat slow, with some input lag and just overall sluggishness, and that turned me off from using it very much. I also remember reading something to do with VT-x being blocked by Intel HAXM.

But now VirtualBox is fast. Fast like using HAXM with Android running an Intel Atom image. I can think of a few possible causes:

  1. Android SDK Tools 20.0.1 and Intel HAXM 1.01 finally behave well with virtual machines. VT-x is no longer blocked by the Android emulator, allowing VirtualBox to take full advantage of the virtualization speedups.
  2. Or, maybe the Ubuntu VM image was sitting on some bad sectors on my SSD. It somehow moved to good sectors, speeding up the VirtualBox performance.
  3. Or, I could be getting old and everything seems fast at age 25.
Whichever it is, I'm really glad I can make full use of my development machine now when it comes to VMs and emulators. My 16 gigs of RAM are smiling.

Monday, July 23, 2012

aww: reddit pictures widget

Today I'm releasing a new Android widget called "aww". It shows reddit pictures on your home screen. The app name comes from a popular subreddit called /r/aww which shows pictures of cute things that make you say "aww" (mostly pets). The widget lets you show pictures from any subreddit, not just /r/aww.

I made the widget because I felt a need to easily view content and decorate your Android phone with reddit content. My girlfriend had gotten a new Android phone, and while she said she enjoys my reddit is fun app, I knew reddit's comments and commentary weren't really her thing. But once I installed "aww" on her phone, she suddenly got very interested in the picture subreddits. Her favorites are /r/aww and /r/earthporn (work safe). Most importantly, she doesn't have to launch a new app just to view the images; they're right there on her home screen.

So, the target audience of this widget encompasses true redditors and lurkers alike. It brings the content right to your home screen, without the need to sift through the post titles and the vote scores and drown in the comments, if you don't want to.

Put another way, it's the laziest way to view reddit pictures on your Android device.

See more screenshots on the Google Play Store app page: https://play.google.com/store/apps/details?id=com.andrewshu.android.redditaww

Monday, July 16, 2012

Working around Android 4.0.3 emulator crash, with x86 and GPU acceleration, on Windows 7 64-bit

So this Android SDK tools bug has been affecting me since around revision 18 when they introduced GPU emulation. Current revision is 20. I've been following Android issues 28515 and 28601. The issue is that trying to create certain sizes of emulator on Windows 7 64-bit break, especially with GPU acceleration enabled. Phone-size emulators work, but it's been a huge pain testing tablet-size because my only option was using an unaccelerated (read: extremely slow) tablet emulator.

I was finally able to come up with a solution leveraging some of the comments in issue 28601, plus additional trial and error. I posted the solution in issue 28601.

Here it is: Create or edit an AVD in the SDK Manager with these settings:

Target: API Level 15
CPU: Intel Atom x86
Resolution: custom 1280 x 800
* Hardware Back/Home key: no
* Abstracted LCD Density: 160  **note: 320 makes phone layout, 160 tablet
* Keyboard lid support: no
* Max VM application heap: 48
* Device ram size: 512
* GPU emulation: yes

And it works quite well. There are a few graphic glitches and artifacts, but it runs smooth as butter on my machine. Most importantly, it doesn't crash when I enable GPU emulation and Intel x86 CPU! Never again will I rue the tablet testing cycle. (Unless the next SDK tools update breaks it again.)

Thursday, June 21, 2012

Android: Design is Google's top priority

For a long time Android has had the reputation of being ugly. Since Android 4.0 Ice Cream Sandwich, that's changing.

I just happened to take a look at the android docs (looking at Data Backupand noticed they've revamped the whole developer documentation site. It now more-or-less matches their Android Design guidelines page, which accompanied Ice Cream Sandwich.

This is pretty important for Google if they want to compete with Microsoft's Metro UI. Although Microsoft has plenty of their own humps that they have to overcome, including some unsurprising Windows 8 bashing from various authors, consensus is that Metro is visually pleasing, arguably even more so than both ICS and Apple's iOS.

The recent announcement of Microsoft's Surface Tablet also spells some trouble for Google. The tablet-plus-full-keyboard device is intended to fill the niche that Windows 8 will be creating with its new gesture-and-keyboard hybrid UI.

No wonder, then, that on the new Android developer site, Design is first and Develop second. Sure, it only makes sense since the tabs are, in order: Design, Develop, Distribute, which matches the typical way of making an app. But the fact that they now, unlike before, lay that out so explicitly, ushering newcomers to look at the entire Design section first, is quite telling of Google's current position in the mobile ecosystem and mindshare.

It's definitely a larger trend in tech these days, where Design and Simplicity are king, and as for actual features, less is often more. It's clear that the big players, beginning with Apple five years ago and now Google and Microsoft, are really drinking the Kool-Aid. And so are thousands of developers who keep up with the latest trends. This is a great thing; I'd love to see every app I use be eye candy. I'd love to design some beautiful and functional apps. Just interesting how everyone seems to be "getting it" at the same time.