Anviam

Anviam is your one-stop solution to a variety of tech services and consultation custom- suited for your business needs. From building robust applications to understanding scalability in the future, integrating efficient systems and developing modern solutions, you'll find it all with us! We're here to break down scalability for you, guide you through large-scale web application development, and equip you with practical solutions ...First is software, design decisions and IT infrastructure. The second is the scalability of teams and processes. It is difficult to build ... Developing a robust, scalable, and efficient system can be daunting . However, understanding the key concepts and components can make the ...

美國威而鋼VIAGRA

性功能障礙是男性和女性中常見的問題。它可以由生理問題和醫學狀況引起

威而鋼的效果可能因個體差異而有所不同。大樹藥局威而鋼。 預防藥:用於預防特定疾病,如疫苗或抗瘧疾藥物。

Introduction

From the last few years, we noticed that the QA/BR Code has become universal for advertisement, product information, and marketing. Simply we can say QR code is an image-like data matrix. The message/text given by QR code after scanning could be a website link or production contact information.

Below example that contains URL of Anviam Solution.

The main purpose of this blog that we should learn how to integrate QR code in your android application. Before we start this blog, don’t miss checking the https://play.google.com/store/apps/details?id=com.anviam.barcodescanner develop by our app programmer.

Steps to peruse QR/BR Code in Android

First of every, create a new project in Android studio.

Next, need to add in root Gradle file as following :

allprojects {
     repositories {
	maven { url 'https://jitpack.io' }
	}
   }

In your app module Gradle file just need to add the dependency

dependencies 
   {
     implementation 'com.github.AnviamSolutions:QR-Barcode-Scanner:1.0.1'
   }

Add camera permission to AndroidManifest.xml

<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.FLASHLIGHT"/>

Add frame layout into your activity xml

<FrameLayout
        android:id="@+id/content_frame"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
</FrameLayout>

In Your activity, initialize Scanner

 ViewGroup contentFrame = (ViewGroup) findViewById(R.id.content_frame);
 mScannerView = new AnviamScannerView(this);
 contentFrame.addView(mScannerView);

In Your activity, Declare handle result

@Override
    public void onResume() {
        super.onResume();
        if (mScannerView!=null)
            mScannerView.setResultHandler(rawResult -> {
        if (rawResult!=null && !TextUtils.isEmpty(rawResult.getText())){
            //Todo method to get can content
        }        
       });
        if (mScannerView!=null){
            mScannerView.setCameraFacing(ToggleButtonCamera.isChecked());
        }
    }

    @Override
    public void onPause() {
        super.onPause();
        if (mScannerView!=null)
            mScannerView.stopCamera();
    }

Flip Camera (Back/Front)

  mScannerView.setCameraFacing(false);

Flash Light(On/Off)

mScannerView.setFlashLight(false);

Commendation!

if you are following the same step, moreover you will strongly integrate QR-Barcode scanner in the android application. Anyway, if face any problem you can see the link https://github.com/AnviamSolutions/QR-Barcode-Scanner

Share This