Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Contributor
Posts: 13
Registered: ‎10-06-2013
My Device: q10
My Carrier: 33663190794

[CORDOVA PLUGINS] Barcode Scanner

hello,

 

i have ported the bb10 barcode scanner plugin :

 

WebWorks-Community-APIs\BB10\BarcodeScanner => community.barcodescanner

 

to the cordova platforms and i want to share it but i need to know first witch name for this plugins :

 

- com.blackberry.community.barcodescanner

- community.barcodescanner

-  com.bb10.barcodereader

 

other suggestion ?

 

the second thing is where i publish it ?

 

this is an exmple of use :

 

var app = {
// Application Constructor
initialize: function() {
this.bindEvents();
},
// Bind Event Listeners
//
// Bind any events that are required on startup. Common events are:
// 'load', 'deviceready', 'offline', and 'online'.
bindEvents: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
},
// deviceready Event Handler
//
// The scope of 'this' is the event. In order to call the 'receivedEvent'
// function, we must explicity call 'app.receivedEvent(...);'
onDeviceReady: function() {
console.log("onDeviceReady");
/* set the display canvas */
community.barcodereader.canvas = 'mydisplay';
document.addEventListener('barcodeready', function(data) {
alert(data.value);
community.barcodereader.resumeRead();
});
}
};

function start()
{
community.barcodereader.startRead(function () {
// succesfful start
}, function(error) {
alert('can''t start : ' + error);
});
}

function stop()
{
community.barcodereader.stopRead(function () {
// succesfful stop
}, function(error) {
alert('can''t stop : ' + error);
});
}

 

 

 

Retired
Posts: 203
Registered: ‎12-18-2012
My Device: Z10, Q10, Q5, Z30, Z3
My Carrier: Bell

Re: [CORDOVA PLUGINS] Barcode Scanner

Hi,

 

This sounds great!

 

You should probably not use com.blackberry so it is clear that it's not an official API from BlackBerry. I'll ask some people internally for suggestions.

 

If you publish it to the cordova registry, users will be able to add the plugin by id without having to download it separately.

 

http://plugins.cordova.io/

 

You'll need to plugman utility to run the publish command:

 

https://github.com/apache/cordova-plugman

Bryan Higgins
BlackBerry WebWorks
@bryanhiggins
Retired
Posts: 856
Registered: ‎07-15-2008
My Device: Passport
My Carrier: Bell

Re: [CORDOVA PLUGINS] Barcode Scanner

[ Edited ]

I'm very happy to hear that you've been working on plugins for Cordova.

 

While a lot of the current ones use the community.xxx format for namespace, we think that you should be able to use your own reverse domain name for the namespace when contributing APIs. You should get recognition for your contribution, and that's one good way to do so.

 

For publishing, we'll certainly accept contributions into the WebWorks-Community-APIs repository. All that's necessary is that you sign up as a contributor, if you haven't done so already. It's a standard Apache Contributor Agreement form for open source. You can find it here: http://www.blackberry.com/legal/pdfs/webworks/Research_In_Motion_Limited_CCLA_021811_cl.pdf

 

For this particular plugin, I've been working with some community developers already and they also completed their work recently. I expect a pull request from them in the next few days. Based on what I've seen from your API, you may have added additional features that they did not, so we might all benefit from combining your work together. Would you like to go through the steps to get the agreement taken care of, and then see what they've done so you can put your additions into it as well?

 

They will be publishing it to a folder in our WebWorks-Community-APIs repository: https://github.com/blackberry/WebWorks-Community-APIs/tree/master/BB10-Cordova

 

Also, if you have the time and the interest, I'd be very interested in your feedback on the porting process and developing plugins for BlackBerry 10 with Cordova. Over the past few months it's evolved a bunch, and I'd like to keep making it better.

 

Thanks

Tim Windsor
Open Source Technical Lead
Contributor
Posts: 13
Registered: ‎10-06-2013
My Device: q10
My Carrier: 33663190794

Re: [CORDOVA PLUGINS] Barcode Scanner

For this particular plugin, I've been working with some community developers already and they also completed their work recently. I expect a pull request from them in the next few days. Based on what I've seen from your API, you may have added additional features that they did not, so we might all benefit from combining your work together. Would you like to go through the steps to get the agreement taken care of, and then see what they've done so you can put your additions into it as well?

 

i think is a good solution we don't need two plugins that doing the same work Smiley Wink

i have publish the plugin here : https://github.com/sdnetwork/cordova-bb10/

 

your comments (and others community developpers) could be very helpfull.

 

the next step is to add some  properties and the encoding functionality : 

 

 - viewquality (property)

 - burstmode (property)

- encode (function)

 

 

 

and now i will begin  to acquire the agreement.Smiley Wink

 

 

Retired
Posts: 856
Registered: ‎07-15-2008
My Device: Passport
My Carrier: Bell

Re: [CORDOVA PLUGINS] Barcode Scanner

I just accepted the pull request so the plugin is there if you want to add on to it.

 

Did you send in your ICLA yet?

Tim Windsor
Open Source Technical Lead