Sunday, January 27, 2013

PhoneGap Plugin Updates to BarcodeScanner and AppPreferences

I've updated the BarcodeScanner and AppPreferences to use the Apache Cordova 2.2.0 API's. That means no more deprecation notices in the Java code and the JavaScript code uses the cordova.require method. However, I'm still slapping the objects into window.plugins so you shouldn't need to change any of your JavaScript code after upgrading.

The BarcodeScanner code has also been updated to use the ZXing 2.1 library. If all goes well there I will contact Ryan over at PhoneGap Build to pick up my changes.

Next up will be the GalleryPlugin. The only thing holding it up is that I want to add a remove method to go along with the add.

4 comments:

Russell Harrower said...

Can you please tell us how we get this to work with iPhone - I can seem to get it working

Simon MacDonald said...

@Russell Harrower

Not sure if the iOS plugin has been updated for 2.3.0.

George said...

Simon>

I have older version of barcodescanner libarary project working wonderfully with my app using Cordova 1.9. ( my older version of barcodescanner lib project is identical to
https://github.com/phonegap/phonegap-plugins/tree/master/Android/BarcodeScanner/LibraryProject )

Now I am in process of upgrade my app to use Cordova 2.4. The first thing I did is to update the barcodescanner lib project to 2.2.0 folder
https://github.com/phonegap/phonegap-plugins/tree/master/Android/BarcodeScanner/2.2.0/LibraryProject

I copy/pasted all files from 2.2.0 version into the old one and refreshed my project in Eclipse and cleanly rebuilt and I got the following error.

Description Resource Path Location Type
NDEF_SMART_POSTER cannot be resolved or is not a field NDEFSmartPosterParsedResult.java /BarcodeLibrary/src/com/google/zxing/client/result/optional line 37 Java Problem

Description Resource Path Location Type
This static method cannot hide the instance method from ResultParser NDEFSmartPosterResultParser.java /BarcodeLibrary/src/com/google/zxing/client/result/optional line 34 Java Problem

Description Resource Path Location Type
This static method cannot hide the instance method from ResultParser NDEFTextResultParser.java /BarcodeLibrary/src/com/google/zxing/client/result/optional line 30 Java Problem

Description Resource Path Location Type
This static method cannot hide the instance method from ResultParser NDEFURIResultParser.java /BarcodeLibrary/src/com/google/zxing/client/result/optional line 69 Java Problem

Description Resource Path Location Type
Type mismatch: cannot convert from CharacterSetECI to ECI ECI.java /BarcodeLibrary/src/com/google/zxing/common line 47 Java Problem

Any idea what is going on? Am I missing somefiles?

Thanks,

George

George said...

Simon>

I think I figured out. I needed to empty destination folder before copy paste in.

Those errors were from files no longer exist in newer version.

It seemed that asking the author always helps.

Thanks,

George