Mobile platform with two-dimensional code to deal with, about the two-dimensional code, there is a good article recommended
At present I want to implement a function, scan QR code implementation, when using the scan Code app to go to the software market download, when the installation of the specified app automatically login, think of a scenario:
To download the APK link as a URL and follow the identity key used to log in,
However, such a string is very long ah!
We know that the QR code can only be encoded for text, and if the longer the string, the larger it may be, of course, scaling may also cause the scan to fall in the test rate.
What do we do?
The idea of a short domain name scheme for Weibo, often seen by t.cn, is only allowed in Weibo internal use, and there is no open API.
This time, or Baidu and Google solve the problem
http://goo.gl/
http://dwz.cn/
Among them, Goo.gl claims the fastest short domain name service, unfortunately for some reason, you understand. Even directly on-line QR code generation function, has saved the backstage thing.
OK, back to the point, Baidu can solve the problem, through the post interface to the specified URL can be longurl and tinyurl conversion, access to short URL directly automatically jump
Use the Universal Curl under Linux
" url=http://www.baidu.com/s?wd=%e7%9f%ad%e5%9f%9f%e5%90%8d%e6%9c%8d%e5%8a%a1&rsv_spt=1&issp=1&f =8&rsv_bp=0&rsv_idx=2&ie=utf-8&tn=baiduhome_pg" dwz.cn/create.php
Response:
{"TinyURL": "http:\/\/dwz.cn\/wp01k", "status": 0, "Longurl": "http://www.baidu.com/s?wd= short domain Name Service", "err_msg": ""}
Then use the short domain name to get the long address
" tinyurl=http://dwz.cn/wp01k " dwz.cn/query.php
Response:
{"Status": 0, "Longurl": "http://www.baidu.com/s?wd= short domain Name Service"}
If direct access will jump
Http://dwz.cn/wP01K
Long long strings generate two-dimensional code with public short URL service