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:
- Use more images in slides. Too much words on slides make it hard for people to absorb, and makes the presentation very dry.
- Cannot assume audience knows what is QR code.
Links
- Source code: http://code.google.com/p/qrtalk/
- Step-by-step instruction: http://bit.ly/qrtalk
- Slides: http://bit.ly/g82fxS