Getting wrong gps location using locationMangager android -
i making little android app using mapview , locationmanager. locationmanager should listen location , notify if location changes on user's defined tolerance. if locationmanager notice location changing should send sms.
lm = (locationmanager) getsystemservice(context.location_service); lm.requestlocationupdates(locationmanager.gps_provider, 1000l, float.parsefloat(txttoleranz.gettext().tostring()), this); here not sure if method requestlocationupdates takes current value of textfield or given start value...?
also application should show position in mapview, position totally wrong...why? running app on real device.
double lat = location.getlatitude(); double lng = location.getlongitude(); string currentlocation = " lat: " + lat + " lng: " + lng + " tol: " + toleranz; point = new geopoint((int) lat * 1000000, (int) lng * 1000000); mapcontroller.animateto(point); mapcontroller.setzoom(15); system.out.println(currentlocation); thank help! best regards daniel
according this post geopoint may getting constructed incorrectly, cause incorrect location. locationmanager, requestlocationupdates method getting run once, meaning it's taking edittext's value when the method run, not update unless tell to. there might method inside the locationmanager class that.
edit
ignore part geopoint, upon further reading correct in multiplying long/lat 1000000
Comments
Post a Comment