Android simulator GPS signal settings

Source: Internet
Author: User

When obtaining GPS information on the simulator, use location loc = locationmanager. getlastknownlocation ("GPS"); To obtain location information, but LOC is usually null in debugging, because you need to manually add GPS information to the simulator first, there are two ways to manually add
1. In eclipse, manually set the longitude and latitude under windows --> open perspective --> ddms --> emulator control --> manual, and press the send button.
2. manually add information under cmd.
(1) first open the simulator, run cmd, and enter Telnet localhost 5554 (Note: 5554 is the port of the simulator on the local machine. It may be different. The specific port number, in the upper-left corner of the simulator ).
Android Console: Type 'help' for a list of commands
OK.
(2) Use the GEO command to simulate GPS signal sending:
GEO fix Longitude Latitude,

For example, GEO fix 116.37 39.95
(3) a gps mark is added to the status bar of the simulator ~ Use location loc = locationmanager. getlastknownlocation ("GPS") to obtain the coordinates ~~

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.