Wednesday, September 22, 2010

Smartphone US Market Share

Total market share:

Sales:

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: http://www.appbrain.com/app/com.smedis.ntouch

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:

android-ndk-r4b
android-sdk-windows
apache-ant-1.8.1
cygwin
jdk1.6.0_21

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
path=%PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin;%ANDROID_HOME%\tools;%CYGWIN_HOME%\bin
echo Android environment is now set up.