Skip to Navigation | Skip to Content



Archive for the 'Uncategorized' Category

How to launch an Android app from the command prompt | October 19th, 2010

We want to pretty much do what Eclipse does when we build&run an Android app:
Compile, Build Package, Uninstall package, Run the app in the emulator/device

function run_emulator {
  package="com.package.name" # replace this with your package name
  class=$1
  ant debug && \
   adb -e uninstall $package && \
   adb -e install -r bin/$class-debug.apk && \
   adb -e shell am start -a android.intent.action.MAIN \
   -n $package/.$class
}

If you want the same thing to run on a device:

function run_device {
  package="com.package.name" # replace this with your package name
  class=$1
  ant debug && \
   adb -d uninstall $package && \
   adb -d install -r bin/$class-debug.apk && \
   adb -d shell am start -a android.intent.action.MAIN \
   -n $package/.$class
}

Add these two functions to your shell profile. It works with Bash and I haven’t tried with other shells.

Here is how to run the app:

$ cd /path/to/your/android_app_root
$ run_emulator ClassName # replace this with the main activity class name


If you deal with different package names you can also specify the package name as a command line argument.

Happy Android Coding!

Posted in Uncategorized | Comments Off | Add to Delicious | Digg It

mobile-spec running on PhoneGap Android Froyo 2.2 | May 20th, 2010

Lots of new features have been added to Android Froyo 2.2. Among the most exciting ones are: Better speed with the inclusion of the V8 Javascript engine, JIT compiler as well as a new set of backup/storage and cloud messaging APIs.

I wanted to see how PhoneGap would work on Froyo so I ran mobile-spec on it and below are the results.

Android Part 1
Android Part 2
Android Part 3
Android Part 4

As you can see it runs the same as on Android 2.1 and previous ! Some tests fail but there not relevant to the Android Platform (orientation etc…)

Posted in Uncategorized | Comments Off | Add to Delicious | Digg It


Search Posts

You are currently browsing the archives for the Uncategorized category.

Archives

Categories