How to Set Up Native Android Development for MapsBy WRLD Team on 15th June 2015 | Android, Development These are exciting times for the Android development community; with the announcement of Android M at I/O, Google have a number of key features in the works to improve the Android experience for both users and developers. Runtime permissions allows for fine grained authorisation of particular features when used, avoiding the need for an invasive install-time permission dialog when users are least familiar with the value of your app, while deep App linking promises to smoothen the interaction between collaborating apps for a slicker and more integrated experience. An announcement of particular interest to developers deploying applications with native components (like the team here at WRLD) is the official support for C++ and the NDK in Android Studio. As of release 1.3, Android Studio will offer a free NDK plugin based on JetBrains Clion; at WRLD we are big fans of JetBrains, and are expecting great things from this integration. However, until Android Studio 1.3 is released, Android developers must make do with existing tools. We have found that the current NDK tooling presents a pain point for developers when getting to grips with the WRLD SDK examples and open source mobile app, so we’d like to share our environment configuration for developing native Android apps. Hopefully this helps ease some of the pain until a stable Android Studio version 1.3 is officially released!
At eeGeo we use Eclipse with the ADT plugin for Android development. These configuration steps are for OSX but should be similar on Windows and Linux.
- Download and install an up to date, 64-bit version of JDK 8 from Oracle.
- Download an up to date, 64-bit version of Eclipse IDE for Java Developers. Right now, Luna Service Release 2, version 4.4.2 is installed on my machine.
- Open Eclipse, and from the Help menu select “Install New Software…”. Install the ADT plugin as described in the Android developer documentation. Right now, the latest release is ADT 23.0.6 from March 2015.
- From Eclipse, open the Window menu and select “Android SDK Manager”, install the latest SDK Tools (version 24), the latest SDK Platform-tools (version 22), and the Android 5.0.1 SDK Platform (API 21).
- Download and install the latest 64-bit NDK. At time of writing this is version 10e.
- In Eclipse, select “Preferences” from the Eclipse menu. Expand “Android” in the left hand side menu and select “NDK”. Set the NDK path to the location of the NDK.
At this point you should now be ready to begin developing native apps on Android with the NDK! If you are ready start coding then Google have some useful NDK samples to help get up and running. If you want to learn how to easily get started building an app with the beautiful 3D maps in the videos below then read on!
To build an app with WRLD’s beautiful 3D maps, you must sign up for a free developer API key. Sign Up Now
- To setup the workspace, first clone WRLDs open source WRLD app repo from GitHub (git clone firstname.lastname@example.org:eegeo/mobile-example-app.git).
- Import the branch into your Eclipse Workspace by selecting “Import” from the File menu.
- Select Android->Existing Android Code Into Workspace.
- Browse to the branch and import the “android” directory.
- Right click on the imported project, expand the “Android Tools” menu and select “Add native support” (if the option is missing, shut down and reopen Eclipse and try again).
- Add your WRLD developer API key to the app.
- Compile and run the application – you’re now ready to develop a great app on top of beautiful 3D maps!
Interested in developing an app with WRLD’s 3D maps? Our maps are available now for Android, iOS and OSX, and we are experimenting with support for WebGL with emscripten, and for VR with Oculus. Check out our developer site to find out more, or see what WRLD’s beautiful 3D maps are capable of!