Tuesday, November 11, 2014

Using the Android Emulator

First try with android emulator -> too slow

When I first started Android development, I tried to use the emulator, but it was painfully slow. I figured that it was because my laptop was weak (ex: it only had 1 GB of RAM). Luckily, I had an Android phone, so I replaced the emulator with an actual device. Given my weak laptop, I could not be sure if the problem was me or the emulator.

Second try -> still not worth it

After some time, I bought a new laptop with a little more oomph (4 GB of RAM !!!!). The Android emulator performed a little bit better, but it still performed worse than just using a real device. Since the apps I was building did not vary much from one device to the next, this was just sufficient. At this point, I was close to giving up on developing with an emulator forever.

Third try is the charm

With the latest release of Android L, I really needed to use an emulator. The SDK had retired an API that I was using, and I had to depend on a new one. A factory image of the new version of Android was not available for any device I owned. An emulator was my only option, which I feared would bring my development output to a crawl.

Luckily, I found that changing two things really improved the performance of the emulator - from unusable to rather snappy.

  1. Install the Intel Hardware Acceleration Manager. This is available in the SDK Manager in Android Studio, but it did not seem to work for me. So, I manually installed it.
  2. The other thing I did was change the emulator setting to 'Use HOST GPU' and to set the ABI to 'x86' (to take advantage of the hardware acceleration).

With these changes, the emulator has been running really well.

Conclusion

If you are like me, and you have previously given up on the Android emulator, maybe now is a good time to give it a try again.

References

Changes in Android 5.0

Intel hardware accelerated execution manager

Sunday, November 9, 2014

MarkdownBlogger

A New Project

I have been working on a small utility tool that would make blogging easier for me. It's called MarkdownBlogger. In short, it converts markdown text files into html, and then posts those html files to blogger.

Why I have liked working on this project

I have enjoyed this project for a few reasons. First, it's something that I would actually use. Since I spend most of my time building things for other people, it's pretty satisfying using something that I built myself. Also, since I wrote this, I can easily modify it to suit my needs in the future.

I also like this project because I have a well-defined goal in my mind. I want it to do a few things and not much more. With this definite end-goal in mind, I see the finish line in the near future, and I can know when I am done. I think having too many projects in the work-in-progress state can leave a nagging dark cloud over your head.

Now what

Well, I'll keep this blog post short and sweet, just like MarkdownBlogger is meant to be.