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 ();