logo
down
shadow

phonegap QR/barcode generator plugin


phonegap QR/barcode generator plugin

By : someguy
Date : November 19 2020, 03:59 PM
hope this fix your issue Solution A: web service
If your app can require an internet connection to generate QR codes, you can use a web service.
code :
http://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=http://www.example.com/&choe=UTF-8&chld=L|1
http://zxing.org/w/chart?chs=150x150&cht=qr&chl=http://www.example.com/&choe=UTF-8&chld=L|1


Share : facebook icon twitter icon
iOS PhoneGap 1.7.0 + Barcode Scanning Plugin issue

iOS PhoneGap 1.7.0 + Barcode Scanning Plugin issue


By : Hiye Shin
Date : March 29 2020, 07:55 AM
To fix this issue OK so after a bit of poking around and using the twitter PhoneGap plugin as an example I managed to get it working!!
I used this as a basis for my approach because the lovely people at twitter updated their plugin to work with PhoneGap 1.7.0 thank god!!
code :
var BarcodeScanner = function(){};

BarcodeScanner.prototype.isBarcodeScannerAvailable = function(response){
    cordova.exec(response, null, "BarcodeScannerPlugin", "isBarcodeScannerAvailable", []);
};

BarcodeScanner.prototype.isBarcodeScannerSetup = function(response){
    cordova.exec(response, null, "BarcodeScannerPlugin", "isBarcodeScannerSetup", []);
};

//-------------------------------------------------------------------
BarcodeScanner.Encode = {
TEXT_TYPE:     "TEXT_TYPE",
EMAIL_TYPE:    "EMAIL_TYPE",
PHONE_TYPE:    "PHONE_TYPE",
SMS_TYPE:      "SMS_TYPE",
CONTACT_TYPE:  "CONTACT_TYPE",
LOCATION_TYPE: "LOCATION_TYPE"
}

//-------------------------------------------------------------------
BarcodeScanner.prototype.scan = function(success, fail, options) {
    function successWrapper(result) {
        result.cancelled = (result.cancelled == 1)
        success.call(null, result)
    }

    if (!fail) { fail = function() {}}

    if (typeof fail != "function")  {
        console.log("BarcodeScanner.scan failure: failure parameter not a function")
        return
    }

    if (typeof success != "function") {
        fail("success callback parameter must be a function")
        return
    }

    if ( null == options ) 
        options = []

        return PhoneGap.exec(successWrapper, fail, "com.cordova.barcodeScanner", "scan", options)
        }

//-------------------------------------------------------------------
BarcodeScanner.prototype.encode = function(type, data, success, fail, options) {
    if (!fail) { fail = function() {}}

    if (typeof fail != "function")  {
        console.log("BarcodeScanner.scan failure: failure parameter not a function")
        return
    }

    if (typeof success != "function") {
        fail("success callback parameter must be a function")
        return
    }

    return PhoneGap.exec(success, fail, "com.cordova.barcodeScanner", "encode", [{type: type, data: data, options: options}])
}

cordova.addConstructor(function() {

                       /* shim to work in 1.5 and 1.6  */
                       if (!window.Cordova) {
                       window.Cordova = cordova;
                       };


                       if(!window.plugins) window.plugins = {};
                       window.plugins.barcodeScanner = new BarcodeScanner();
                       });
barcode scanner using phonegap plugin without using the barcode library?

barcode scanner using phonegap plugin without using the barcode library?


By : user4784210
Date : March 29 2020, 07:55 AM
I wish this help you I am working on phonegap android application. this is entirely new to me. I want develop an application with barcode scanner. that too it might uses the intent call. That means the barcode intent is called from the java code and once the scanning over the result should be displayed in HTML page. , This code from a phonegap plugin works as expected:
code :
    public PluginResult execute(String arg0, JSONArray arg1, String arg2) {
        Intent intent = new Intent("com.google.zxing.client.android.SCAN");
        intent.setPackage("com.google.zxing.client.android");
    //  intent.putExtra("SCAN_MODE", "QR_CODE_MODE");
        ctx.startActivityForResult(this, intent, 0);

        return new PluginResult(PluginResult.Status.OK);
    }

    public void onActivityResult(int requestCode, int resultCode, Intent intent) {
        if (requestCode == 0) {
            Log.i("Cordova", "result " + resultCode);
            if (resultCode == Activity.RESULT_OK) {
                String contents = intent.getStringExtra("SCAN_RESULT");
                String format = intent.getStringExtra("SCAN_RESULT_FORMAT");

                Log.i("Cordova", "contents " + contents + ", format " + format);
                // Handle successful scan
            } else if (resultCode == Activity.RESULT_CANCELED) {
                // Handle cancel
                Log.i("Cordova", "scan cancelled");
            }
        }
    }
Can't start barcode scanner with PhoneGap plugin

Can't start barcode scanner with PhoneGap plugin


By : alex mengi
Date : March 29 2020, 07:55 AM
will help you I ended up just calling out to the installed Barcode Scanner app rather than trying to include the code as a part of my project.
PhoneGap Barcode Scanner Plugin (ZXing) on iOS

PhoneGap Barcode Scanner Plugin (ZXing) on iOS


By : Michael C. Watson
Date : March 29 2020, 07:55 AM
should help you out This works. It is the same plugin updated by @zeroasterisk. It does the trick, until PhoneGap guys update the plugin.
Loading Barcode plugin in Phonegap using Plugman

Loading Barcode plugin in Phonegap using Plugman


By : ata10
Date : March 29 2020, 07:55 AM
To fix this issue I had this issue, I solved it attaching above in my config.xml. But this sounds as a temporary solution as plugins tag seems to be deprecated in new releases (to be confirmed, the documentation is really bad)...
shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org