官方文档地址

高德:http://lbs.amap.com/api/amap-mobile/guide/android/route
百度:http://lbsyun.baidu.com/index.php?title=uri/api/android
腾讯:http://lbs.qq.com/uri_v1/guide-route.html
谷歌:https://developers.google.com/maps/documentation/android-api/intents

地图应用包名

根据包名可查询是否安装了该应用
高德:com.autonavi.minimap
百度:com.baidu.BaiduMap
腾讯:com.tencent.map

代码示例

没有传入起点坐标,则默认定位当前位置为起点
调起百度导航:

intent = new Intent();intent.setData(Uri.parse("baidumap://map/direction?" +                  "destination=latlng:" + latitude + "," + longtitude + "|name:目的地" +"&mode=driving"));startActivity(intent);

调起高德导航:

intent = new Intent();intent.setPackage("com.autonavi.minimap");intent.setAction("android.intent.action.VIEW");intent.addCategory("android.intent.category.DEFAULT");LatLng newEnd = convertBaiduToGPS(new LatLng(latitude, longtitude));//转换坐标系intent.setData(Uri.parse("androidamap://route?sourceApplication=艾亚科技&dlat=" + newEnd.latitude + "&dlon=" + newEnd.longitude + "&dname=目的地" + "&dev=0&t=0"));startActivity(intent);

调起腾讯导航:

intent = new Intent();LatLng newEnd = convertBaiduToGPS(new LatLng(latitude, longtitude));//转换坐标系intent.setData(Uri.parse("qqmap://map/routeplan?type=walk&to=目的地&tocoord=" + newEnd.latitude +"," + newEnd.longitude + "&policy=1&referer=myapp"));startActivity(intent);

具体参数含义,上述官网中有详细注解。

更多相关文章

  1. android坐标系相关知识点
  2. Android中的坐标系统
  3. android中的坐标系以及获取坐标的方法
  4. 腾讯开源的Android UI框架——QMUI Android
  5. Android坐标系、视图坐标系与触控事件(MotionEvent)
  6. 腾讯面试官:Binder的系统服务是如何获取的?
  7. Android腾讯微薄客户端开发教程汇总
  8. 腾讯面试官:了解Java Binder中的系统服务吗?
  9. 分享一次腾讯Go开发岗位面试经过

随机推荐

  1. cocos2dx android resources.ap_ does no
  2. android 横竖屏切换问题的解决方案
  3. findViewById()使用常见错误
  4. 2018.10月Android优质开源项目
  5. flutter 密码/验证码输入框
  6. Android 2.3姜饼的API改变大全
  7. 第一章:初入Android大门(教程篇)(下)
  8. 新书内容连载(2):Android Activity的生命周
  9. Android(安卓)ImageView 的 scaleType 属
  10. (OK) 在CentOS7—编译OpenSSL 静态库—fo