Follow the instructions below to create, run and deploy an application using the World Wind Android SDK and Android’s command line tools.
For instructions on developing World Wind Android applications using an IDE, refer to Developing Android applications in IntelliJ IDEA or Managing Projects from Eclipse with ADT.
Run a World Wind Android Example
1. Setup
Set up an Android Development Environment.
2. Download
Download the latest World Wind Android daily build from the World Wind Android SDK Daily Builds site.
3. Extract
Extract the World Wind Android SDK to a folder anywhere on your hard drive. The following steps refer to the extracted folder as WWAndroid.
4. Run
Connect your Android device to your development machine, open a terminal, then run the following commands:
cd WWAndroid adb -d install examples/SimplestPossibleExample/SimplestPossibleExample.apk
Create an Application Using World Wind Android
1. Setup
Set up an Android Development Environment and install Apache Ant.
2. Create an Android Application Project
Follow the instructions on Managing Projects from the Command Line. Create your app’s main Activity by reviewing the programming examples in WWAndroid/examples. The following steps refer to your app’s top-level folder as MyProject, and refer to your app’s name as MyApp.
3. Modify the Android Manifest
Copy the file WWAndroid/AndroidManifestTemplate.xml from the World Wind Android SDK to MyProject/AndroidManifest.xml, then modify it to fit your app.
3. Add the World Wind Android JAR
Copy the file WWAndroid/worldwindandroid.jar from the World Wind Android SDK to MyProject/libs. Android’s build script automatically adds this file to the Java class-path during compilation. During application assembly, the contents of this file are copied into your app’s APK file, and are available on the class-path at runtime.
4. Compile and Run
Connect your Android device to your development machine, open a terminal, then run the following commands:
cd MyProject ant debug adb -d install bin/MyApp-debug.apk
Finally, press the MyApp application icon on your Android device.
These commands compile and install the app in debug mode. Applications compiled in debug mode cannot be deployed to other devices, but can be debugged or profiled. For more information, see Building and Running from the Command Line.
Deploy an Application Using World Wind Android
1. Compile for Deployment
Specify your keystore file and keystore alias by setting the key.store and key.alias properties in your app’s build.properties file. This file is automatically created by Android’s command line tools during project creation.
key.store=path/to/my.keystore key.alias=mykeystore
Connect your Android device to your development machine, open a terminal, then run the following commands:
cd MyProject ant release
When prompted, enter your keystore and alias passwords. Your app’s APK file is now located at MyProject/bin/MyApp-release.apk.
2. Publish
-
On a Single Device
Connect your Android device to your development machine, open a terminal, then run the following commands:cd MyProject adb -d install bin/MyApp-release.apk
-
On a Website
Upload MyApp-release.apk to a publicly-accessible web server. Users can then simply point the web browser on their Android devices to the URL of your app’s APK file and download and install the app directly from the web. The Android Demos showcase provides examples of deploying Android on a website. -
On the Android Marketplace
See the instructions for Publishing on Android Market.