Wednesday, September 22, 2010

Smartphone US Market Share

Total market share:


Sources: ComScore, NPD

Monday, September 13, 2010

NTouch released on Android Market

My first app was just released on the Android Market. It's a very simple app that visualizes multi-touch capabilities (or incapabilities!) of any device that runs Android 1.5 or higher:

Even in this little app, I learned quite a lot. I learned how to support multiple OS versions in a single APK (set target SDK high, set minSdkVersion low and encapsulate all version-specific code). Unfortunately there aren't any compiler help to spot incompabilities in the version-specific code. The code that was written for the old OS version don't trigger any compile errors/warnings if it tries to use a newer API. If it fails, it will fail at run-time. And there isn't any c-preprocessor to make it easy to compile differently. :/

Perhaps it's possible to make various test environments with Ant, separating code for Android 1.5 and make sure they compile fine in a pure Android 1.5 environment. Then another separation for code that's for Android 2.1 and test that path separately. Would be very neat. Need some ant XML magic here perhaps...

NTouch is pretty interesting when you turn on event logging... You'll see the original Droid do some weird things, especially when the second pointer hits. It'll incorrectly report the same position for both touches at that time, and subsequent MOVE events may switch the touch id. (It's possible that this is fixed in Droid's Froyo update...)

The precision and robustness also depends on whether you hold the device in your hand or not. When the device is lying on a table and isn't "grounded", your touches can generate weird results...

With event logging turned on, you can also see what happens when the orientation changes. The app is actually shut down and restarted by the OS. However, all current touches are lost in the transition. If you keep a finger on the screen during an orientation change you'll stop receiving any more touch events. You'll have to release the finger and put it back on the screen to start generating touch events again. Seems like an OS issue.

Friday, September 10, 2010

Saturday, September 4, 2010

Swype tip: Editing text

Swype has a powerful "hidden feature" that allows you to move around the text cursor, which can be problematic if your phone doesn't have a trackball or keypad. It also allows you to select text and cut/copy/paste. It even has PgUp / PgDown / Home / End buttons and other functionality. To access this feature, swipe your finger from the Info button to the SYM button.

Swype tip: How to type double letters

The very first text I wrote with Swype was "This is cool" but to my disappointment, it ended up as "This is col". Now that I'm older and more experienced, I've learned how to write double letters with Swype - you move your finger in a little loop over the letter you want doubled.

Installing the Android development tools on multiple machines

If you need to install the Android development tools on many machines, you can install everything into a single folder and zip it up. Once you have the .zip file, you don't have to run any installers on the other machines. Just unzip and set up environment variables. To make it even easier and non-intrusive, make a .bat file to set up local environment variables just for when you need it.

For a full installation, the .zip file would contain the following folders:


The .bat file could look something like this:

@echo off
set JAVA_HOME=D:\Android\jdk1.6.0_21
set ANT_HOME=D:\Android\apache-ant-1.8.1
set ANDROID_HOME=D:\Android\android-sdk-windows
set NDKROOT=D:\Android\android-ndk-r4b
set CYGWIN_HOME=D:\Android\Cygwin
echo Android environment is now set up.

Thursday, March 25, 2010

DropBox for Android

Screenshots and info is now online (
DropBox is coming to all flavors of Android "in a couple of months". It will allow for offline viewing, editing, streaming MP3 straight from DropBox, etc.

Monday, March 22, 2010

Android development

Here are a few quick steps to get started. These steps don't include native development (i.e. C/C++) using the NDK.

  1. Download JDK (jdk-6u18-windows-x64.exe)
    • Install JDK to C:\Java\jdk1.6.0_18
    • Install JRE to C:\Program Files\Java\jre6
  2. Download Ant (
    • Unzip to C:\Java\apache-ant-1.8.0
    • Add C:\Java\apache-ant-1.8.0\bin to PATH env var
    • Set env var JAVA_HOME=C:\Java\jdk1.6.0_18
    • Set env var ANT_HOME=C:\Java\apache-ant-1.8.0
  3. Download Android SDK (
    • Unzip to C:\android-sdk-windows
    • Add C:\android-sdk-windows\tools to PATH env var
  4. Install Android SDK components
    • Run C:\android-sdk-windows\tools\SDK Setup.exe
    • Install Install Android 2.1, docs, usb driver, Android 2.1 SDK and docs
    • Add Android Virtual Device (AVD) called "MyVirtualAndroid"
  5. Install USB driver
    • Use Device Manager -> Nexus One -> Update driver
    • Browse to C:\android-sdk-windows\usb_driver (enable recursive search)
  6. Create Android project
    • Open cmd prompt in new empty project folder (e.g. C:\Dev\Android\Hello)
    • Type "android list targets" and see what id number the Android 2.1 target is (1)
    • Type "android create project --target 1 --name MyAndroidApp --path . --activity MyAndroidActivity --package com.example.myandroid"
    • Check that the folder now contains a bunch of new files and sub-folders
  7. Compile
    • From the project folder, compile with "ant debug" (signed with debug key) or "ant release" (unsigned and will not run on the device until it's been signed)
  8. Run on emulator
    • Launch emulator with "emulator -avd MyVirtualAndroid"
    • Install app with "adb install -r bin\MyAndroidApp-debug.apk"
      • May have to run it twice if the daemon wasn't running
      • You can check if the daemon is running by typing "adb root" or "adb devices"
    • Launch app within the emulator (should show up as an app icon)
  9. Run on Android device
    • Connect Nexus One via USB cable
    • On the device: Settings -> Applications -> Development -> Enable debugging
    • Verify connection by typing "adb devices"
      • Make sure the attached device is the only one in the list (close the emulator if it's running)
    • Install app on device: "adb -d install -r bin\MyAndroidApp-debug.apk"
    • Launch app on device (shows up as a regular app icon)

Have fun!