Skip to content

Commit

Permalink
Merge pull request littlemonkeyltd#3 from shannah/master
Browse files Browse the repository at this point in the history
Updated to support cn1-codescan library
  • Loading branch information
DigNZ authored Aug 22, 2016
2 parents 01ff831 + aec804a commit 7267d42
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 11 deletions.
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,10 @@ How to use
Installation
------------

1. Build or download the [QRScanner.cn1lib](https://github.com/littlemonkeyltd/QRScanner/releases/latest) file.
1. Install the [cn1-codescan](https://github.com/codenameone/cn1-codescan) library into your project.
1. Build or download the [QRScanner.cn1lib](bin/QRScanner.cn1lib) file.
2. Put the file the `libs` folder of your project.
3. Right-click on your project and choose `Refresh Libs`
4. Add the following build hints"

|Key |Value |
|---------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
|android.xapplication |`<activity android:name="com.dm.zbar.android.scanner.ZBarScannerActivity" android:screenOrientation="landscape" android:label="@string/app_name" />`|
|android.xpermissions |`<uses-permission android:name="android.permission.CAMERA"/><uses-feature android:name="android.hardware.camera" android:required="false"/>` |
|android.proguardKeep|` -keep class net.sourceforge.zbar.** {*;} `*NOTE THERE NEEDS TO BE A SPACE BEFORE AND AFTER THIS VALUE* |

Example Code
------------
Expand Down
Binary file added bin/QRScanner.cn1lib
Binary file not shown.
5 changes: 5 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,12 @@

<target name="jar" depends="compile,Stubs">
<mkdir dir="build/lib" />
<mkdir dir="build/stubs"/>
<zip basedir="${build.classes.dir}" compress="false" destfile="build/lib/main.zip" />
<zip basedir="build/stubs" compress="false" destfile="build/lib/stubs.zip" />
<copy file="codenameone_library_appended.properties" todir="build/lib" />
<copy file="codenameone_library_required.properties" todir="build/lib" />
<copy file="codenameone_library.properties" todir="build/lib" />
<copy file="manifest.properties" todir="build/lib" />
<antcall target="buildNativeIOS" />
<antcall target="buildNativeRIM" />
Expand All @@ -69,6 +73,7 @@
<antcall target="buildNativeME" />
<mkdir dir="dist" />
<zip basedir="build/lib" compress="true" destfile="dist/${application.title}.cn1lib" />
<copy file="dist/${application.title}.cn1lib" tofile="../QRScannerDemo/lib/${application.title}.cn1lib" overwrite="true"/>
</target>

<target name="buildNativeRIM">
Expand Down
7 changes: 7 additions & 0 deletions codenameone_library_appended.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#Place here properties that should be appended to an existed property if exists
#in the project codenameone_settings.properties for example codename1.arg.android.xpermissions
#is an appended type property.
#
#Wed Jan 09 17:59:31 IST 2013
codename1.arg.android.xpermissions=<uses-permission android\:name\="android.permission.CAMERA"/><uses-feature android\:name\="android.hardware.camera" android\:required\="false"/>
codename1.arg.android.proguardKeep=\ -keep class net.sourceforge.zbar.** {*;}
3 changes: 3 additions & 0 deletions codenameone_library_required.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#
#Wed May 11 07:43:22 PDT 2016
codename1.arg.java.version=8
Binary file added lib/cn1-codescan.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
file.reference.android.jar=/home/nick/android-sdk-linux/platforms/android-19/android.jar
file.reference.build-classes=lib/cn1-codescan.jar
file.reference.CLDC11.jar=lib/CLDC11.jar
file.reference.CodenameOne.jar=lib/CodenameOne.jar
file.reference.CodenameOne_SRC.zip=lib/CodenameOne_SRC.zip
Expand All @@ -38,7 +39,8 @@ javac.classpath=\
${file.reference.CLDC11.jar}:\
${file.reference.CodenameOne.jar}:\
${file.reference.CodenameOne_SRC.zip}:\
${file.reference.QRScanner-override}
${file.reference.QRScanner-override}:\
${file.reference.build-classes}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
Expand Down
4 changes: 2 additions & 2 deletions src/org/littlemonkey/qrscanner/QRScanner.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ of this software and associated documentation files (the "Software"), to deal

package org.littlemonkey.qrscanner;

import com.codename1.codescan.CodeScanner;
import com.codename1.codescan.ScanResult;
import com.codename1.ext.codescan.CodeScanner;
import com.codename1.ext.codescan.ScanResult;
import com.codename1.system.NativeLookup;
import com.codename1.ui.Display;

Expand Down

0 comments on commit 7267d42

Please sign in to comment.