locationmanager

Not gettting accurate location in some android phones

允我心安 提交于 2019-12-23 22:03:58
问题 I have used below code. It work fine but in some devices like Redme,Asus not getting accurate location.It shown me too far from my current location aprox 20 km away.Not getting where is problem somebody have idea please share there ideas.Thanks in advance. public class Currentlocation extends Service implements LocationListener { private final Context mContext; // flag for GPS status boolean isGPSEnabled = false; // flag for network status boolean isNetworkEnabled = false; // flag for GPS

requestLocationUpdates minTime parameter purpose

拈花ヽ惹草 提交于 2019-12-23 13:09:17
问题 I'm creating an application (For educational purposes) which records the user's location every 30 minutes, and enables the user the view all the locations on the map. I don't want updates to be more frequent than 30 minutes, but they are. This is how I call requestLocationUpdates : locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 30 * 60 * 1000, 0, pe); Now, the documentation clearly says: The elapsed time between location updates will never be less than minTime But I did

getting geolocation after 20 seconds

ⅰ亾dé卋堺 提交于 2019-12-23 12:05:15
问题 i am making an android app using geo-location in android. i am using the location manager for getting the geo-location coordinates. locationManager.requestLocationUpdates(provider, 0, 0, this); Location location = locationManager.getLastKnownLocation(provider); and using the postDelayed() function for continuously called the getLastKnownLocation() for the geo-location. and set the interval timing 1000 (1 sec). but i get the response after 20 seconds. Can any body explain me why it happens. i

Runtime Error--java.lang.IllegalArgumentException: provider=gps

我是研究僧i 提交于 2019-12-23 08:57:33
问题 I got this error from the user logs on an android app I created. I have been unable to replicate the error thus far. Any help would be extremely appreciated. The error is: java.lang.IllegalArgumentException: provider=gps at android.os.Parcel.readException(Parcel.java:1326) at android.os.Parcel.readException(Parcel.java:1276) at android.location.ILocationManager$Stub$Proxy.requestLocationUpdates(ILocationManager.java:646) at android.location.LocationManager._requestLocationUpdates

Calculate speed between two location points in Android

做~自己de王妃 提交于 2019-12-22 18:25:04
问题 This seems like it should be simple enough, but I can't seem to get a clear example of how to calculate my speed using Android's Location Services. All I want to do is calculate my speed based on my previous and current GPS position. getSpeed() doesn't work, because it needs to be set at some point using setSpeed(). So is there any sample code out there that I can run in Eclipse against my Android emulator running a GPX file, that will show me my pace in any measure (meters, feet, miles, etc.

LocationManager.requestLocationUpdates add or update?

最后都变了- 提交于 2019-12-22 08:52:52
问题 I am looking at LocationManager to get best location for periodical reporting location. I am curious about LocationManager.requestLocationUpdates method. What would it happen if I invoke this method several times with different minTime and minDistance without calling removeUpdates? Will it add new request or just update the existing one? I am trying to test this, it is not bit easy at the moment. Your answer would be appreciated. 回答1: It will update the existing request. 回答2: You could

More than one location provider at same time

旧街凉风 提交于 2019-12-22 08:37:59
问题 I have some problems with location systems. I have a service that implements locationlistener. I want to get the best location using network when possible, gps if network is not enough accurate (accuracy greater than 300mt). The problem is this. I need location (accurate if possible, inaccuarte otherways) every 5 minutes. I start with a : LocationManager lm=(LocationManager)getApplicationContext().getSystemService(LOCATION_SERVICE); Criteria criteria = new Criteria(); criteria.setAccuracy

LocationManager requestLocationUpdates doesn't work

风流意气都作罢 提交于 2019-12-22 07:03:04
问题 I'm trying to get the current location in android using LocationManager and LocationListener as described at http://developer.android.com/guide/topics/location/obtaining-user-location.html However, onLocationChanged method of the LocationListener is never called. I've used a real android phone / also used the emulator and simulated location changed using telnet, as described in the link above. Here's my code: public class MyActivity extends Activity { @Override public void onCreate(Bundle

What's location provider “passive”? Seen on HTC Desire with Android 2.2

末鹿安然 提交于 2019-12-22 05:43:26
问题 Before I go into location based mode I check for existence of any location providers by calling List<String> android.location.LocationManager.getProviders(boolean enabledOnly) //enabledOnly = true and checking the size of the resulting list. Now I tested my App on a HTC Desire with Android 2.2. The system settings don't allow any location tracking (GPS and mobile is turned off). However, the list get returned has 1 entry, whose value is "passive". What is it? Can I work with it? The provider

Problem requesting location updates by network

强颜欢笑 提交于 2019-12-22 04:50:11
问题 I've created a Service and grabs location data about the user so I can show my users nearby places. I want this Service to track by network in addition to GPS for 2 reasons: 1) GPS may not be enabled. 2) GPS takes quite a bit of time to lock on with my test phone. When my Service executes the following line: mNETEnabled = mLocationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER); I get the following error: 11-24 14:00:41.693: ERROR/LocationManagerService(51): isProviderEnabled got