Ahmed Elshaer
Ahmed Elshaer

Reputation: 384

How to make my app receive location intents like Google Maps

If you opened a link like this on your android phone Google maps will automatically open and show you the location on it's map.

I want to make my app receive intents if the user opened a link like this and also i want to get the lat,long from that link. Is this Possible ?

Upvotes: 0

Views: 62

Answers (1)

Aman Tiwari
Aman Tiwari

Reputation: 1435

Assuming the link is stored as String variable link

Now,

String[] split_link = link.split(Pattern.quote("@"));
String[] post_link = split_link[1].split(Pattern.quote(","));

double lattitude = Double.parseDouble(post_link[0]);
double longitude = Double.parseDouble(post_link[1]);

Try This!!

Upvotes: 1

Related Questions