Alternatives to Google Maps

4

I recently learned that for applications that track users (ex: taxi apps), Google maps charges an annual license to use their API.

Would you like to know if there are other map API alternatives for Android?

    
asked by anonymous 15.11.2016 / 23:16

2 answers

6

Open Street Map is the most famous and free alternative. If you googlar open street map android will fall on their Wiki, and there you will find more links to libraries you can use.

    
16.11.2016 / 00:40
3

To use OpenStreetMap you can download the link , go to the page and download the latest "release" link (for example link )

If it's grandle , add the dependency like this:

dependencies {
    compile 'org.osmdroid:osmdroid-android:(COLOQUE A VERSÃO AQUI):release@aar'
}

If it's Maven:

<dependency>
  <groupId>org.osmdroid</groupId>
  <artifactId>osmdroid-android</artifactId>
  <version>{COLOQUE A VERSÃO AQUI}</version>
  <classifier>release</classifier>
  <type>aar</type>
</dependency>

No manifest.xml add (Android6 + still requires WRITE_EXTERNAL_STORAGE and ACCESS_COARSE_LOCATION / ACCESS_FINE_LOCATION to use osmdroid ):

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> 
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

An example layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:orientation="vertical" 
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        <org.osmdroid.views.MapView android:id="@+id/map"
                android:layout_width="fill_parent" 
                android:layout_height="fill_parent" />
</LinearLayout>

More usage examples:

Other projects that use osmdroid :

04.12.2016 / 19:53