android qr scan

이진아·2020년 11월 4일
0

Android &  flutter

목록 보기
8/11

1. implement

2. MainActivity

ii.setCaptureAtivity(activity.class);

1) activity.java

class ... implements DecoratedBarcodeView.TorchListener{
private CaptureManager m_captureManager;
DecoratedBarcodeView decoratedBarcodeView = findViewById(R.id.qr_reader_view);
decoratedBarcodeView.setTorchListener(this);
m_captureManager = new CaptureManager(this, decoratedBarcodeView);
m_captureManager.initializeFromIntent(getIntent(), savedInstanceState);
m_captureManager.decode();

2) activity.xml

 <com.journeyapps.barcodescanner.DecoratedBarcodeView
        android:id="@+id/qr_reader_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    </com.journeyapps.barcodescanner.DecoratedBarcodeView>

0개의 댓글