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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值