If you want a chooser, which will offer to the user all the apps with maps in his device, try this solution:
- To your manifest add
data android:scheme="geo"
, but divide intent-filters to 2 parts as you can see below:
code:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="geo" />
</intent-filter>
After this you can work with geo links.
Create an intent on button click or anywhere:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));```
This should offer to the user all his map apps (Google, Waze, Locus etc.) which he has installed. Also it shows that coordinates on the map, Waze also calculates the route automatically there.
You should also take care of the situoation if the user doesn't have any map app, create some exception.