Search code examples
androidlinuxandroid-studioopenstreetmaposmdroid

Linux - How to install osmdroid libraries for android studio with Gradle?


I am trying to do a tutorial for making an Android application using osmdroid with android Studio, but I didn't succeed to use the library I download on https://github.com/osmdroid/osmdroid

My questions are following :

  1. Where do I have to put the folder download at: github.com/osmdroid/osmdroid ? I don't find any libs folder in home/android/sdk.

  2. Which version I have to put in this command:

    dependencies { 
      compile 'org.osmdroid:osmdroid-android:(INSERT_VERSION_HERE):release‌​@aar'
    } 
    

    instead of INSERT_VERSION_HERE. I don't know how to find it.


Solution

  • Follow the steps at https://github.com/osmdroid/osmdroid/blob/master/README.md

    You don't have to download anything manually. Open your build.gradle and add the following lines (or amend your already existing sections):

    repositories {
        mavenCentral()
    }
    
    dependencies {
        compile 'org.osmdroid:osmdroid-android:5.6.5'
    }
    

    For a list of released osmdroid versions see https://github.com/osmdroid/osmdroid/releases. Currently the newest release is 5.6.5 (as of Feb 4th, 2017).