Building OpenRemote Android 2.0 Console
OpenRemote 2.0 Android console is one of the components in the platform checkout. Please see the instructions on the Subversion checkout if you haven't checked out the source release before.
1. Prepare Android SDK

OpenRemote Android console has been tested with Android 1.6 "Donut" (API 4), Android 2.1 "Eclair" (API 7) and Android 2.2 "Froyo" emulator (API 8). See the "Running OpenRemote Android on Device" section below for more details on device configurations that have been tested.
First download the Android SDK for your development platform of choice: Linux, Mac or Windows.
Unzip the SDK package to your development location. After this, you will need to download and install Android SDK components for the platforms you intend to build the OpenRemote Android console for.
To do this, start the android SDK tool without arguments:
This will open an user interface which allows you to choose which SDK components you want to download, shown in Image 1 below.
Image 1: Install Android SDK Components
After you finish installing the Android SDK components, you can verify the Android platform targets available for your system.
2. Update Android Project
Next update the Android project from the OpenRemote subversion checkout. Use the following (update the path parameter to subversion checkout directory):
3. Build Android Application for Emulator
Switch to your Android checkout directory and execute Ant next to build the Android APK binary:
4. Create Android Virtual Device (AVD)
Start the Android SDK GUI:
In the Android SDK GUI, create a new Android Virtual Device (AVD) in the 'Virtual Devices' section (shown in Image 2 below).
Image 2: Create new Android Virtual Device
In the AVD window, set up the properties of the physical device you want to emulate with the Android SDK. The details will depend on which physical device you eventually want to deploy the OpenRemote Android console application.
Image 3: Enter Virtual Device Properties
Once your AVD has been created, start the emulator as shown in Image 4 below.
Image 4: Start Android Device Emulator
5. Start OpenRemote Android Application with Emulator
Next you need to switch back to the 'tools' directory of Android SDK and start the Android Debug Bridge (ADB) to configure and install OpenRemote Android app on the emulator.
To enable controller discovery from the emulator, port forwarding must be configured:
To install your compiled OpenRemote Android application:
Now you can go to the application menu in the Android emulator and start the OpenRemote Android console.

Running OpenRemote Android on Device
Following steps are only necessary if you want to deploy and test the application on hardware running Android. If you're only interested in testing with emulator, you can skip this section.
First check that the device has been set up for development by enabling the USB debugging in the device's settings.
On a default Android device this can be done by first going to the "Home" screen, then choosing "Menu" and "Settings" -> "Application" -> "Development" -> "USB Debugging". This configuration is shown below in Image 5 for a default Android 1.6 device.
Image 5: Configuring Android 1.6 Device for Development
Once done, connect the device to USB. If you're using Mac, skip the next step. If you're using Windows or Linux, you must first install the appropriate USB drivers/configuration.
Please follow the Android documentation on setting up USB with Windows and Linux.
After you've connected your device with USB, switch back to Android SDK tools. Now repeat same steps to install and application as was done with emulator.
You can first make sure your device shows up with the Android Debug Bridge:
If you've multiple devices connected (including active emulator instances), you can use the '-d' switch to direct ADB commands only to the connected USB device:
Start the device and you should find OpenRemote application added to your application menu.
Next Steps
Troubleshooting
Following section lists some common errors that may occur during the Android build.
1. SetupTask cannot be found
If you receive the following error building the OpenRemote Android Console:
Then make sure you've run the 'android update project' command correctly, as explained in Step 2 above.
When Android project is updated, the build.xml will be automatically modified and will contain path declarations to Java archives in Android SDK which include the task implementation required by Ant build tool:
...
<!-- Custom Android task to deal with the project target, and import the proper rules.
This requires ant 1.6.0 or above. -->
<path id="android.antlibs">
<pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
<pathelement path="${sdk.dir}/tools/lib/sdklib.jar" />
<pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" />
<pathelement path="${sdk.dir}/tools/lib/apkbuilder.jar" />
<pathelement path="${sdk.dir}/tools/lib/jarutils.jar" />
</path>
<taskdef name="setup"
classname="com.android.ant.SetupTask"
classpathref="android.antlibs" />
...
Build.xml file of an Android project
2. @Override: method does not override a method from its superclass
If you are receiving several compile time errors such as:
This is likely due to not using Java 6 compiler to build the project. There has been changes with how @Override is handled by Java compiler between Java 5 and Java 6 and OpenRemote Android Console requires Java 6 to build correctly.
See Also
External:
Comments (6)
Sep 16, 2010
Marc Fleury says:
Do you use the ADT for eclipse or not needed?Do you use the ADT for eclipse or not needed?
Sep 16, 2010
Marc Fleury says:
The path for Android update project seems to have completely changed in the rele...The path for Android update project seems to have completely changed in the release I am using (2.0 alpha 7)
it does work with a path that points to the android_console directory
Sep 16, 2010
Juha Lindfors says:
True. Updated the paths. Thanks.True. Updated the paths. Thanks.
Sep 16, 2010
Juha Lindfors says:
No, not using Eclipse.No, not using Eclipse.
Oct 07, 2010
Marc Fleury says:
Would love to remove the comments but can't find how.Would love to remove the comments but can't find how.
Dec 28, 2010
Torbjörn Österdahl says:
The proper path to the 'adb' tool is as follows android-sdk-mac_86/platform-too...The proper path to the 'adb' tool is as follows
android-sdk-mac_86/platform-tools