Simple Mobile Browser Detection

http://detectmobilebrowsers.com/

Just found a great website the generate scripts for detecting mobile browsers. It detects mobile browsers based on useragent. It generates script for Apache, ASP, PHP, JavaScript, Python, …

Posted in Tao Of Programming at November 27th, 2012. 2 Comments.

Shell Script For Installing/Uninstalling/Launching APK

My job requires me to install APK, launch application, test application, and uninstall application. Wrote this script to automate commands I have to run in console.

Posted in Tao Of Programming at April 19th, 2012. 2 Comments.

Connecting Android Devices In Linux

Linux kernel is capable of recognizing many Android devices connected through USB. You can make the device available in userspace through udev. In order to do that, I need to write some udev rules.  I use lsusb to find the vendor ID needed to write udev rules. This is my udev rule (/etc/udev/rules.d/90-android.rules):

# Nexus One
SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666"
SUBSYSTEM=="usb",ATTR{idVendor}=="18d1",SYMLINK+="android_adb"
SUBSYSTEM=="usb",ATTR{idVendor}=="18d1",SYMLINK+="android_fastboot"

# HTC
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb",ATTR{idVendor}=="0bb4",SYMLINK+="android_adb"
SUBSYSTEM=="usb",ATTR{idVendor}=="0bb4",SYMLINK+="android_fastboot"

Posted in Blog at February 14th, 2011. No Comments.

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.

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. 8 Comments.

Inspecting APK With aapt

Sometime I am given an APK without the application source code. I need to gather information from the APK file. These information includes package name, version code, services, icon, permissions. Eventually I found out that this is what Android Asset Packing Tool (aapt) does. It is used by Eclipse to package your Android project into an APK package. Read more…

Posted in Blog at October 11th, 2010. No Comments.