Because of the need, to call the German and Baidu map of the app.
1. Determine if there is a gold and Baidu map, but did not use their SDK package, the way is to detect the mobile phone has installed the app. The first thing to know is the app's package name. Then use the following code to determine:
Private Boolean Isinstallbyread (String packagename) {return new File ("/data/data/" + PackageName). exists ();
2. Call the app. Through intent. However, you can specify and not specify a specific package name. (Baidu: Com.baidu.BaiduMap, German: Com.autonavi.minimap)
Intent Intent = new Intent (Intent.action_view); Uri uri = Uri.parse ("Geo: Latitude, longitude, place name"); Intent.setdata (URI); Intent.setpackage ("app package name"); NavigationActivity.this.startActivity (Intent);
or let the user choose what map to call:
Intent Intent = new Intent (Intent.action_view); Uri uri = Uri.parse ("Geo: Latitude, longitude, place name"); Intent.setdata (URI); NavigationActivity.this.startActivity (Intent);
3. The most silent thing is that this latitude and longitude is not accurate. With Google, because the server access problems have to give up, and then look at the latitude and longitude of Baidu map, gave a value, (23.134032,113.278766). The gold map also gives a value, (23.1274699,113.27242792), but both are inaccurate! Positioning difference of 108,000 miles, helpless on 1.1 points change latitude and longitude in order to achieve the desired location. The final attempt is almost the result (23.13004012,113.26724052). I was thinking, is not the next time to find latitude and longitude to increase or decrease a little difference, but there is no experiment.
This article is from the "Chihiro" blog, please be sure to keep this source http://5200415.blog.51cto.com/3851969/1433320