QR Code generator, Forum and more

Create a QR code you can track. The first and only all in one dedicated QR code website on the net.

  • Increase font size
  • Default font size
  • Decrease font size
Home QR Code News + Newsflash QR Code android code

QR Code android code

androidcode

awalkingcity.com recently blogged about creating QR codes on the new T Mobile G1 android plprogratform. The android code uses Googles API to generate the actual QR code. To get started developing your own QR code applications on androd devices just download the android sdk - software development kit from Google. Get you QR Code reader for android here http://www.qrme.co.uk/qr-code-resources/qr-code-readers.html

Original blog post http://awalkingcity.com/blog/?cat=5 .

There is also an excellent article at http://awalkingcity.com/blog/?p=116 and a complete android api reference guide at code.google.com.


Generate a QR code

encodeButton.setOnClickListener(new OnClickListener(){

public void onClick(View arg0) {

img.setImageBitmap(QR.this.encodeString(edit.getText().toString()));

}

 

});

private Bitmap encodeString(String input) {

URL aURL;

try {

aURL = new URL("http://chart.apis.google.com/chart?chs=300x300&cht=qr&choe=UTF- 8chl="+URLEncoder.encode(input, "UTF-8"));

URLConnection conn = aURL.openConnection();

conn.connect();

InputStream is = conn.getInputStream();

BufferedInputStream bis = new BufferedInputStream(is);

Bitmap bm = BitmapFactory.decodeStream(bis);

bis.close();

is.close();

return bm;

} catch (MalformedURLException e) {

e.printStackTrace();

} catch (IOException e) {

e.printStackTrace();

}

return null;

}

Decode a QR Code

decodeButton.setOnClickListener(new OnClickListener(){

public void onClick(View arg0) {

try {

tv.setText(((QR.this.decode(img.getDrawingCache()))));

} catch (ReaderException e) {

e.printStackTrace();

}

}

});

 

private String decode(Bitmap bm) throws ReaderException {

QRCodeReader reader = new QRCodeReader();

Result r = reader.decode( new RGBMonochromeBitmapSource(bm));

return r.getText();

}

Add a comment
 



Login

Register and login to QRMe first before linking to your Facebook account using this button



My QRMe code stats

This is our QRMe code. Register for yours
Scanned 7366 times.

Last 6 months scans

JoomlaWatch Stats 1.2.7 by Matej Koval

Visitors

Today:  108
Yesterday:  1136
This week:  5888
Last week:  7633
This month:  3605
Last month:  30638
Total:  340751



Understand a QR code

Understand a QR code

Grab a QRazy about QR Codes Tshirt