Emulator(1)GCM Account and GPS
Emulator(1)GCMAccountandGPS
1.UpdatetheGPSinformationonEmulator
>telnetlocalhost5554
>geofix-97.83714230.233014
OrIcanopentheDDMS--->EmulatorControltochangethat.
Itseemsthatthecommandisbetter.
2.Howtofindthelatitudeandlongitudeingooglemap
Findtheplaceongooglemap,andthenclickrightbutton---->Choose'What'shere'
Thegooglemapsystemwillshowyourthelatitudeandlongitudeontheinputbox.
3.GUItoolfromOpenSourceProject
Downloadthesourcecodesfromaredhatserver:
>hgclonehttps://code.google.com/p/android-gps-emulator/
SinceIamusingMACPRO,Idownloadthedirectorytomylocalmachinewiththesecommands.
>scp-rserver.com:/home/chengdu/luohua/android-gps-emulator./
Movethedirectorytoworkingplace
>mvandroid-gps-emulator/Users/carl/work/android/UI1/
>mvncleaninstall
>mvngwt:run
Thistoolisuseful,butInoticethatImaychangeitalittle.ImayrebuildtheUIpart.
4.UsefulparttocommunicatewithTelnetSSHTerminalinJAVA
http://javassh.org/space/start
Noticethathereisonenewpom.xmlconfigurationformat
<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>
Wecanputthejarpackageonthelocationdriver.
Thepom.xmlworksformeshouldbe:
<dependency>
<groupId>de.mud</groupId>
<artifactId>jta</artifactId>
<version>2.6</version>
</dependency>
Thecodesareverysimpleifwewanttousethat.
packagecom.sillycat.easyrestserver.application;
importjava.io.IOException;
importde.mud.telnet.TelnetWrapper;
publicclassTelnetAppTest{
publicstaticvoidmain(String[]args)throwsIOException{
TelnetWrappertelnet=newTelnetWrapper();
telnet.connect("localhost",5554);
//telnet.send("geofix"+longitude+""+latitude);
telnet.send("help");
telnet.disconnect();
}
}
5.Itseemsthattheemulatordoreceivethepushmessage.
References:
https://code.google.com/p/android-gps-emulator/
http://stackoverflow.com/questions/2279647/how-to-emulate-gps-location-in-the-android-emulator