Skip to content
No description, website, or topics provided.
C Java C++ CMake
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Application
gradle/wrapper
.gitignore
LICENSE
README.md
build.gradle
gradlew
gradlew.bat
settings.gradle

README.md

Android Camera2 Barcode NDK Sample

The sample demonstrates how to optimize the barcode reader demo by using C++ code.

Usage

  1. Get a valid trial license of Dynamsoft Barcode SDK.

  2. Download Dynamsoft Barcode Reader for Android.

  3. Extract files from DynamsoftBarcodeReaderAndroid.aar using 7-Zip, and copy a shared library DynamsoftBarcodeReaderAndroid.aar\jni\<ARCH>\libDynamsoftBarcodeReaderAndroid.so to Application/src/main/cpp.

    Dynamsoft Barcode Reader shared libraries

    In this project, armeabi-v7a is used. If you use other ABIs, don't forget to update the corresponding info in build.gradle.

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 27
        ndk {
            abiFilters 'armeabi-v7a'
        }
        externalNativeBuild {
            cmake {
                arguments '-DANDROID_STL=c++_static', '-DANDROID_ABI=armeabi-v7a'
            }
        }
    }
    
  4. Open the project in Android Studio.

  5. Set the license in Camera2BasicFragment.java:

    hBarcode = createBarcodeReader("LICENSE-KEY");
  6. Build and run the app:

    Android Camera2 Barcode

Blog

Using Android NDK to Optimize Barcode Reading Performance

You can’t perform that action at this time.