I believe you will get actual updates from GPS no faster than every second.
Also, are you verifying that the new position is better than the old, in terms of accuracy? And, GPS is not terribly accurate, probably worse than +/- 25m so it will jump around. On Apr 26, 2012 9:31 AM, "Maneesh Janyavula" <[email protected]> wrote: > I am developing an Android app, which routes the user from current > location to a Parking spot(some random location) as the user moves on > the road. I am using GPS_PROVIDER to get the current location. > > locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, > 500,0,locationListener); > > I am placing marker on the current location by using- > > public void addMarkers() > { > //Adding Current location marker > Drawable drawable_src = > this.getResources().getDrawable(R.drawable.mapmarker_pink); > itemizedoverlay_src = new HelloItemizedOverlay(drawable_src, > this); > GeoPoint src_point = new GeoPoint((int) (src_lat * 1E6), > (int) (src_long * 1E6)); > overlayitem_src = new OverlayItem(src_point, "Current > Location",ConvertPointToLocation(src_point)); > itemizedoverlay_src.addOverlay(overlayitem_src); > mapOverlays.add(itemizedoverlay_src); > } > > I am using locationManager.getLastKnownLocation to intially get the > location, and then later OnLocationChanged method is called, where in > the location is updated, the previous marker is removed and new marked > is added to the current location- > > private void updateMarker(GeoPoint point) { > > //Removing previous marker > itemizedoverlay_src.removeOverlay(overlayitem_src); > mapOverlays.remove(itemizedoverlay_src); > > //Adding Current location marker > overlayitem_src = new OverlayItem(point, "Current > Location",ConvertPointToLocation(point)); > itemizedoverlay_src.addOverlay(overlayitem_src); > mapOverlays.add(itemizedoverlay_src); > > } > > I am doing, this so that it appears as though the marker moves > continuously as the user's location is changed continuously. I am > requesting the for updates every 500ms. But when I tested the app on > the road network, The app turned out to be very slow, and gets hung > frequently. I am not sure, why this happens?? Is there something wrong > with my code? Is there a better efficient solution to this? > > Please help me out > > Thanks- Maneesh > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

