About calling Baidu and the German app

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.