Android two dimensional code scanning tool library.
Step 1. Dependent Manner
The First: Add the JitPack repository to your build file
(1) Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
(2) Add the dependency
dependencies {
...
compile 'com.github.Jusenr:qrcode:1.0.0'
}
The Second: Add the dependency
dependencies {
...
compile 'com.jusenr.android.library:qrcode:1.0.0'
}
Step 3. Add required permissions
<manifest
...
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.INTERNET"/>
<application
...
</application>
</manifest>
Step 4. Initialization configuration
App extends Application{
@Override
public void onCreate() {
super.onCreate();
//ZXingTools initialise.
ZXingTools.initDisplayOpinion(getApplicationContext());
}
}
Thanks to Yipianfengye provides the resources.
- Support packet conflict problem
Add Build.gradle to the project: The version is the current version of your project.
subprojects {
configurations.all {
resolutionStrategy {
force 'com.android.support:support-xx:xx.x.x'
}
}
}