Posts tagged documentation

Airplay SDK – building C++ apps as Android .apk files – first impressions

I noticed the other day that the Airplay SDK now uses modern C++ with STL – nice, and essential for my code. I already knew that the Airplay SDK supported Android, and having taking a look at my Android porting options I really didn’t want to directly port my own C++ app code to Android using STL and JNI – there would be too much pain involved. :-0

So, having just installed the latest Android SDK on Windows 7 and Mac, I figured it was time – finally – to download and install the Airplay SDK evaluation.

In installed the Windows version on my Mac under Boot camp. This requires Visual Studio 2008 (the Express edition should work, if you’re interested…).

Installation on Windows was easy, the eval license registered properly and I was soon following the instructions to build my first basic demo project. [I actually started with the Mac version - still in Beta - but it failed to register my eval license! Serves me right for starting with Beta software :) ]

I double-clicked the example project file for a 3d demo game, which automatically constructed and opened a suitably configured Visual Studio project. Building this for the x86 target was as easy as building any other Visual Studio project – very simple.

Running-up the project under Visual Studio debugger for Windows, ran the app through a device emulator, which worked smoothly.

I next trivially rebuilt the app for ARM Debug target, ran under Visual Studio under ARM emulator on Windows – again this was easy and worked fine – it runs the app through an arm device Emulator, with a graphical version of GDB as the debugger.

Having rebuilt the app for ARM Release target, I next used a simple utility that comes with the Airplay SDK, to bundle-up the app an a .apk file (the installer format for Android). This was really easy. Note, however, that I first had to rename the Android SDK 1.6 folder on my PC (see the Airplay SDK forum for details on how/why!), and had to install a couple of other tools that are clearly documented in the Airplay documentation). Anyways: once your system is configured, building the .apk file is very easy. :)

I next installed the .apk to the Android SDK’s emulator using the “adb install” command, and ran-up the application directly from Android SDK emulator. This worked OK, albeit with a slow frame rate I’ve been told that on devices the frame rate is very, very much faster than the emulator).

So, a really good experience so far. I’m looking forward to finding out more in due course. I was impressed enough to get a 99 dollar “indie” license; the “iPhone” license is actually free, which is very cool.

I’ll need to find out how well it all works on a real Android device, and try some complex 2D graphics and heavy-duty audio, but the Airplay SDK so far looks very promising. It is powerful enough that it even looks like it’d be relatively straightforward to port frameworks like Qt to the Airplay SDK.

I found the online documentation to be a pain to navigate, but the documentation in Windows CHM file format (in the SDK) is pretty good.

The bottom line for me is how easy it was to get from generic C++ code, to a .apk file for Android – very impressive indeed. Not only that, the SDK supports buildling Symbian .sis files, Window Mobile .cab files … and various other platforms. Plenty here to keep me busy and productive!

My vim for android devlopement environment

I haven’t blogged for a long time, and I would have liked to be able to blog about my Gnome soc project, but unfortunately, I have other priorities. As part of my studies, I had to do some development for the android platform, and since the last summer, I can’t use other development environment than Vim, I decided to find a way of using it for my android project.

So here is the description of my Vim environment for android applications development. I use vim 7.2, the version distributed with Ubuntu 9.10, the Vjde plugin, terminator as a terminal (which by the way is a great terminal emulator!!) and then last android JDK in order to develop application for android2.0 (eclaire).

First I installed the SDK (there are a few bugs on the emulator installation due to this bug and an this ssl problem. I fallowed this guide to set the sdk. Then, I installed the Vjde plug-in which is a Vim plug-in to get a Java development environment in Vi, this plugin permit to add intelligent completion for methods calls as well as for imports (You only need to unzip this in you ~/.vim directory). Afterward, you create your your android project (this page explains well how to do it). And then you need to create an vjde project, in vim:

:Vjdeas filename.prj

This is actually a text file which permit to save variables to you project. Then I set it Vjde to look at android class, methods and package, in vim:

:let g:vjde_lib_path='/path/to/android/sdk/platforms/android-2.0/android.jar:build.classes'

And save it

:Vjdesave

Thanks to it, I can have functions/imports completion available with the CTRL-X+CTRL-U key combination (I need to load the project(:Vjdeload filename.prj) every time I want to work on it, I think there must be a way of doing it automatically but didn’t figure it out yet). It would also be possible to get the documentation integration thanks to the Vjde plugin, but I am used to have it in another window.

Then to try the program on the android emulator, I lunch the emulator, and in a terminal:

ant debug && adb install -r bin/yourAppName-debug.apk

You can then launch it in the android emulator menu (I looked for a way of lunching the program directly from the command line, but didn’t find :( ). To debug the app, you can launch the ddms tool which is part of the android sdk.

I hope this could be useful for some people who want to develop for the android platform and don’t want to use eclipse or netbeans IDE.