Android build GPS provide steps and information

Source: Internet
Author: User

Build GPS provide steps and information

1. Recording KML files with Gps2googleearth

2. kml file

2.1 Resolution of latitude and longitude

<LineString>

<coordinates>113.89668,22.95283,0 113.89659,22.95281,0113.89665,22.95287</coordinates>

</LineString>

113.89668 is longitude, 22.95274 is dimension, 0 is altitude

3. GPS provide

3.1. Principle Analysis

Build a GPS provider to send location information obtained by extracting latitude from the KML file

3.2. Key code

Build Locationmanager

Locationmanager Mlocationmanager = (locationmanager) getsystemservice (Context.location_service);

Add GPS provide

Mlocationmanager.addtestprovider (Mockgpsprovider.gps_mock_provider,false, False,false, False, True, True, True, 0, 5) ;

Set up GPS provide available

Mlocationmanager.settestproviderenabled (mockgpsprovider.gps_mock_provider,true);

Building a location

Location location = NewLocation (Gps_mock_provider);

Set up dimensions

Location.setlatitude (LAT);

Set longitude

Location.setlongitude (LNG);

Provide location information

Mlocationmanager.settestproviderlocation (gps_mock_provider,location);

3.3. Note Information

When using this simulation GPS provide, the device must first disable the GPS provide so that the simulated GPS provide can be effective

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Android build GPS provide steps and information

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.