Reputation: 3929
Just finished my application that shows a route between two given positions with a MapView. Nothing fancy, I've just started with google maps. After some thoughts I came across that it would be nice if it was redrawn on movement like a real GPS-service.
So my questions are:
How hard is it to implement a GPS on your own? I understand that I can make one now by continuously fecthing a kml file every once in a while. But how efficient is this really considering batteryusage and CPU? Google maps lets you request 2500times/day, does each of these updates counts as one?
Can you start the Google maps application with given start and end position? This might be a simpler solution for me then..
Upvotes: 1
Views: 1334
Reputation: 1835
Whay don't you open google maps with intent giving your starting point and end point.
Intent navigation = new Intent(Intent.ACTION_VIEW, Uri
.parse("http://maps.google.com/maps?saddr="
+ Constants.latitude + ","
+ Constants.longitude + "&daddr="
+ latitude + "," + longitude));
startActivity(navigation);
This opens any maps application. Means a browser or google maps application. If you just want google maps and get rid of the dialog you can give the intent a hint as to which package you want to use.
Before the startActivity()
add this:
intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity");
Upvotes: 4