Lucas Arrefelt
Lucas Arrefelt

Reputation: 3929

Google maps draw route with updating movement

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:

Upvotes: 1

Views: 1334

Answers (1)

san
san

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

Related Questions