Android Baidu Map Client call and call. jar to download apk and androidapk

Source: Internet
Author: User

Android Baidu Map Client call and call. jar to download apk and androidapk

// Call the Baidu map Client try {intent = Intent. getIntent ("intent: // map/direction? Origin = Zhongguancun & destination = wudaokou & mode = driving & region = Beijing & referer = Autohome | GasStation # Intent; scheme = bdapp; package = com. baidu. baiduMap; end "); if (isInstallByread (" com. baidu. baiduMap ") {startActivity (intent); // start the call Log. e ("GasStation", "Baidu map client installed");} else {Log. e ("GasStation", "Baidu Map Client not installed") ;}} catch (URISyntaxException e) {e. printStackTrace ();}

 

 

/*** Determine whether to install the target application * @ param packageName the package name after the target application is installed * @ return whether the target application has been installed */private boolean isInstallByread (String packageName) {return new File ("/data/" + packageName ). exists ();}

For details, refer to the official website:

Http://developer.baidu.com/map/uri-intro.htm#idmykey11

 

 

 

Download Method: Call baidumapi_v2_4_0. jar

AlertDialog. Builder builder = new AlertDialog. Builder (activity); builder. setMessage ("You have not installed the Baidu map app or the app version is too low. Click" Confirm installation? "); Builder. setTitle ("prompt"); builder. setPositiveButton ("OK", new DialogInterface. onClickListener () {@ Override public void onClick (DialogInterface dialog, int which) {dialog. dismiss (); BaiduMapNavigation. getLatestBaiduMapApp (activity );}});

Builder. setNegativeButton ("cancel", new OnClickListener () {@ Override public void onClick (DialogInterface dialog, int which) {dialog. dismiss ();}});

Builder. create (). show ();

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.