QR Code tracking service, news, videos, forum and focus groups

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

E-mail

androidcode

awalkingcity.com recently blogged about creating QR codes on the new T Mobile G1 android platform. 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 . 

To see the sample code click read more. There is also an excellent article at http://awalkingcity.com/blog/?p=116 and a complete android api reference guide at code.google.com.

See our android videos here http://www.qrme.co.uk/android-videos.html

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

}

 

Register / Login



Login using Facebook

Customisable trackable stuff

QR code T-shirt

My QRMe code stats

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

Find out more about QRMe

Advertisements

Complete QR code management

Latest group bulletins

Understand a QR code

Understand a QR code
JoomlaWatch Stats 1.2.7 by Matej Koval

Countries

26.3%UNITED STATES UNITED STATES
11.5%UNITED KINGDOM UNITED KINGDOM
6%GERMANY GERMANY
4.6%AUSTRALIA AUSTRALIA
4.5%BRAZIL BRAZIL
3.6%NETHERLANDS NETHERLANDS
3.5%ITALY ITALY
2.9%SPAIN SPAIN
2.8%POLAND POLAND
2.7%FRANCE FRANCE
2.4%CZECH REPUBLIC CZECH REPUBLIC
1.9%CANADA CANADA

Visitors

This month:  9530
Last month:  18759