Snapshot của yanzhenjie/android-zbar-sdk: 311★ · C. :link: android-zbar-sdk, provide jni source, so file and jar file used alone, gradle/maven remote dependencies.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Zbar and libiconv are based on LGPL-2.1 open source, based on LGPL-2.1, I organized the Android platform for the ZBar, to facilitate the use of developers.
中文文档
Most Android developers are relatively unfamiliar to jni, especially in the compilation of Zbar need to compile libiconv, so I have sorted out the full jni code.
I have the Zbar available, the following you can choose to use:
can be directly ndk-build compiled JNI source
Jar packages and so files that can be used alone
can be remotely dependent on the native Zbar
Encapsulated Zbar can directly scan the camera
I used the libiconv is released at 2017-02-02 the latest version 1.15.
Note: The use of remote dependencies will load all the files so the platform, if you just want to rely on some of these platforms, then you need to add the compilation configuration:
For example, you only need armeabi and armeabi-v7a:
ndk {
abiFilters 'armeabi', 'armeabi-v7a'
}
Zbar's core recognition barcode/QRCode code is as follows.
byte[] imageData = ...;
Image barcode = new Image(size.width, size.height, "Y800");
barcode.setData(imageData);
// Set the image capture area.
// barcode.setCrop(startX, startY, width, height);
String qrCodeString = null;
int result = mImageScanner.scanImage(barcode);
if (result != 0) {
SymbolSet symSet = mImageScanner.getResults();
for (Symbol sym : symSet)
qrCodeString = sym.getData();
}
if (!TextUtils.isEmpty(resultStr)) {
// Successfully.
}
Not only that, you can also use the camera to combine this code to identify barcode/QRCode.
There are examples of camera scans in Demo.
Package of Camera and ZBar
If you are not familiar with the camera, you can also use my camera and ZBar package, will be very simple to use the camera to complete the two-dimensional code scan.
private CameraPreview mPreview;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_scan);
mPreview = (CameraPreview) findViewById(R.id.capture_preview);
mPreview.setScanCallback(callback);
}
/**
* Start camera.
*/
private void startScan() {
mPreview.start();
}
/**
* Stop camera.
*/
private void stopScan() {
mPreview.stop();
}
/**
* Result.
*/
private ScanCallback callback = new ScanCallback() {
@Override
public void onScanResult(String content) {
// Successfully.
}
};
@Override
protected void onPause() {
// Must be called here, otherwise the camera should not be released properly.
stopScan();
super.onPause();
}
The actual development you need to pay attention to the RunTime Permission, the camera is occupied and so on.
For RunTime-Permission, I recommend you use AndPermission:
https://github.com/yanzhenjie/AndPermission
Such as whether the camera started successfully:
/**
* Start camera.
*/
private void startScan() {
if(mPreview.start()) {
// The camera starts successfully and you can start a scan animation.
} else {
// The camera starts failing and you can tell the user.
}
}
For more examples please refer to sample.
Proguard-rules
If you already have this rule, then you do not have to add.
-keepclassmembers class * {
native <methods>;
}
-keepclasseswithmembernames class * {
native <methods>;
}
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/yanzhenjie/android-zbar-sdk là nguồn chính thức.
yanzhenjie/android-zbar-sdk có bao nhiêu sao?
yanzhenjie/android-zbar-sdk có 311 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/yanzhenjie/android-zbar-sdk. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
yanzhenjie/android-zbar-sdk có phải mã nguồn mở không?
Có — yanzhenjie/android-zbar-sdk phát hành theo license LGPL-2.1, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/yanzhenjie/android-zbar-sdk.
yanzhenjie/android-zbar-sdk còn đang phát triển không?
Commit gần nhất trên yanzhenjie/android-zbar-sdk là 9.4 năm trước (theo timestamp GitHub). Repo có 58 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
yanzhenjie/android-zbar-sdk là gì?
yanzhenjie/android-zbar-sdk (yanzhenjie/android-zbar-sdk) là dự án C trên GitHub. Theo mô tả gốc: :link: android-zbar-sdk, provide jni source, so file and jar file used alone, gradle/maven remote dependencies.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về android-zbar-sdk?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về android-zbar-sdk.