kennydude / zxing-lib Goto Github PK
View Code? Open in Web Editor NEWNOT MAINTAINED -- Android ZXing Library. Embeddable in apps really easily
NOT MAINTAINED -- Android ZXing Library. Embeddable in apps really easily
A sample app for this library would be fantastic. (of course, along with the usual suspects like a maven pom.xml and the addition of gradle files).
Maybe you could re-organize the project into
/
/library
/sample
Similar to https://github.com/JakeWharton/Android-ViewPagerIndicator/. Then see how to go from there. :)
The import com.google.zxing.ResultPoint cannot be resolved
The import com.google.zxing.BarcodeFormat cannot be resolved
The import com.google.zxing.ResultPoint cannot be resolved
The import com.google.zxing.PlanarYUVLuminanceSource cannot be resolved
The import com.google.zxing.client.result cannot be resolved
The import com.google.zxing.Result cannot be resolved
……
how can i fix it ?
Hi,
Thanks for the work, it saved my days to redo the same thing.
Just saw in TODO a task of making the ViewfinderView display in the right position.
(I'm quite new to GitHub and don't know how to contribute - so I will put the code here)
CameraConfiguration.java
/**
* Reads, one time, values from the camera that are needed by the app.
*/
void initFromCameraParameters(Camera camera, int width, int height) {
Camera.Parameters parameters = camera.getParameters();
if (width == 0 || height == 0) {
WindowManager manager = (WindowManager) context
.getSystemService(Context.WINDOW_SERVICE);
Display display = manager.getDefaultDisplay();
initFromCameraParameters(camera, display.getWidth(), display.getHeight());
}
=> Allow the init method to take width,height
=> If either of them are 0 (not sure this is the best way) then use the Screen resolution.
CameraManager.java
public synchronized void openDriver(SurfaceHolder holder)
throws IOException {
Camera theCamera = camera;
if (theCamera == null) {
theCamera = new OpenCameraManager().build().open();
if (theCamera == null) {
throw new IOException();
}
camera = theCamera;
}
theCamera.setPreviewDisplay(holder);
if (!initialized) {
initialized = true;
configManager.initFromCameraParameters(theCamera,
holder.getSurfaceFrame().right,
holder.getSurfaceFrame().bottom);
=> Pass in the size of holder into init method.
So far, it works perfectly on my side.
Hope this can save some other people time.
Cheers,
Chính
Hi all,
I using it the same "read me" file, when i build it and see:
"Missing artifact android.support:compatibility-v4:jar:11"
How to fix it?
Thanks so much!
Hieu
I followed your documentation to integrate a zxing decoder into my default layout (new android 4.2 project). I built the library with maven and placed it into the lib folder of my new android project. After that i added the permissions for zxing functionality to manifest file (please add this to documentation). After starting the app on my device i get the following exception:
02-26 12:02:39.218: E/AndroidRuntime(4780): FATAL EXCEPTION: main
02-26 12:02:39.218: E/AndroidRuntime(4780): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.testapp/com.example.testapp.MainActivity}: android.view.InflateException: Binary XML file line #14: Error inflating class fragment
02-26 12:02:39.218: E/AndroidRuntime(4780): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2309)
02-26 12:02:39.218: E/AndroidRuntime(4780): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2359)
02-26 12:02:39.218: E/AndroidRuntime(4780): at android.app.ActivityThread.access$600(ActivityThread.java:153)
02-26 12:02:39.218: E/AndroidRuntime(4780): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247)
02-26 12:02:39.218: E/AndroidRuntime(4780): at android.os.Handler.dispatchMessage(Handler.java:99)
02-26 12:02:39.218: E/AndroidRuntime(4780): at android.os.Looper.loop(Looper.java:137)
02-26 12:02:39.218: E/AndroidRuntime(4780): at android.app.ActivityThread.main(ActivityThread.java:5202)
02-26 12:02:39.218: E/AndroidRuntime(4780): at java.lang.reflect.Method.invokeNative(Native Method)
02-26 12:02:39.218: E/AndroidRuntime(4780): at java.lang.reflect.Method.invoke(Method.java:511)
02-26 12:02:39.218: E/AndroidRuntime(4780): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:799)
02-26 12:02:39.218: E/AndroidRuntime(4780): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
02-26 12:02:39.218: E/AndroidRuntime(4780): at dalvik.system.NativeStart.main(Native Method)
02-26 12:02:39.218: E/AndroidRuntime(4780): Caused by: android.view.InflateException: Binary XML file line #14: Error inflating class fragment
02-26 12:02:39.218: E/AndroidRuntime(4780): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
02-26 12:02:39.218: E/AndroidRuntime(4780): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
02-26 12:02:39.218: E/AndroidRuntime(4780): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
02-26 12:02:39.218: E/AndroidRuntime(4780): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
02-26 12:02:39.218: E/AndroidRuntime(4780): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
02-26 12:02:39.218: E/AndroidRuntime(4780): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)
02-26 12:02:39.218: E/AndroidRuntime(4780): at android.app.Activity.setContentView(Activity.java:1885)
02-26 12:02:39.218: E/AndroidRuntime(4780): at com.example.testapp.MainActivity.onCreate(MainActivity.java:13)
02-26 12:02:39.218: E/AndroidRuntime(4780): at android.app.Activity.performCreate(Activity.java:5108)
02-26 12:02:39.218: E/AndroidRuntime(4780): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
02-26 12:02:39.218: E/AndroidRuntime(4780): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2263)
02-26 12:02:39.218: E/AndroidRuntime(4780): ... 11 more
02-26 12:02:39.218: E/AndroidRuntime(4780): Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f020002
02-26 12:02:39.218: E/AndroidRuntime(4780): at android.content.res.Resources.getValue(Resources.java:1034)
02-26 12:02:39.218: E/AndroidRuntime(4780): at android.content.res.Resources.loadXmlResourceParser(Resources.java:2187)
02-26 12:02:39.218: E/AndroidRuntime(4780): at android.content.res.Resources.getLayout(Resources.java:873)
02-26 12:02:39.218: E/AndroidRuntime(4780): at android.view.LayoutInflater.inflate(LayoutInflater.java:394)
02-26 12:02:39.218: E/AndroidRuntime(4780): at zxing.library.ZXingFragment.onCreateView(ZXingFragment.java:47)
02-26 12:02:39.218: E/AndroidRuntime(4780): at android.support.v4.app.Fragment.performCreateView(Fragment.java:1460)
02-26 12:02:39.218: E/AndroidRuntime(4780): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:884)
02-26 12:02:39.218: E/AndroidRuntime(4780): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1066)
02-26 12:02:39.218: E/AndroidRuntime(4780): at android.support.v4.app.FragmentManagerImpl.addFragment(FragmentManager.java:1168)
02-26 12:02:39.218: E/AndroidRuntime(4780): at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:280)
02-26 12:02:39.218: E/AndroidRuntime(4780): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:676)
02-26 12:02:39.218: E/AndroidRuntime(4780): ... 21 more
I have used http://stackoverflow.com/a/16252917/2553526 to allow portrait mode. But it takes too long(approx. 30 seconds) to scan CODE_39. Sometimes it misread the VIN number.
Can you point out my mistake? It would be so helpful.
Thanks
In class DecodeHandler, method renderCroppedGreyscaleBitmap() is undifined
Hey,
the deployment to Maven Central is described here:
https://docs.sonatype.org/display/Repository/Uploading+3rd-party+Artifacts+to+The+Central+Repository
Cheers,
Adam
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.