首先是高德、腾讯、百度的包名 //1.百度地图包名 public static final String BAIDUMAP_PACKAGENAME = "com.baidu.BaiduMap"; //2.高德地图包名 public static final String AUTONAVI_PACKAGENAME = "com.autonavi.minimap"; //3.腾讯地图包名 public static final String QQMAP_PACKAGENAME = "com.tencent.map"; 使用packageManager检查应用安装了那些地图软件 private static final String[] MAP_PACKAGES = {BAIDUMAP_PACKAGENAME, AUTONAVI_PACKAGENAME, QQMAP_PACKAGENAME}; List<String> packages = checkInstalledPackage(MAP_PACKAGES); /** * 检查手机上是否安装了指定的软件 * * @param packageNames 可变参数 String[] * @return 目标软件中已安装的列表 */ public static List<String> checkInstalledPackage(String... packageNames) { //获取packageManager final PackageManager packageManager = sContext.getPackageManager(); //获取所有已安装程序的包信息 List<PackageInfo> pa