0

This is a query for probable direction or suggestion on how to solve a problem rather than a specific question. Here's my scenario, In an android app user needs to share his current location with friends via sms/email. I can do this by sending sms/email via intent and passing lat/lng values in message string. But the problem is on the receiver's device when user opens this sms/email and taps on the location a chooser will pop up with a option to open this location with my app or the maps app.

Any suggestion or advice is highly appreciated.

Mehedi
  • 394
  • 1
  • 3
  • 19

1 Answers1

0

Achieved this using Intent filters.

Mehedi
  • 394
  • 1
  • 3
  • 19
  • @mededi can u pleas explain – Abhishek Mar 14 '16 at 05:34
  • @Abhishek You ca achieve this in 2 ways 1) using `Intent` filters for a custom action 2) using custom `URI` scheme. Using a custom `URI` scheme is frowned upon and I also think should not be used. But you can use the 'http' `URI` scheme with an `Intent` filter, that way if you share a URL like `http://myappsite.io/share?entry_id = "some_id"`, and user taps on it, your `Activity` with the matching `Intent` filter will be launched. See this [SO question](http://stackoverflow.com/questions/3469908/make-a-link-in-the-android-browser-start-up-my-app) for related code. – Mehedi Mar 15 '16 at 07:08
  • @Mehedin thanks , please have a look http://stackoverflow.com/questions/35864253/how-do-i-send-my-location-via-url-in-sms – Abhishek Mar 16 '16 at 05:14