且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Android手机中的短信中添加超链接?

更新时间:2023-12-01 14:21:34

短信是纯文字的,只允许160个字符。您建议的内容包括160个字符中的我在哪里?,但也包含一个非常长的网址。

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.

您可能想要做的第一件事就是利用某种URL缩短服务。我没有一个我可以亲自推荐的应用程序,但有一些Django应用程序,以及可以通过API(如bit.ly)挂钩的在线服务。这将为您提供一个独特的链接,可以轻松适应短信的可用字符。

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 

用户应该可以点击链接并访问您的网站。它并不像你所建议的那样优雅,但SMS是一种(必然)限制格式。

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.