Baidu navigation Android version problem set _php tutorial

Source: Internet
Author: User
Tags macbook

Baidu navigation Android version problem set


Hardware and Software Environment

    • Macbook Pro MGX 72
    • Android Studio 1.4
    • Cool than Rubik's Cube 7 inch tablet
    • Baidu Navigation SDK 3.0.0

Run Navigation Demo

Start with the usual, apply for a developer account, create an app

Baidu Dev Center

Next to download the demo project, the address is http://lbsyun.baidu.com/sdk/download, it is best to create a new Android project, and then copy the corresponding files in the demo to the project, Because the package name is required in the process of applying the key. Modify the Project menu file Androidmanifest.xml file, add the Application key, re-run the project, the navigation interface is out

Baidu Navi Demo UI

"Road Failure"

The latitude and longitude information of 2 locations was found on the network, (121.387211,31.088074) and (121.523014,31.277986), one as the starting point, and one as the end point, calling the navigation function Bnrouteplannode, prompting "road failure" The error. Later found that the order of the arguments is the longitude in front, latitude after the change in the order of navigation succeeded

No voice

When I opened the demo, I found an error in Logcat.

This is because the SDK built-in Baidu TTS voice broadcast function, need to authenticate the app to use, authorization method is Http://developer.baidu.com/map/index.php?title=android-navsdk/guide/voice

Offline maps

In the demo provided in the Baidu Map SDK, there is an example of downloading the city map Resource pack offline, using the default path to see the OnCreate function in Basemapdemo.java

@Override public void OnCreate (Bundle savedinstancestate) {super.oncreate (savedinstancestate);        Intent Intent = Getintent (); if (Intent.hasextra ("x") && Intent.hasextra ("y")) {//When using the intent parameter, set the center point to the specified point Bundle b = inte            Nt.getextras ();            LATLNG p = new Latlng (b.getdouble ("Y"), B.getdouble ("X"));                            Mmapview = new Mapview (This, new Baidumapoptions (). Mapstatus (New Mapstatus.builder ()        . Target (P). Build ()));        } else {Mmapview = new Mapview (This, new Baidumapoptions ());        } setcontentview (Mmapview);    Mbaidumap = Mmapview.getmap (); }

When the current activity does not have a value (the key value is x and y, corresponding to latitude and longitude information), the map of Beijing is displayed by default. Once you know this, you can change the default map display by passing a value, as in the following example

Bundle bundle = new Bundle (), bundle.putdouble ("Y", 31.088074), bundle.putdouble ("X", 121.387211); Intent.putextras ( bundle); StartActivity (intent);

http://www.bkjia.com/PHPjc/1083071.html www.bkjia.com true http://www.bkjia.com/PHPjc/1083071.html techarticle Baidu Navigation Android version problem set software and hardware environment Macbook Pro MGX android Studio 1.4 cool than Rubik's Cube 7-inch flat-panel Baidu Navigation SDK 3.0.0 run navigation demo first or regular, application open ...

  • 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.