Unfortunately, you cannot use a universal URI to represent two geo-points.
You can specify one point and pass it to the selector, for example:
String uri = String.format(Locale.ENGLISH, "geo:%f,%f", lat, lng); Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri)); context.startActivity(Intent.createChooser(intent, "Select your maps app"));
However, to get directions, unfortunately, you will need to use:
Single URL:
The best choice, in my opinion. You must use one map provider and use its URL as a URI. Thus, your directions are consistent, compatible with several devices and, most importantly, easy to use / receive.
Plain old urls:
You can use different URLs for different map providers.
For example, Citymapper:
https://citymapper.com/london/superrouter?start=LAT_START,LNG_START&end=LAT_END,LNG_END
However, others are not so friendly, for example. Yandex:
http://maps.yandex.com/?rtext=59.326460%2C12.699889~57.386826%2C12.348327&sll=12.941588%2C56.517713&sspn=34.716797%2C12.029728&rtm=atm&source=route&ll=12.941588%2C56.517713&spn=34.716797%2C12.029728&z=6&l=map
Perhaps you can decode this url yourself :)
Integrated Maps API
Integration, for example. Google Maps API into your application and show directions from there. You will need to get the instructions in Latin dot format from the Directions API in JSON format. You will then use these points to draw the polyline.