Skip to content

Get advancedmap3d to start

Nutiteq edited this page Jun 9, 2014 · 13 revisions

AdvancedMap3D sample application has number of dependencies, and it is not just plug-and-play project. You can choose whether you want to use Maven for dependency management, or just use it without Maven.

No automatic dependency tool

If you have problems with Maven or Gradle, and/or just want to get it running as fast as possible, then AdvancedMap from start to end should work as:

  1. download and install Android Development Tools package (ADT) from http://developer.android.com/sdk/index.html
  2. select Import > GIT project, enter URI https://github.com/nutiteq/hellomap3d.git
  3. Select project: AdvancedMap3D, master branch.
  4. Add android-support-v4.jar as external library to the project. See http://stackoverflow.com/questions/18299898/the-import-android-support-cannot-be-resolved for a guide
  5. if asked, select the highest Android API version what you have installed. Suggested is 4.4 (API level 19)
  6. Copy all files and directories from extlibs folder to libs folder of the project. This provides all dependencies, including Nutiteq SDK itself, and layer-specific dependencies. *
  7. Start the app
    • You can reduce APK size and development time a lot if you exclude mips and x86 subdirectories unless you really need them.

With Android Studio (and Gradle)

This should be quite plug and play:

  1. Make sure you have the latest Android Studio (tested with 0.4.3) and also latest Gradle (1.10 +) installed
  2. Start Android Studio, in Welcome screen select Check Out from Version Control, select GIT and give URL https://github.com/nutiteq/hellomap3d.git
  3. Grab a coffee- it will take few minutes to download the project.
  4. Select Open project when asked right after checkout, in Import Project screen check that Gradle path is correct
  5. Finally you should have two working modules: HelloMap3D for simple app and AdvancedMap3D for many advanced samples.

With Maven and Eclipse

If you have not installed Maven tools and Eclipse plugins, then following steps should get you started:

  1. Make sure you have following Eclipse plug-ins. For Eclipse Kepler you can install easily both from Eclipse Marketplace:
  • m2e - Maven integration for Eclipse. This includes embedded Maven, which should be enough
  • Android Configurator for M2E.
  1. Select Import > GIT project, enter URI https://github.com/nutiteq/hellomap3d.git
  2. Select project: AdvancedMap3D, master branch.
  3. Under project context menu select Maven > Update project...
  4. Build project

Notes:

  1. Some version combinations of Maven might not build Android projects on OSX. According to https://code.google.com/p/maven-android-plugin/issues/detail?id=395 should install older Maven version 3.0.5 instead of 3.1.1. Maven integration for Eclipse has currently 3.0.4 Maven which should work fine.

  2. If GIT cloning does not work or takes too much time, try to download sources as zip, unzip and import the projects to Eclipse.

  3. If you have checked out both AdvancedLayers and AdvancedMap3D project sources in your workspace, then it has happened that AdvancedMap3D project compiles fine but gives runtime exception with some class missing, and does not start. It turns out that Maven tries to build APK with the project in workspace and not with the library jar file, but does not include AdvancedLayers classes to the APK. It looks like a bug in Android build tools or Android Maven plugin. Simplest remedy is to close AdvancedLayers project in Eclipse - then AdvancedMap3D will build against jar in Maven repo and the APK will be complete.

  4. Eclipse Maven Android plug-in does not copy native libraries (OGR, GDAL, Spatialite, Proj.4) automatically, due to m2e-android limitation (issue 44). You have two options to fix this:

a) manually copy extlibs/armeabi to libs/armeabi of the project, or

b) use command-line maven commands in the project root folder to build, install and run app (or use Eclipse Run as Maven build with same targets):

# build
mvn clean package
# install to attached device
mvn install android:deploy
# start the app on device
mvn android:run
Clone this wiki locally