2011-11-26 76 views
1

有誰知道如何使用Java程序生成QR碼?我需要編寫一個應用程序來爲Android設備生成QR碼。謝謝!使用Java在Android中生成QR碼

+0

不,沒有JAVA。這是Java。 –

+1

好的朋友。謝謝! – Senps

+0

沒問題。但是如果我自己改變它,下次你會再次像JAVA那樣寫它。告訴人們工作得更好。 :) –

回答

4

嘗試ZebraCrossing(斑馬線),它看起來不錯:http://code.google.com/p/zxing/

String contents = "Code"; 
BarCodeFormat barcodeFormat = BarCodeFormat.QR_CODE; 

int width = 300; 
int height = 300; 

MultiFormatWriter barcodeWriter = new MultiFormatWriter(); 
BitMatrix matrix = barcodeWriter.encode(contents, barcodeFormat, width, height); 
BufferedImage qrCodeImg = MatrixToImageWriter.toBufferedImage(matrix); 
+0

謝謝。我會看看。 :) – Senps

+1

BufferedImage似乎在Android SDK中不可用。 –