AndrewJBateman / ionic-angular-qrreader

:clipboard: Ionic app to read bar codes. Another excellent tutorial from Simon Grimm at the Ionic Academy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

⚑ Ionic Angular QR Bar Code Reader

GitHub repo size GitHub pull requests GitHub Repo stars GitHub last commit

πŸ“„ Table of contents

πŸ“š General info

  • Generates QR bar codes from input text (a web address in this case) as the text is typed.
  • Note: ngx-qrcode2 has been deprecated. @techiediaries/ngx-qrcode should be used instead.

πŸ“· Screenshots

image

πŸ“Ά Technologies

πŸ’Ύ Setup

  • Run npm i to install dependencies
  • To start the server on localhost://8100 type: 'ionic serve'

πŸ’» Code Examples

  • function to download bar code data.
 downloadQR() {
    const canvas = document.querySelector('canvas') as HTMLCanvasElement;
    const imageData = canvas.toDataURL('image/jpeg').toString();
    console.log('data: ', imageData);

    let data = imageData.split(',')[1];

    this.base64ToGallery.base64ToGallery(data,
      { prefix: '_img', mediaScanner: true })
      .then(async res => {
        let toast = await this.toastCtrl.create({
          header: 'QR code saved to Photolibrary'
        });
        toast.present();
    }, err => console.log('err: ', err))
  };

πŸ†’ Features

  • Uses phone camera to scan a bar code.
  • saves bar code images to phone photo library.

πŸ“‹ Status & To-do list

  • Status: Compiles in browser but needs to be tested on a mobile simulator
  • To-do: Test in Android Studio

πŸ‘ Inspiration

πŸ“ License

  • This project is licensed under the terms of the MIT license.

βœ‰οΈ Contact

About

:clipboard: Ionic app to read bar codes. Another excellent tutorial from Simon Grimm at the Ionic Academy

License:MIT License


Languages

Language:TypeScript 60.8%Language:SCSS 18.9%Language:HTML 11.1%Language:JavaScript 9.2%