Emulator(1)GCM Account and GPS

Emulator(1)GCM Account and GPS

1. Update the GPS information on Emulator
>telnet localhost 5554
>geo fix -97.837142 30.233014

Or I can open the DDMS ---> Emulator Control to change that.

It seems that the command is better.

2. How to find the latitude and longitude in google map
Find the place on google map, and then click right button ----> Choose 'What's here'

The google map system will show your the latitude and longitude on the input box.

3. GUI tool from Open Source Project
Download the source codes from a red hat server:
>hg clone https://code.google.com/p/android-gps-emulator/

Since I am using MAC PRO, I download the directory to my local machine with these commands.
>scp -r server.com:/home/chengdu/luohua/android-gps-emulator ./

Move the directory to working place
>mv android-gps-emulator /Users/carl/work/android/UI1/

>mvn clean install
>mvn gwt:run

This tool is useful, but I notice that I may change it a little. I may rebuild the UI part.

4. Useful part to communicate with Telnet SSH Terminal in JAVA
http://javassh.org/space/start

Notice that here is one new pom.xml configuration format
    <dependency>
      <groupId>com.google.gwt.google-apis</groupId>
      <artifactId>gwt-maps</artifactId>
      <version>1.1.0</version>
      <scope>system</scope>
      <systemPath>${basedir}/lib/gwt-maps-1.1.0.jar</systemPath>
    </dependency>

We can put the jar package on the location driver.
The pom.xml works for me should be:
<dependency>
     <groupId>de.mud</groupId>
     <artifactId>jta</artifactId>
     <version>2.6</version>
</dependency>

The codes are very simple if we want to use that.
package com.sillycat.easyrestserver.application;


import java.io.IOException;
import de.mud.telnet.TelnetWrapper;


public class TelnetAppTest {


publicstaticvoid main(String[] args) throws IOException {
TelnetWrapper telnet = new TelnetWrapper();
telnet.connect("localhost", 5554);
//telnet.send("geo fix " + longitude + " " + latitude);
telnet.send("help");
telnet.disconnect();
}


}

5. It seems that the emulator do receive the push message.

References:
https://code.google.com/p/android-gps-emulator/
http://stackoverflow.com/questions/2279647/how-to-emulate-gps-location-in-the-android-emulator


猜你喜欢

转载自sillycat.iteye.com/blog/1838431
GPS