0

How to programmatically share GPS location from Android application in Telegram?

Geo-coordinates do not have to be currently geolocation. I’m interested in the fact of the ability to transfer coordinates (latitude and longitude) from my application to the messenger as in the photo enter image description here

Katyrin Roman
  • 42
  • 1
  • 3
  • 10

1 Answers1

0

this is how to share text to other apps :

Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "Hello!");

// (Optional) Here we're setting the title of the content
sendIntent.putExtra(Intent.EXTRA_TITLE, "Send message");

// (Optional) Here we're passing a content URI to an image to be displayed
sendIntent.setData(contentUri);
sendIntent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);

// Show the Sharesheet
startActivity(Intent.createChooser(sendIntent, null));

instead of "hellow" you can use coordinate like this :

https://www.google.com/maps/@[lat],[long],[zoom]z

example

https://www.google.com/maps/@14.878651,50.2937643,4z

also if you want only send to telegram you can use this

Alireza Sharifi
  • 1,127
  • 1
  • 9
  • 18