Android Baidu Map client invoke, and invoke. Jar Implementation download APK

Source: Internet
Author: User

Tune up Baidu Map client try {intent = intent.getintent ("intent://map/direction?origin= Zhongguancun &destination= five crossing &mode=driving &region= Beijing &referer=autohome|     Gasstation#intent;scheme=bdapp;package=com.baidu.baidumap;end "); if (Isinstallbyread ("Com.baidu.BaiduMap")) {startactivity (intent);//Start Call LOG.E ("Gasstation", "Baidu maps client already installed     ") ;     }else{log.e ("Gasstation", "Baidu Map client not installed"); }} catch (URISyntaxException e) {e.printstacktrace ();}

/** * Determine if the target app is installed * @param packagename the target app installed package name * @return If the target app is installed */private Boolean isinstallbyread (String packa    Gename) {return new File ("/data/data/" + PackageName). exists (); }

For specific examples, see official website:

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

Download method: Call Baidumapapi_v2_4_0. jar

Alertdialog.builder Builder = new Alertdialog.builder (activity); Builder.setmessage ("You have not installed the Baidu Maps app or app version too low, click confirm Installation?")    ");    Builder.settitle ("hint"); Builder.setpositivebutton ("Confirm", new Dialoginterface.onclicklistener () {@Override public void OnClick (Dia        Loginterface 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 ();

Android Baidu Map client call, and call. Jar Implementation Download APK

Related Article

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.