QRCode Generator Tutorial

2 weeks ago I conducted an Android Training Workshop for CodeAndroid Singapore meetup at Google office. I have designed a tutorial to teach newbies the basic concepts of Android development. In this tutorial, developers learn the basics of Activity, View, Intent, and HTTP request. Developers were taught to create an application called QRTalk.

QRTalk allows user to type in some text message. It uses Google Chart API to encode this message and generate a QR code image. This image is then displayed in a WebView.

URL imageURL = new URL("http://chart.apis.google.com/chart?cht=qr&chs=350x350&chl=hello+world");
Bitmap qrBitmap = BitmapFactory.decodeStream(imageURL.openStream());
imageView.setImageBitmap(qrBitmap);

This is what I have learned while developing the tutorial. With 1 line of code, I am able to make a HTTP request and turn the HTTP response into a Bitmap object instance.

Lesson learned:

  1. Use more images in slides. Too much words on slides make it hard for people to absorb, and makes the presentation very dry.
  2. Cannot assume audience knows what is QR code.

Links

Posted in Tao Of Programming at February 11th, 2011. No Comments.

[Android] API Demos

Just post another entry at http://gtugkl.blogspot.com/2009/09/android-api-demos.html.

Share a helpful tip for learning Androd programming. The SDK package comes with examples that cover a variety of topics.

Posted in Tao Of Programming at September 6th, 2009. No Comments.