Ketika melakukan developing aplikasi android yang menggunakan peta (map) nya si google, maka sebelumnya kita harus mempunyai semacam key untuk mengakses google map tersebut. Yang hasilnya akan kita masukkan ke dalam settingan API key untuk aplikasi android tersebut.

Beberapa kegunaan Map API Key ini :

  • To display Maps data in a MapView, you need to register for a Maps API Key
  • Each Maps API Key is uniquely associated with a specific certificate, based on an MD5 fingerprint of the certificate
  • Each MapView must reference a Maps API Key, and the Key referenced must be registered to the certificate used to sign the application
  • All MapView elements in an application can reference the same Maps API Key
  • You can register multiple certificates under your developer identity
  • You can get a temporary Maps API Key based on your debug certificate, but before you publish your application, you must register for a new Key based on your release certificate and update references in your MapViews accordingly

Untuk mendapatkannya, kita membutuhkan tool bawaan dari java yang bernama keytool. Tool tersebut biasanya berada di direktori hasil instalasi java/bin. Jadi silahkan cek terlebih dahulu. Jika sudah ada, maka berikut ini langkah-langkahnya :

1. kita perlu mendapatkan MD5 Fingerprint untuk Signing Certificate aplikasi kita. Perintahnya :

1
2
$ keytool -list -alias androiddebugkey -keystore
<file .keystore> -storepass android -keypass android</file>

file keystore itu berbeda-beda lokasinya, tergantung OS yang digunakan. Misalnya :

  • Windows Vista: C:Users\.androiddebug.keystore
  • Windows XP: C:Documents and Settings.androiddebug.keystore
  • OS X and Linux: ~/.android/debug.keystore

Hasilnya kurang lebih seperti ini :

1
Certificate fingerprint (MD5): 94:1E:43:49:87:73:BB:E6:A6:88:D7:20:F1:8E:B5:98

2. Setelah mendapatkan ceritificate fingerprint. Anda langsung menuju ke :

Tulisan Lain   Review Xiaomi Amazfit Bip : Smartwatch Murah dengan Fitur Melebihi Harga

http://code.google. com/android/maps-api-signup.html

Untuk mendapatkan API Key ini, anda paling tidak mempunyai account di google. Baca agreementnya, lalu masukkan certificate fingerprint. Lalu generate API Key. Selesai 🙂

By alfach

One thought on “Cara Mendapatkan Map API Key untuk Android”

Leave a Reply

Your email address will not be published. Required fields are marked *