GPS模拟器上没有得到修复缘 - 机器人 [英] GPS on emulator doesn't get the geo fix - Android

查看:135
本文介绍了GPS模拟器上没有得到修复缘 - 机器人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

喜 我正在开发的Andr​​oid操作系统的应用程序,我刚开始,但我不能让模拟器上的GPS工作。 我读过你需要发送一个地缘修复到仿真器,以使GPS locationProvider在互联网上。我两者都使用DDMS和telnet尝试发送,但logcat的从来不告诉我,它recived一个新的修补程序,而我apolication仍然看到了GPS为禁用

Hi I'm developing an application for the android OS, I'm just starting, but I can't get the GPS on the emulator to work. I've read on the internet that you need to send a geo fix to the emulator in order to enable the gps locationProvider. I'm both using the DDMS and telnet to try to send it, but logcat never tells me the it recived a new fix, and my apolication still sees the gps as disabled

这是我的code

package eu.mauriziopz.gps;

import java.util.Iterator;
import java.util.List;

import android.app.Activity;
import android.content.Context;
import android.location.LocationManager;
import android.os.Bundle;
import android.util.Log;

public class ggps extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        LocationManager l =(LocationManager) getSystemService(Context.LOCATION_SERVICE);
        List<String> li = l.getAllProviders();
        for (Iterator<String> iterator = li.iterator(); iterator.hasNext();) {
	    	String string =  iterator.next();
	    	Log.d("gps", string);
    	}
        if (l.getLastKnownLocation("gps")==null)
            Log.d("gps", "null");   
    }
}

我读过的DDMS可能无法在非英语操作系统正常工作,但是远程登录应该努力!

I've read that the DDMS may not work properly on a non english OS, but telnet should work!

更新:GPS是在设置中启用

update: the gps is enabled in the settings

推荐答案

原来,自从我被开发为Android 1.5(而不是谷歌API 1.5)地图(看起来像其他功能)被禁用。 当我改变了目标平台,我的错误就消失了。

Turns out, that since I was developing for Android 1.5 (and not Google API 1.5) the map (and looks like other features) were disabled. As soon as I changed the target platform, my error disappeared.

顺便说一句感谢所有

这篇关于GPS模拟器上没有得到修复缘 - 机器人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆