GPS Debug Record

Source: Internet
Author: User
GPS debug record:
1. The GPS data is incomplete and the log information is as follows:
W / LocationManagerService (392): Dropping incomplete location: Location [gps 22.563652,113.866384 acc = ??? t =?!? Et = + 3m15s512ms alt = 128.724
W / LocationManagerService (392): Dropping incomplete location: Location [gps 22.563652,113.866384 acc = ??? t =?!? Et = + 3m15s514ms alt = 128.724
This is because GPS data was strictly judged in Android 4.2, and the isComplete () function was added; therefore, for compatibility with 4.0 systems, it can be shielded by default:
Drop isComplete () ----- Force reporting data frameworks / base / services / java / com / android / server / LocationManagerService.java


2. The content of the passed data cannot be passed to the bundle data
In the original mLocation.getExtras (). PutString (LOCATION_PROVIDER, GPS_CFG_GPS); ----- This forces the assignment to extras
Log.v (TAG, "reportLocation" + mLocationExtras.getString (LOCATION_PROVIDER)); The null value has been printed all the time, which is suspected to be a problem with data transmission.

But in 4.2 getExtras () ------ The default bundle passed only satllites: as seen in the following log
D / LocationManagerService (376): incoming location: Location [gps 22.564725,113.865403 acc = ??? t =?!? Et = + 6m12s856ms alt = -32.327 {Bundle [{satellites = 0}]
}]

Solution: You need to operate satllites in a similar way to pass data:
mLocationExtras.putString (LOCATION_PROVIDER, GPS_CFG_GPS);
mLocationExtras.putInt ("satellites", svCount);
The data passed like this is normal:
D / LocationManagerService (356): incoming location: Location [gps 22.564725,113.865403 acc = ??? t =?!? Et = + 7m25s937ms alt = -32.327 {Bundle [{location_provi
der = gos}]}]]
————————————————
Copyright statement: This article is the original article of the CSDN blogger "tianruxishui", which follows the CC 4.0 BY-SA copyright agreement. Please reprint the original source link and this statement.
Original link: https://blog.csdn.net/tianruxishui/article/details/41514815

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.