Android sweep----Use of ZXing

Source: Internet
Author: User

1. First of all now zxing Lib

2. Integrated zxing in Android studio.

    public void Scan (view view) {        Startactivityforresult (new Intent (Mainactivity.this, Captureactivity.class), 0);    }

The above is an open sweep. Two-dimensional code generation can go to http://cli.im/

3. Create two-dimensional code

    public void make (view view) {        String input = Minput.gettext (). toString ();        if (Input.equals (")") {            toast.maketext (mainactivity.this, "Input cannot be empty", Toast.length_long). Show ();        else {            Bitmap Bitmap = Encodingutils.createqrcode (input, 500,500,                    Bitmapfactory.decoderesource ( Getresources (), R.drawable.icon));            Mivresult.setimagebitmap (bitmap);        }    }

Effects such as. Where scan corresponds to the scan method. The result after the scan is: Hello!

Make QRCode to create code for the QR code, by making. Creates a two-dimensional code for the result.

Android sweep----Use of ZXing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.