QR Code - Tracking service, News, Videos, Forum, Focus groups and more ..

The first and only all in one dedicated QR code website on the net. Find out everything you need to know about QR codes

  • 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();

}

 

Share the love ..

Normal Login

My QRMe code stats

This is our QRMe code. Register for yours
Scanned 2336 times.
Last 6 months

Customisable trackable stuff

QR code T-shirt

Find out more about QRMe

Buy a QR code report

Latest group bulletins

Understand a QR code

Understand a QR code
JoomlaWatch Stats 1.2.7 by Matej Koval

Countries

23.6%UNITED STATES UNITED STATES
10.8%UNITED KINGDOM UNITED KINGDOM
5.9%GERMANY GERMANY
4.6%ITALY ITALY
4.6%NETHERLANDS NETHERLANDS
4.5%AUSTRALIA AUSTRALIA
3.4%THAILAND THAILAND
3.1%BRAZIL BRAZIL
2.8%FRANCE FRANCE
2.4%SPAIN SPAIN
2.4%POLAND POLAND
2.1%CANADA CANADA

Visitors

Today:  54
Yesterday:  1008
This week:  3921
Last week:  6112
This month:  2082
Last month:  25505
Total:  236790