As, I guess, most of the prospective Android developers, I started my Android experience by going through the Tutorial. This tutorial assumes Eclipse-based development environment. Many people love Eclipse but I am kind of old-fashioned and I prefer command line development tools. Somehow I feel myself more in control of what is happening during development. :-)
The documentation coming with Android is pretty exhaustive on command-line tools but I had to figure out myself how to use them because step-by-step tutorial similar to the Eclipse-based one is not available.
First, I created a root directory for the project then I created the project skeleton with the activityCreator script (I assume that the SDK was installed correctly so the SDK tool binaries are on the path).
C:\USERS\paller\android\helloworld>activityCreator aexp.helloworld.HelloWorld
This created the project skeleton into the current directory. The project skeleton is actually a functional HelloWorld application that can be compiled by invoking ant in the project root directory and may be executed on the emulator. Adb is the tool that talks to the emulator. In order for adb to function, the emulator needs to be running. Adb can be requested to query the available emulators.
C:\USERS\paller\android\helloworld\bin>adb devices
List of devices attached
If the emulator was started with the emulator command, the same adb command detects it.
C:\USERS\paller\android\helloworld\bin>adb devices
List of devices attached
1 emulator-tcp-5555 device 0
The ant script creates the installable package with apk extension in the bin subdirectory of the project root directory.
C:\USERS\paller\android\helloworld\bin>adb install HelloWorld.apk
151 KB/s (0 bytes in 2421.000s)
Now let's see the emulator. Our application can be found in the Applications folder that is the leftmost icon on the rolling bar.
Entering this folder, the application can be found and executed.
0 comments:
Post a Comment