【发布时间】:2012-03-09 15:31:00
【问题描述】:
我正在使用 vista 并且无法进行“地理修复”,因为 telnet 不可用。 我禁用了防火墙,我正在使用 Zoc/Pro 应用程序,这是一个远程登录应用程序进行连接 到模拟器。我无法使用 localhost:5554 连接,而是使用 127.0.0.1:5554 但是连接后我做了 -> geo fix 47.33 -52.74 ,我收到了一条消息OK。 但是如果我输入下面的代码 n chk 它显示 0.0 0.0
locMgr = (LocationManager)context.getSystemService(Context.LOCATION_SERVICE);
List<String> providers = locMgr.getProviders(true);
System.out.println("providers " + providers);
Location lc = null;
for(int i=providers.size()-1 ; i>=0 ; i--) {
lc = locMgr.getLastKnownLocation(providers.get(i));
if(lc==null)
break;
}
double[] gpsCord = new double[2];
if(lc!=null) {
gpsCord[0] = lc.getLatitude();
gpsCord[1] = lc.getLongitude();
}
System.out.println("Latitude = " + gpsCord[0] + " " + "Longitude = " + gpsCord[1]); //Prints 0.0 0.0
我如何获得位置??
【问题讨论】:
标签: android