0

I need to just read QR code on android emulator by React native, I find a lot of libraries on npm but it all works only on IOS ,Thanks in advance .

Please,help 3 days wasted :(

Nesreen adly
  • 45
  • 1
  • 2
  • 10
  • Duplicate: http://stackoverflow.com/questions/35309933/barcode-scanning-using-react-native – OneCricketeer Jun 09 '16 at 14:35
  • @cricket_007 Sorry dear, I nead QR Code reader not Barcode – Nesreen adly Jun 09 '16 at 14:50
  • 1
    The `react-native-barcodescanner` has a `BarcodeFormat.QR_CODE` option – OneCricketeer Jun 09 '16 at 14:52
  • A barcode is a general term. QR Code is a format of a 2D barcode. [Barcode Wikipedia](https://en.wikipedia.org/wiki/Barcode) – DasScooter Jun 09 '16 at 15:33
  • Sorry For being little dummy I use `onBarCodeRead={this.barcodeReceived}` how can I specify the type `BarcodeFormat.QR_CODE` ? @cricket_007 – Nesreen adly Jun 09 '16 at 17:46
  • @DasScooter I use `onBarCodeRead={this.barcodeReceived}` how can I specify the type `BarcodeFormat.QR_CODE` ? and how can I write it? – Nesreen adly Jun 09 '16 at 17:50
  • I saw this question as an Android Question. I am not entirely familiar with javascript, but I tool a quick look at this [React Native Page](https://github.com/ideacreation/react-native-barcodescanner) In the documentation in the Readme the barcoderecieved function seems to log the resultant type of barcode. From this I think that it detects the barcode type which seems to make sense. I don't know what your goal is. If you are trying to limit the reader to only read QR Maybe you should set up logic to ignore other types of barcodes. If you don't care if it reads other types, you might be done. – DasScooter Jun 09 '16 at 18:14
  • @DasScooter I use this library https://github.com/ideacreation/react-native-barcodescanner – Nesreen adly Jun 09 '16 at 18:18
  • That appears to be the link I was referring to. If you read the read me file you will see where there is an example for implementation. – DasScooter Jun 09 '16 at 18:34
  • @DasScooter I already read it , so I ask shall I Do Somthing like that `barcodeReceived(e) { e.type=BarcodeFormat.QR_CODE; alert(e.data); }` – Nesreen adly Jun 09 '16 at 18:45
  • I am not a JavaScript developer. As I write Java/Android and Objective C/iOS I can only look at your code and make assumptions. "e.type=BarcodeFormat.QR_Code;" looks like you are trying to set the barcode to QR. I'd imagine it should be more like "if(e.type == BarcodeFormat.QR_Code) { //do something} but again only if you are Trying to limit functionality to QR Codes. The library seems to support multiple formats and sense the correct format. – DasScooter Jun 09 '16 at 18:57
  • @DasScooter Yes, All what I need to capture the QR Codes only and get its data even it string or link, So I limit type to QR_CODE. – Nesreen adly Jun 09 '16 at 19:04
  • Possible duplicate of [Why is the Android emulator so slow? How can we speed up the Android emulator?](http://stackoverflow.com/questions/1554099/why-is-the-android-emulator-so-slow-how-can-we-speed-up-the-android-emulator) – mehrdad khosravi Jun 10 '16 at 06:34

0 Answers0