是否有可能在诺基亚x上获得用户的位置而无需包含HERE地图sdk?

时间:2014-06-19 10:28:23

标签: locationmanager here-api nokiax

我需要在应用内检测用户的粗略位置(仅限城市和国家/地区)。我有使用android.location.LocationManager类的普通android代码。但当我移植到NokiaX时,该应用程序不会报告任何位置。 HERE sdk只讨论使用HERE地图(我不需要)

1 个答案:

答案 0 :(得分:0)

我刚尝试了以下权限:

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>

并使用代码:

LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this);

在我的阳台上获得第一个位置花了不到10秒钟,然后它每秒都会获得更新。因此,我不会在那里看到问题。