|
GettingStarted
How to start developing with zxing
Getting StartedPlease also read CodingStyle if you'd like to contribute to the project. You can also see DeveloperNotes for more information. DownloadGrab the latest distribution. Or, retrieve the latest source code from our Subversion repository. BuildYou will find the code lives in several subdirectories, corresponding to the various subcomponents, like "core" and "javase". Within each, there is a build.xml Ant build file which controls building of that component. If Apache's ant tool is already present on your system, simply type "ant" to build that component. See http://ant.apache.org for details on how to obtain this free, standard build tool for Java. To build everything, simply use the build.xml file found in the top-level directory, above all components. Yes, just type ant there. RunThe quickest way to run the code is to run the "javase" component's com.google.zxing.client.j2se.CommandLineRunner class against a URL. As above, first build core and javase: cd core ant cd ../javase ant After building, simply run this class with java: cd .. java -cp javase/javase.jar:core/core.jar com.google.zxing.client.j2se.CommandLineRunner [URL] Windows users take note; path syntax is different on Windows. Here and elsewhere you will need to use ';' rather than ':' to separate classpath elements, and likely need to use the '\' path separator. So that last command should be: java -cp javase\javase.jar;core\core.jar com.google.zxing.client.j2se.CommandLineRunner [URL] Run on your phoneYou can build the J2ME client too.
cd core ant cd ../javame ant Run on Android
cd core ant clean build-no-debug cd ../android ant adb install bin/BarcodeScanner-debug.apk |
Before you post a message!
Thanks to everyone who has posted helpful comments here. Many people are reporting issues here, which should be tracked as bugs or enhancement requests on the Issues tab above: http://code.google.com/p/zxing/issues/list
General quesstions can be more easily discussed on our Groups site -- you will get more responses: http://groups.google.com/group/zxing/
I have archived all previous comments here at: http://groups.google.com/group/zxing/browse_thread/thread/9d60b311866a2d47#13ba7b2fedd93369
Can we see some android-specific "Getting Started" comments? Thanks!
Will do. It's about the same. At the moment we only have a build available that works with the M3 SDK, not M5 or later. So you can't run this on the emulator at the moment (but the additional changes needed for M5 are small). But even if you could run it, you wouldn't have a video feed to decode (though there are workarounds for that even...) For the moment, for testing reasons, it's convenient for us to stick on M3 -- while it's of little use to anyone else. But yeah we need to move forward soon in any event.
Okay. It's not a huge hurry -- the first gphones are still a ways off (I think) and I still have plenty of other things to work on.
Oh, and great work so far. I actually was able to port everything from M3 to M5 myself except for a couple of important things that...coincidentally were essential to the library's functioning. Some stuff related to bitmaps, I believe.
Can you file an issue or start a thread at http://groups.google.com/group/zxing/ describing the issue? I got it compiling on M5 but have not verified it works completely, since there's no real video feed available to the emulator.
Note that building core (i.e. not only the J2ME version) requires WTK.
For Mac users you can use some of the information at http://javablog.co.uk/2008/01/17/j2me-development-on-os-x-revisited/ to put together a semi working WTK out of the Linux WTK download and the preverify binary from the phoneme project. It seems to be enough to compile the project at least.
Does not work with the last android sdk android-sdk-windows-1.0_r1 since packages are different from android-sdk-windows-0.9_beta
With the latest Android emulator, I can not upload test image into the emulator:
adb push c:barcode.jpg /tmp/barcode.jpg failed to copy 'c:barcode.jpg' to '/tmp/barcode.jpg': No such file or directory
Also can not create /tmp directory within the device: adb shell mkdir /tmp mkdir failed for /tmp, Read-only file system
Looks like you have a typo in your command line? "c:barcode.jpg"? I don't think you need to create /tmp, it should already be there.
Continue this on the Google Group instead? http://groups.google.com/group/zxing/
Hi does the iphone version support openURL schemes to open Applications? Would be really nice, as deveopers can display a code on the screen and opens an application.
Hi..I am a beginner and trying to do a barcode scanning project.could anyone tell me how to scan a barcode using webcam/android emulator? Please advise me where to start from. Your help is always appreciated.
ZXing doesn't seem to work with proguard 3.9, which is what you get with Ubuntu Hardy as of January 2009. Download version 4.1 or later.
If proguard is too old you'll get errors like "unknown option -target".
Is there a getting started guide for iPhone developers? thanks!
I cannot build the android version for cupcake(1.5), it give following error
..\zxing\android\build.xml:125: Execute failed: java.io.IOException: Cannot run program "D:\android-sdk-windows-1.5_r1\tools\aapt.exe": CreateProcess? error=2, ?????????
aapt can only be found in android 1.1 and before
Yes, at the moment the code compiles against the 1.1 SDK so that the application can be built and used on 1.1 devices. Not every device has 1.5 yet, but 1.5 can run the 1.1-built application. Later when 1.5 is the norm we can change the build process to work with the 1.5 SDK.
Perhaps you could provide a 1.5 SDK version as well as the 1.1? There's little reason to develop new apps for 1.1 anymore, regardless of wether "not all device has 1.5 yet"
I do agree with Michael. 1.5 devices is not the future. Its allready here...
The Android build fails with: Execute failed: java.io.IOException: Cannot run program "/home/matthias/devel/frameworks/android-sdk/tools/aapt": java.io.IOException: error=2, No such file or directory
What is AAPT? There is no such program in the tools folder of the 1.5 SDK.
The android-integration build also fails:
BUILD FAILED /home/matthias/Desktop/zxing/android-integration/build.xml:35: Compile failed; see the compiler error output for details.
It would be better to post a message on the discussion group at http://groups.google.com/group/zxing/
I believe the first one indicates you are using Android 1.5, but are using the code as of the last release, which was written for Android 1.1. The latest in SVN works with 1.5.
The second one, same ultimate reason. Try the latest from SVN.
C:\svn-win32-1.4.6\bin\zxing-read-only\android>ant Buildfile: build.xml BUILD FAILED C:\svn-win32-1.4.6\bin\zxing-read-only\android\build.xml:64: taskdef class com.android.ant.SetupTask? cannot be found what's the problem?
the above problem solved, but new problem dex:
BUILD FAILED C:\svn-win32-1.4.6\bin\zxing-read-only\android\build.xml:218: apply returned: 1
Please use the discussion group or issue tracker, not wiki comments.
It sounds like dx can't be found; maybe you are not using Android 1.5 or haven't set the android-home var.
How to run the application after building it from command prompt
Please use the discussion group for questions, not the wiki. http://groups.google.com/group/zxing/
You didn't specify which application you are talking about. But the page already tells you how to proceed to run all of them. Please read it.
If java throws the following warning : Exception in thread "main" java.lang.NoClassDefFoundError?: com/google/zxing/clie nt/j2se/CommandLineRunner?
then notice that you're probably still inside the javase folder. Just go return to the parent folder and try again.=) I missed the 'cd..' command.today, I download ZXing V1.4, use follow command: java -cp javase\javase.jar;core\core.jar com.google.zxing.client.j2se.GUIRunner and then select a PDF417 picture in "data" fold, unfortunately, it doesn't work. I wonder if ZXing can't decode PDF417. Thanks!
Please use the discussion group for questions, not the wiki. http://groups.google.com/group/zxing/