# QR Code Scanner

**URL:** <https://forums.fusetools.com/t/qr-code-scanner/4793>\
**Category:** Show and Tell\
**Created:** [May 12, 2016, 12:51pm UTC](https://forums.fusetools.com/t/qr-code-scanner/4793 "2016-05-12T12:51:49Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sahal\_Zain](https://avatars.discourse-cdn.com/v4/letter/s/d2c977/32.png) [@Sahal\_Zain](https://forums.fusetools.com/u/Sahal_Zain)\
**Post date:** [May 12, 2016, 12:51pm UTC](https://forums.fusetools.com/t/qr-code-scanner/4793/1 "2016-05-12T12:51:49Z")

</div>

Hi,

Just collecting some code from Internet and making a QR Code scanner for Fuse. It’s very basic, but it should be enough for most of QR code scanner. The iOS version is based on AVFoundation framework (require iOS 7+) and the Android version is based on Google Vision API (part of Google Play Service library) and it should work on Android 4.0+

[https://github.com/zean00/fuse-qreader](https://github.com/zean00/fuse-qreader)

Currently, it was built with Fuse 0.12.3 and tested on iphone5 iOS 8.4 and Lenovo Android 4.4. However, the android version has an issue, it will tell error while building with Fuse, but the generated project could be build and run with android studio without error message.

```auto
[aapt] /Users/sahalzain/Workspace/Fuse/fuse-qreader/build/Android/Preview/QreaderLibrary/app/src/main/bin/AndroidManifest.xml:61: error: Error: No resource found that matches the given name (at 'theme' with value '@style/Theme.AppCompat').

BUILD FAILED
/usr/local/Cellar/android-sdk/24.4.1_1/tools/ant/build.xml:649: The following error occurred while executing this line:
/usr/local/Cellar/android-sdk/24.4.1_1/tools/ant/build.xml:694: null returned: 1

```

I’m not sure why, since I’m very new to Android development and Fuse, any suggestion are welcome.

Please note, since I’m very new for Android, iOS, and Fuse development (I’m a javascript developer) sorry in advance if I couldn’t help if any of you have some issue or advance question.

Thanks

---

<div class="post-metadata">

**Author:** ![Donald](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@Donald](https://forums.fusetools.com/u/Donald)\
**Post date:** [May 12, 2016, 1:06pm UTC](https://forums.fusetools.com/t/qr-code-scanner/4793/2 "2016-05-12T13:06:08Z")

</div>

Sahal … you are the best 🙂 … but maybe you can join to Slack and there will be somebody, which can maybe help fix these issues.

---

<div class="post-metadata">

**Author:** ![Baggers](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/baggers/32/665_2.png) [@Baggers](https://forums.fusetools.com/u/Baggers)\
**Post date:** [May 13, 2016, 11:05am UTC](https://forums.fusetools.com/t/qr-code-scanner/4793/3 "2016-05-13T11:05:32Z")

</div>

Sahal, great work!

I’ve raised an issue internally to look at the android bug. I’ll post back here as soon as I have some news.

As soon as this works, I’m scanning everything 😃

---

<div class="post-metadata">

**Author:** ![Simo\_Santavirta](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/simo_santavirta/32/175_2.png) [@Simo\_Santavirta](https://forums.fusetools.com/u/Simo_Santavirta)\
**Post date:** [June 17, 2016, 7:28am UTC](https://forums.fusetools.com/t/qr-code-scanner/4793/4 "2016-06-17T07:28:38Z")

</div>

Any progress with this one? I would like to scan everything as well.

---

<div class="post-metadata">

**Author:** ![Baggers](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/baggers/32/665_2.png) [@Baggers](https://forums.fusetools.com/u/Baggers)\
**Post date:** [June 21, 2016, 9:37am UTC](https://forums.fusetools.com/t/qr-code-scanner/4793/5 "2016-06-21T09:37:43Z")

</div>

Hi folks, sorry to say this got pushed down the list whilst we were focussing on getting various large features out the door.

I’ll have a look at this again today, hopefully I can at least get some extra info on this issue to you.

---

<div class="post-metadata">

**Author:** ![Baggers](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/baggers/32/665_2.png) [@Baggers](https://forums.fusetools.com/u/Baggers)\
**Post date:** [June 21, 2016, 11:05am UTC](https://forums.fusetools.com/t/qr-code-scanner/4793/6 "2016-06-21T11:05:55Z")

</div>

Ok so the first thing I did was to add the `google play libs` to the build by changing your `unoproj` file to this:

```auto
{
    "Packages": [
        "Fuse",
        "FuseJS",
        "Android.Google.Play.Meta"
    ],
    "Includes": [
        ".uno",
        ".ux",
        "QreaderTask.h:ObjCHeader:iOS",
        "QreaderTask.mm:ObjCSource:iOS",
        "QRCodeReader.h:ObjCHeader:iOS",
        "QRCodeReader.mm:ObjCSource:iOS",
        "QRCodeReaderDelegate.h:ObjCHeader:iOS",
        "QRCodeReaderView.h:ObjCHeader:iOS",
        "QRCodeReaderView.mm:ObjCSource:iOS",
        "QRCodeReaderViewController.h:ObjCHeader:iOS",
        "QRCodeReaderViewController.mm:ObjCSource:iOS",
        "BarcodeCaptureActivity.java:Java:Android",
        "BarcodeGraphic.java:Java:Android",
        "BarcodeGraphicTracker.java:Java:Android",
        "BarcodeTrackerFactory.java:Java:Android",
        "CameraSource.java:Java:Android",
        "CameraSourcePreview.java:Java:Android",
        "GraphicOverlay.java:Java:Android"
    ]
}

```

I then got new errors:

```auto
fuse-qreader/build/Android/Debug/QreaderLibrary/app/src/main/java/com/fuse/qreader/BarcodeCaptureActivity.java:32: error: package android.support.design.widget does not exist
import android.support.design.widget.Snackbar;
                                    ^

fuse-qreader/build/Android/Debug/QreaderLibrary/app/src/main/java/com/fuse/qreader/BarcodeCaptureActivity.java:134: error: cannot find symbol
                Snackbar.LENGTH_INDEFINITE)
                ^
  symbol: variable Snackbar
  location: class BarcodeCaptureActivity

fuse-qreader/build/Android/Debug/QreaderLibrary/app/src/main/java/com/fuse/qreader/BarcodeCaptureActivity.java:133: error: cannot find symbol
        Snackbar.make(mGraphicOverlay, "Access to the camera is needed for detection",
        ^
  symbol: variable Snackbar
  location: class BarcodeCaptureActivity

```

The `SnackBar` is a member of the support repo, but we include support v4 in every build. So this must be a later version. I’ll go see where this lives.

---

<div class="post-metadata">

**Author:** ![Baggers](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/baggers/32/665_2.png) [@Baggers](https://forums.fusetools.com/u/Baggers)\
**Post date:** [June 21, 2016, 12:26pm UTC](https://forums.fusetools.com/t/qr-code-scanner/4793/7 "2016-06-21T12:26:53Z")

</div>

Ahah! it was the `support:design` library. This is available through Gradle so I’m going to use the preliminary gradle support in Fuse (which will be released in the next couple of hours).

I first add the requirement to the `QreaderImpl` class

```auto
[...]
[ForeignInclude(Language.ObjC, "QreaderTask.h", "QRCodeReaderViewController.h","QRCodeReader.h")]
[Require("Gradle.Dependency.Compile", "com.android.support:design:+")]
public class QreaderImpl
{

```

And then build with [gradle support](https://www.fusetools.com/docs/native-interop/preliminary-gradle-support) which at 12:25 UTC hasnt been release yet 😛

```auto
fuse build -t=android -DGRADLE -r --set:SDK.BuildToolsVersion="23.0.3" --set:SDK.CompileVersion="23" --set:SDK.TargetVersion="23" QreaderLibrary.unoproj

```

This builds and installs! I’m going to grab my phone and test this out

[UPDATE]

It does run and the camera intent is launched, for me it didnt do anything when pointed at a QR code though. However this a big step in the right direction. Hope this helps. I can also promise this will be a bit smoother as Gradle support becomes the default.

Be sure to read the Gradle guide linked above, this is expermental support and we would like to hear your feedback.

---

<div class="post-metadata">

**Author:** ![Sahal\_Zain](https://avatars.discourse-cdn.com/v4/letter/s/d2c977/32.png) [@Sahal\_Zain](https://forums.fusetools.com/u/Sahal_Zain)\
**Post date:** [June 21, 2016, 4:18pm UTC](https://forums.fusetools.com/t/qr-code-scanner/4793/8 "2016-06-21T16:18:14Z")

</div>

Hi,

Will it work with current release or should I wait the next release to be able to compile with gradle option?

---

<div class="post-metadata">

**Author:** ![Baggers](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/baggers/32/665_2.png) [@Baggers](https://forums.fusetools.com/u/Baggers)\
**Post date:** [June 22, 2016, 7:25am UTC](https://forums.fusetools.com/t/qr-code-scanner/4793/9 "2016-06-22T07:25:31Z")

</div>

We made a new release [yesterday](https://www.fusetools.com/downloads/channel/qa) so if you have that then you are able to try it out. Be sure to check [the guide](https://www.fusetools.com/docs/native-interop/preliminary-gradle-support) though as this is a preliminary feature.

---

<div class="post-metadata">

**Author:** ![Simo\_Santavirta](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/simo_santavirta/32/175_2.png) [@Simo\_Santavirta](https://forums.fusetools.com/u/Simo_Santavirta)\
**Post date:** [June 22, 2016, 6:33pm UTC](https://forums.fusetools.com/t/qr-code-scanner/4793/10 "2016-06-22T18:33:15Z")

</div>

Brilliant! Will give it a tryout.

---

<div class="post-metadata">

**Author:** ![Sahal\_Zain](https://avatars.discourse-cdn.com/v4/letter/s/d2c977/32.png) [@Sahal\_Zain](https://forums.fusetools.com/u/Sahal_Zain)\
**Post date:** [October 8, 2016, 10:01am UTC](https://forums.fusetools.com/t/qr-code-scanner/4793/11 "2016-10-08T10:01:43Z")

</div>

> 

[UPDATE]

> 

It does run and the camera intent is launched, for me it didnt do anything when pointed at a QR code though. However this a big step in the right direction. Hope this helps. I can also promise this will be a bit smoother as Gradle support becomes the default.

> 

Be sure to read the Gradle guide linked above, this is expermental support and we would like to hear your feedback.

\> Hi, I notice that sometimes the Qreader doesn’t scan any qr code and just do nothing, it seems that the problem is in the autofocus mode, currently I update the autofocuse mode to continues video (previously continues picture), it should be work faster now. But now with the latest fuse build, I encounter several problem both on Android and iOS [Fuse](https://www.fusetools.com/community/forums/bug%5C_reports/gradle%5C_build%5C_error) [Fuse](https://www.fusetools.com/community/forums/bug%5C_reports/missing%5C_uobjc%5C_from%5C_global%5C_namespace%5C_ios%5C_foreign_co) However, I still managed to get my code working tough, it just a little inconvenience for me.

---

<div class="post-metadata">

**Author:** ![MVONDO\_Yannick](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/mvondo_yannick/32/214_2.png) [@MVONDO\_Yannick](https://forums.fusetools.com/u/MVONDO_Yannick)\
**Post date:** [October 14, 2016, 7:19am UTC](https://forums.fusetools.com/t/qr-code-scanner/4793/12 "2016-10-14T07:19:11Z")

</div>

Hi, nothing new about Fuse QR Code? thanks

---

<div class="post-metadata">

**Author:** ![Simo\_Santavirta](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/simo_santavirta/32/175_2.png) [@Simo\_Santavirta](https://forums.fusetools.com/u/Simo_Santavirta)\
**Post date:** [December 9, 2016, 9:12am UTC](https://forums.fusetools.com/t/qr-code-scanner/4793/13 "2016-12-09T09:12:44Z")

</div>

This thing works on iOS and Android with 0.30 build. No problems at all. The Android side can read pretty much anything from QR to barcodes. Will need to check if it’s possible to make the iOS side recognise barcodes as well.

In any case: GOOD JOB! 🙂

---

<div class="post-metadata">

**Author:** ![Baggers](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/baggers/32/665_2.png) [@Baggers](https://forums.fusetools.com/u/Baggers)\
**Post date:** [December 9, 2016, 12:45pm UTC](https://forums.fusetools.com/t/qr-code-scanner/4793/14 "2016-12-09T12:45:32Z")

</div>

Thanks Simo, great to hear

---

<div class="post-metadata">

**Author:** ![Rolando\_Rodrigues](https://avatars.discourse-cdn.com/v4/letter/r/c6cbf5/32.png) [@Rolando\_Rodrigues](https://forums.fusetools.com/u/Rolando_Rodrigues)\
**Post date:** [January 26, 2017, 9:24am UTC](https://forums.fusetools.com/t/qr-code-scanner/4793/15 "2017-01-26T09:24:34Z")

</div>

> **Simo Santavirta wrote:**
> 
> This thing works on iOS and Android with 0.30 build. No problems at all. The Android side can read pretty much anything from QR to barcodes. Will need to check if it’s possible to make the iOS side recognise barcodes as well.
> 
> In any case: GOOD JOB! 🙂

Hi i’m having troubles getting this to work - could you provide a working project with the latest fuse build? That would be great…

---

<div class="post-metadata">

**Author:** ![j3gggy](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@j3gggy](https://forums.fusetools.com/u/j3gggy)\
**Post date:** [February 5, 2017, 10:47am UTC](https://forums.fusetools.com/t/qr-code-scanner/4793/16 "2017-02-05T10:47:33Z")

</div>

I’m very new in Fusetools, and this post my first post here, first i want to say to dev team - Great Job ^^ thx guys, really…

subj: [https://github.com/zean00/fuse-qreader](https://github.com/zean00/fuse-qreader) - this work for me, im happy )

but here was some problems with compilation, i have already installed previously sdk & ndk, but it not recognized properly…

then i start from scratch:

remove previous installtion  
and then reinstall via “fuse install android” - thats help me…

Good job guys.  
Good luck.

---

<div class="post-metadata">

**Author:** ![dima.lisin](https://avatars.discourse-cdn.com/v4/letter/d/977dab/32.png) [@dima.lisin](https://forums.fusetools.com/u/dima.lisin)\
**Post date:** [March 9, 2017, 10:04am UTC](https://forums.fusetools.com/t/qr-code-scanner/4793/17 "2017-03-09T10:04:54Z")

</div>

So, QR reader not compiled in 0.35, compiled, but don’t work (no recognize) in 0.34  
The problem is in Android only. iOS working well

---

<div class="post-metadata">

**Author:** ![Baggers](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/baggers/32/665_2.png) [@Baggers](https://forums.fusetools.com/u/Baggers)\
**Post date:** [March 9, 2017, 10:08am UTC](https://forums.fusetools.com/t/qr-code-scanner/4793/18 "2017-03-09T10:08:28Z")

</div>

Would love to help, but this looks like a new issue, so please start a new thread.

Thankyou

---

<div class="post-metadata">

**Author:** ![Cristian\_Karmy](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/cristian_karmy/32/480_2.png) [@Cristian\_Karmy](https://forums.fusetools.com/u/Cristian_Karmy)\
**Post date:** [May 8, 2017, 2:45pm UTC](https://forums.fusetools.com/t/qr-code-scanner/4793/19 "2017-05-08T14:45:46Z")

</div>

> **[dima.lisin@gmail.com](mailto:dima.lisin@gmail.com) wrote:**
> 
> So, QR reader not compiled in 0.35, compiled, but don’t work (no recognize) in 0.34  
> The problem is in Android only. iOS working well

Same error in 0.37.0 (12471)

---

<div class="post-metadata">

**Author:** ![Baggers](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/baggers/32/665_2.png) [@Baggers](https://forums.fusetools.com/u/Baggers)\
**Post date:** [May 9, 2017, 10:26am UTC](https://forums.fusetools.com/t/qr-code-scanner/4793/20 "2017-05-09T10:26:47Z")

</div>

@Cristian Karmy

Just tested in 0.36.1 & 0.37.0 (current qa).

I built using `uno clean QreaderLibrary.unoproj && uno build -tandroid QreaderLibrary.unoproj -r`

‘Work fine for me’ but if you are still having issues please file a new issue.

[Next page](https://forums.fusetools.com/t/qr-code-scanner/4793.md?page=2)
