Im writing a custom program that uses a custom gps to track the users current position. I have a service running in the background that is constantly polling the GPS sensor for the current position. I then start a new activity with the following code:
final Intent intent = new Intent(Intent.ACTION_VIEW,
Uri.parse(
"http://maps.google.com/maps?" +
"saddr="+lngstart+","+latstart+"&daddr="+lngend+","+latend));
intent.setClassName(
"com.google.android.apps.maps",
"com.google.android.maps.MapsActivity");
startActivity(intent);
The service running in the backgroud is constantly calculating new geopoints for the current location of the user. The google maps comes up as intented, and has the data I fed it initially, however Id like to constantly feed it updated information on the users current position.
How do I feed this updated information about the users current location to the map activity I've started?
How do I disable the map activity from trying to use any other sensor (like cell phone towers, or using built in GPS, remember Im using a custom gps setup)?
How do I ping the running activity to get the list information containing the longitude and latitude coords of the "legs" along the route that it plots?
Finally is there a way to add a button to the running activity, that when pressed will pause it, and start a new activity?
Thanks :)