Jim31837 Jim31837 - 7 months ago 74
Android Question

how do I add a hyperlink in sms message in android phone?

I want to send a sms message with the message body like "where am I?"
when I click "where am I?", it will take me to the google map website with my location.
My question is that how can I add this hyperlink in the "where am I?" message text?
Is there any example that I can study?


SMSes are text-only, and they only allow 160 characters. What you are suggesting would include 'where am I?' in the 160 characters but also somehow include a very long web address.

The first thing you might want to do is make use of some sort of URL-shortening service. I don't have one that I can personally recommend but there are Django apps, among other things, and online services that you can hook into with an API (like bit.ly). That will get you a unique link to easily fit in the available characters of an SMS.

Most smart phones will parse a link and make it 'clickable', even if it is in an SMS. So, for example, you could make the text read:

Where am I? www.linkgoesh.ere/somehash 

The user should be able to click on the link and visit your website. It's not as elegant as what you're suggesting, but SMS is a (necessarily) limited format.