android-location

route finding between two designation on maps in android?

i want to just find a shortest path between the location on map. we have to pass the location's geopoint then click the button to get direction. it will show the shortest path like a blue line. how to do this? i search about this. many of them import a package com.google.googlenav.*;. where i have to get this? Any Idea???? Edit:got down...

What is the best way to wait for a GPS location fix?

Hi, Using my Android application, when a user does a certain action, a background service is started that fetches the current GPS location and saves it in a database in addition of doing some other stuff. In that service, I use the requestLocationUpdates() from the LocationManager class and wait until the onLocationChanged() of my Locat...

Enable GPS and network location programmatically on rooted phone?

I'd like to write a simple widget that toggles GPS and network location on and off. I've read that it's not possible to do that normally, but presumably on a rooted phone it must be doable. Does anyone know what the code would be? (I only need the code to toggle the location providers, I know how to make the widget.) It doesn't matter th...

How to make Android Service run even when the device is not awake?

hi my application objective is to save location updates every ,let say, 20 minuets . I used service and it worked fine , but when i lock the screen or it is locked automatically the service stop running . when i unlock it , service runs again. highlight on my code: Service() onCreat(){ call timer(); } timer(){ code } How ...

Determine Android phone's proximity to known point while conserving power

I am trying to determine if an Android user has had a close proximity to a list of predetermined locations. I'd like to do this with the least amount of drain on the phone's battery. The two mechanisms I see for accomplishing this are proximity alerts and requesting location updates. What are the pros and cons of the two methods? Will on...

Android : LocationManager dynamically adjust minTime/minDistance thresholds

This is the way I listen for GPS location updates (using LocationManager and a LocationListener): locationManager = (LocationManager) getSystemService(LOCATION_SERVICE); listener = new MyLocationistener(); // LocationListener locationManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, 30000, // milliseconds (m...

Android: How often does getLastKnownLocation(LocationManager.NETWORK_PROVIDER) return null in real life?

Do the Android users have the chance to reset the NetworkProvider, so that the location will be null? I came up with the idea, that its only possible to have that location null, after starting the device the very first time. But also than google will check the location right away for my opinion. Sure, I'm implementing a default locatio...

android: efficient way to get an approx location

i have a widget that needs an approximate location. this is what i'm doing ... in onUpdate(), get the best provider, set a location listener on it, and return in location listener's onLocationChanged(), update the remote views based on the location, and unregister the listener this works, and on the emulator things wait until i send ...