|
| 1 | +ZBar Android SDK |
| 2 | +================ |
| 3 | + |
| 4 | +ZBar Bar Code Reader is an open source software suite for reading bar |
| 5 | +codes from various sources, such as video streams, image files and raw |
| 6 | +intensity sensors. It supports EAN-13/UPC-A, UPC-E, EAN-8, Code 128, |
| 7 | +Code 93, Code 39, Codabar, Interleaved 2 of 5, QR Code and |
| 8 | +DataBar. These are the JNI wrappers for developing the library on |
| 9 | +Android platform. |
| 10 | + |
| 11 | +Check the ZBar home page for the latest release, mailing lists, etc. |
| 12 | + http://zbar.sourceforge.net/ |
| 13 | + |
| 14 | +Copyright and License |
| 15 | +--------------------- |
| 16 | +Licensed under the GNU Lesser General Public License, version 2.1. |
| 17 | +http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt |
| 18 | + |
| 19 | +Copyright 2008-2012 � Jeff Brown < [email protected]> et al |
| 20 | + |
| 21 | +The Android distribution also includes pre-compiled binaries of |
| 22 | +supporting libaries, for which copyright, license and source code |
| 23 | +locations are as follows: |
| 24 | + * The GNU libiconv character set conversion library |
| 25 | + Copyright (C) 1999-2011 Free Software Foundation, Inc. |
| 26 | + This distribution includes GNU libiconv version 1.14, licensed under |
| 27 | + the LGPL version 2. The source code is available from |
| 28 | + http://www.gnu.org/software/libiconv |
| 29 | + |
| 30 | +See included files COPYING and LICENSE for details. |
| 31 | + |
| 32 | + |
| 33 | +Installation |
| 34 | +------------ |
| 35 | + |
| 36 | +After downloading the ZBar-Android-Lib-<version>.zip file, you need to |
| 37 | +unzip the file and add it to your Android project. Unzip the file |
| 38 | +using your favorite method (ie: command-line, finder, windows |
| 39 | +explorer...) |
| 40 | + |
| 41 | +Follow one of the two options. |
| 42 | +Option 1 - via command line |
| 43 | + cd <android project> |
| 44 | + cp -r ZBar-Android-SDK-<version>/libs . |
| 45 | + |
| 46 | +Option 2 - via Eclipse |
| 47 | + Right click on Android Project |
| 48 | + Select "Import" -> "File System" |
| 49 | + Select "Browse" (next to "From directory File" and select the |
| 50 | + ZBar-Android-SDK-<verion>/libs directory and click "Open". |
| 51 | + Click the check box next to "libs" and the "Options" "Create top-level folder" |
| 52 | + check box (below). |
| 53 | + Then click "Finish". |
| 54 | + |
| 55 | + You should then see a "libs" folder under your project. |
| 56 | + |
| 57 | +Building |
| 58 | +-------- |
| 59 | + |
| 60 | +Via Eclipse |
| 61 | +You have to add the zbar.jar file to your build path |
| 62 | + 1) select zbar.jar under libs |
| 63 | + 2) right-click, select "Build Path" -> "Add to Build Path" |
| 64 | + |
| 65 | +Via command-line |
| 66 | +You are all set; ant will automatcially find jar files under the "libs" |
| 67 | +subdirectory. |
| 68 | + |
| 69 | +Documentation |
| 70 | +------------- |
| 71 | + TDB |
| 72 | + |
| 73 | +Examples |
| 74 | +-------- |
| 75 | + |
| 76 | +You should be able to open and build the examples directly from the |
| 77 | +unzipped directory. You will need to run the android tools to setup |
| 78 | +the local.properties file which sets sdk.dir. |
| 79 | + 1) cd <unzip dir>/examples/CameraTest |
| 80 | + 2) android update project --path . |
| 81 | + 3) ant debug install |
| 82 | + |
| 83 | +If you have problems with this, please create a new Android project |
| 84 | +and copy the necessary files from the examples. |
| 85 | + |
| 86 | +examples/CameraTest is a simple demonstration of how to integrate the |
| 87 | +ZBar image scanner with the camera. |
| 88 | + |
| 89 | +Manually building ZBar JNI library |
| 90 | +---------------------------------- |
| 91 | +First download and unzip the iconv library source from |
| 92 | + http://www.gnu.org/software/libiconv/ |
| 93 | + |
| 94 | +Then kick off the build from the ZBar android directory. You will |
| 95 | +need to run the android tools to setup the local.properties file which |
| 96 | +setups sdk.dir. |
| 97 | + |
| 98 | + 1) cd <zbar project>/android |
| 99 | + 2) android update project --path . |
| 100 | + 3) ant -Dndk.dir=<NDK path> -Diconv.src=<iconv library src> zbar-all |
| 101 | + |
| 102 | +This will rebuild all source files, create zbar.jar and |
| 103 | +ZBarAndroidSDK.zip file (which bundles the jar and shared |
| 104 | +libraries). From here, you can follow the steps for "Integrating ZBar |
| 105 | +JNI library in Android project". |
| 106 | + |
| 107 | +To clean run: |
| 108 | + ant -Dndk.dir=<NDK path> zbar-clean |
| 109 | + |
| 110 | +See build-ndk.xml for additional target options. |
| 111 | + |
| 112 | + |
0 commit comments