开发者

QRCODE image to display on the android phone screen

I want to gen开发者_如何学JAVAerate a QR code for a string. In the cases I find in the forum, The generated QR is generating an image. I want the QR code to display on the screen with out having to save a copy of it.


Of course it is possible to generate a QR code image at runtime. For instance, the website "Wolfram Alpha" does it. Try this URL:

http://www.wolframalpha.com/input/?i=qr+code+www.stackexchange.com

So if you can call that website and capture its output, then you can display the QR code in your app.

Another potential source could be http://zxing.appspot.com/generator/.


The zxing project has code to encode QR codes. You can use and embed this code, as long as you follow the Apache License. Barcode Scanner displays QR codes on screen; you can look at its source in the same project to see how to do that.


One of the easiest way to generate QR code is to use Google Charts API. Here is page with relevant documentation - http://code.google.com/apis/chart/infographics/docs/qr_codes.html

Here is quick example of QR code for "Hello world", 150x150 pixels: https://chart.googleapis.com/chartchs=150x150&cht=qr&chl=Hello%20world&choe=UTF-8

It works the best if it is used in web app (inside browser). Otherwise you have to load the image over the web connection.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜