Reputation: 129
Is it possible to launch Huawei Petal Maps with navigation from point A to point B using intent just like in google maps? If yes, how?
Upvotes: 5
Views: 1896
Reputation: 2035
As it would seem from this link, India is currently not among the supported regions for Huawei Petal Map. Currently, you would not be able to use it for navigation.
Upvotes: 0
Reputation: 34037
Yes, you can use an intent to launch the Petal Map app, and then use navigation functions in the app.
mapapp://navigation?saddr=xxx&daddr=xxx&language=xx&type=xxx
mapapp://navigation?saddr=home&daddr=company&language=en&type=drive
mapapp://navigation?type=exit
"mapapp://navigation?saddr=25.102916,55.165363&daddr=25.164610000000,55.228869000000&language=en&type=drive"
String uriString = "mapapp://navigation?saddr=25.102916,55.165363&daddr=25.164610000000,55.228869000000&language=en&type=drive";
Uri content_url = Uri.parse(uriString);
Intent intent = new Intent(Intent.ACTION_VIEW, content_url);
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
}
For more details, see docs.
Upvotes: 4