How to get google map apikey in android

后端 未结 7 1726
轮回少年
轮回少年 2020-12-05 05:53

Hi At that time working on google map. I want to display map in my activity. I successfully display the map view. But i cant show the map i think i have wrong api key so h

7条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-05 06:38

    serverAddress = new URL("http://maps.google.com/maps/geo?q="
                        + Double.toString(loc.getLatitude()) + ","
                        + Double.toString(loc.getLongitude())
                        + "&output=xml&oe=utf8&sensor=true&key="
                        + R.string.GOOGLE_MAPS_API_KEY);
    

    Where GOOGLE_MAPS_API_KEYS is a string in string.xml containing your maps api key

提交回复
热议问题