Found the latest version of Baidu Android positioning SDK v6.1.3 network location bug

Source: Internet
Author: User

For Baidu Map has really unbearable, the laboratory two years ago a project used to Baidu map, before seniors graduated, I to maintain this broken project, Baidu Map launched a new version, the old version of the API can not be used, you can not be backward compatible? Replace a small number of API also forget, incredibly overall style has changed,
Grandpa's, I have to learn the old version of the API to understand the code, and then learn the new version of the API to modify the project, this is nothing, however, your new version of the official demo how to stay bug!! Toss a day later found that this is Baidu Android Location SDK Bug, not my own code of the problem feel very wonderful have wood!!!

Use the Baidu website to provide the demo learning, found a bug
//high-precision positioning mode: This positioning mode, the use of network positioning and GPS positioning, priority to return to the highest precision positioning results;
Option.setlocationmode (Locationclientoption.locationmode.hight_accuracy);




positioning results: Latitude: 4.940656E-318 longitude 4.940656E-318 (this latitude and longitude anyway on earth is not, maybe on Mars there, I read less)


After all kinds of tossing, after suspecting life, I no longer doubt the code, I began to doubt whether this version of the Location SDK has a problem,
Baidu API provides the following two types of positioning mode,

//low-Power positioning mode: This positioning mode will not use GPS, only use network location (Wi-Fi and base station location);
Option.setlocationmode (Locationclientoption.locationmode.  battery_saving);

Use only device positioning mode: This positioning mode, no need to connect to the network, only GPS positioning, this mode does not support indoor environment positioning.
Option.setlocationmode (Locationclientoption.locationmode. Device_sensors);

I changed the code to the bottom of this, only using the device's own GPS positioning;

After the change, get outdoors, positioning success,


Comprehensive: The new version of Baidu Android positioning SDK v6.1.3 network location has a bug, but fortunately this project is outside the collection set up stations, there is no WiFi, the basic is the use of GPS positioning.

Found the latest version of Baidu Android positioning SDK v6.1.3 network location bug

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.