Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49083

Get Android scanner intent in Ionic

$
0
0

@neti wrote:

I have a scanner device that comes with Android 4.2.2, and I need to make an Ionic app that can scan barcodes. The $cordovaBarcodeScanner plugin doesn't help here, as it works only on mobile devices. Therefore, I think I need to capture the scanner intent somehow directly in my Ionic app, but I have no idea how could I do that.

I have this Java code example of how the scanner works:

public class BarcodeReceiver extends BroadcastReceiver {
public void onReceive(Context ctx, Intent intent) {
if (intent.getAction().equals(ACTION_BARCODE_SERVICE_BROADCAST)) {
strBarcode = intent.getExtras().getString(KEY_BARCODE_STR);
tvBarcode.setText(strBarcode);
strBarcode = "";
}
}
}

I would appreciate any directions. Thanks!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49083

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>