1.参考下面的地址:我的调用百度的就是采用这个文章的方法
https://blog.csdn.net/hyyz3293/article/details/76836633
2,我自己采用的方法,如下;
//todo:获取当前自己的位置; getLocation(new BDLocationListener() { @Override public void onReceiveLocation(BDLocation location) { MLog.d(TAG, location.toString()); dismissDialog(); float LatitudeNow = (float) location.getLatitude(); float LongitudeNow = (float) location.getLongitude(); if (LatitudeNow > 0 && LongitudeNow > 0) { SharedPreferencesTool.setEditor(context, "LatitudeNow", LatitudeNow); SharedPreferencesTool.setEditor(context, "LongitudeNow", LongitudeNow); } MLog.i("LatitudeNow",LatitudeNow+""); MLog.i("LongitudeNow",LongitudeNow+""); } });
mMap = new ArrayList<>(); if (isAppInstalled("com.google.android.apps.maps")) { mMap.add("谷歌地图"); } if (isAppInstalled("com.baidu.BaiduMap")) { mMap.add("百度地图"); } if (isAppInstalled("com.autonavi.minimap")) { mMap.add("高德地图"); } if (isAppInstalled("com.tencent.map")) { mMap.add(