Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Barcode scanning on iOS
QtWS25 Last Chance

Barcode scanning on iOS

Scheduled Pinned Locked Moved Solved Mobile and Embedded
iosbarcodezxingqzxing
7 Posts 4 Posters 3.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tomaslov
    wrote on last edited by tomaslov
    #1

    I've been using the "BarCode Scanner" (zxing) app successfully via Intents on Android for years, and now we're looking for a way to scan barcodes in our Qt/QML (Qt Quick Controls 1) on iOS as well.

    I did look at this project, https://github.com/ftylitak/qzxing/, but it seems to have some drawbacks:

    • QZXingLive didn't work for me when testing with Qt 5.7 and 5.8 (no camera view appears) on Android, works on Windows though (I haven't tried yet on iOS though...)
    • looks like it uses quite old zxing libs?

    Please correct me if I'm wrong. What would be your advice on how to enable barcode scanning in your Qt/QML app for iOS? We would just need to be able to open the camera, scan a barcode (typically simple 1d) and get back the result to do our search in our app-internal database.

    We've done some simple Qt to Objective-C integration (like including Firebase API) before, maybe using something like this would be preferable?https://developer.apple.com/library/prerelease/content/samplecode/AVCamBarcode/Introduction/Intro.html

    Thanks,
    TomasL

    1 Reply Last reply
    0
    • T TheCrowKaka

      @tomaslov
      Hello
      Did you solve this problem of Barcode scanning on IOS?
      If Yes, could you please share the solution?

      T Offline
      T Offline
      tomaslov
      wrote on last edited by
      #7

      @TheCrowKaka Yes, we now have the same solution running on Windows desktop, Android and iOS, basicly using this method: https://www.kdab.com/efficient-barcode-scanning-qzxing/

      1 Reply Last reply
      0
      • L Offline
        L Offline
        luca
        wrote on last edited by
        #2

        You shoud try to edit Manifest.xml file and set targetSdk to API 22 .

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tomaslov
          wrote on last edited by
          #3

          @luca , thanks.

          Now tested QZXingLive example on Android using Qt 5.7.0 and 5.8.0. Changed target sdk from api 23 to 22, but still get this error when starting the app:

          Starting remote process.E Zygote  : v2
          I SELinux : Function: selinux_compare_spd_ram, index[1], SPD-policy is existed. and_ver=SEPF_SECMOBILE_6.0.1 ver=11
          W SELinux : Function: selinux_compare_spd_ram, index[1], priority [2], priority version is VE=SEPF_SECMOBILE_6.0.1_0032
          E Zygote  : accessInfo : 0
          I libpersona: KNOX_SDCARD checking this for 10382
          I libpersona: KNOX_SDCARD not a persona
          W SELinux : SELinux: seapp_context_lookup: seinfo=default, level=s0:c512,c768, pkgname=org.qtproject.example
          I art     : Late-enabling -Xcheck:jni
          D TimaKeyStoreProvider: TimaSignature is unavailable
          D ActivityThread: Added TimaKeyStore provider
          E File    : fail readDirectory() errno=2
          E Qt      : Can't create main activity
          E Qt      : java.io.FileNotFoundException: --Added-by-androiddeployqt--/qml/QtQuick/Controls.2/designer/BusyIndicatorSpecifics.qml
          E Qt      : 	at android.content.res.AssetManager.openAsset(Native Method)
          E Qt      : 	at android.content.res.AssetManager.open(AssetManager.java:363)
          E Qt      : 	at android.content.res.AssetManager.open(AssetManager.java:337)
          E Qt      : 	at org.qtproject.qt5.android.bindings.QtLoader.copyAsset(QtLoader.java:358)
          E Qt      : 	at org.qtproject.qt5.android.bindings.QtLoader.extractBundledPluginsAndImports(QtLoader.java:467)
          E Qt      : 	at org.qtproject.qt5.android.bindings.QtLoader.startApp(QtLoader.java:546)
          E Qt      : 	at org.qtproject.qt5.android.bindings.QtActivityLoader.onCreate(QtActivityLoader.java:181)
          E Qt      : 	at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:269)
          E Qt      : 	at android.app.Activity.performCreate(Activity.java:6876)
          E Qt      : 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)
          E Qt      : 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3206)
          E Qt      : 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349)
          E Qt      : 	at android.app.ActivityThread.access$1100(ActivityThread.java:221)
          E Qt      : 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
          E Qt      : 	at android.os.Handler.dispatchMessage(Handler.java:102)
          E Qt      : 	at android.os.Looper.loop(Looper.java:158)
          E Qt      : 	at android.app.ActivityThread.main(ActivityThread.java:7225)
          E Qt      : 	at java.lang.reflect.Method.invoke(Native Method)
          E Qt      : 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
          E Qt      : 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
          D ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{18e33cc I.E...... R.....ID 0,0-0,0}
          D SecWifiDisplayUtil: Metadata value : none
          D OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
          I Adreno  : QUALCOMM build                   : d842ad3, Ia10634f51b
          I Adreno  : Build Date                       : 01/04/16
          I Adreno  : OpenGL ES Shader Compiler Version: XE031.06.00.05
          I Adreno  : Local Branch                     : mybranch17578993
          I Adreno  : Remote Branch                    : quic/LA.BF.2.1.2_rb1.7
          I Adreno  : Remote Branch                    : NONE
          I Adreno  : Reconstruct Branch               : NOTHING
          D libEGL  : eglInitialize EGLDisplay = 0xb2a907c4
          I OpenGLRenderer: Initialized EGL, version 1.4
          D ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=1
          W DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
          D libGLESv1: DTS_GLAPI : DTS is not allowed for Package : org.qtproject.example
          I Timeline: Timeline: Activity_idle id: android.os.BinderProxy@4023417 time:343061117
          I Timeline: Timeline: Activity_idle id: android.os.BinderProxy@4023417 time:343064851
          
          T 1 Reply Last reply
          0
          • L Offline
            L Offline
            luca
            wrote on last edited by luca
            #4

            I just tried on my Linux PC with Qt 5.8 for Android and QZXingLive build and run without problem.
            Try starting with a clean QZXing installation .

            1 Reply Last reply
            1
            • T tomaslov

              @luca , thanks.

              Now tested QZXingLive example on Android using Qt 5.7.0 and 5.8.0. Changed target sdk from api 23 to 22, but still get this error when starting the app:

              Starting remote process.E Zygote  : v2
              I SELinux : Function: selinux_compare_spd_ram, index[1], SPD-policy is existed. and_ver=SEPF_SECMOBILE_6.0.1 ver=11
              W SELinux : Function: selinux_compare_spd_ram, index[1], priority [2], priority version is VE=SEPF_SECMOBILE_6.0.1_0032
              E Zygote  : accessInfo : 0
              I libpersona: KNOX_SDCARD checking this for 10382
              I libpersona: KNOX_SDCARD not a persona
              W SELinux : SELinux: seapp_context_lookup: seinfo=default, level=s0:c512,c768, pkgname=org.qtproject.example
              I art     : Late-enabling -Xcheck:jni
              D TimaKeyStoreProvider: TimaSignature is unavailable
              D ActivityThread: Added TimaKeyStore provider
              E File    : fail readDirectory() errno=2
              E Qt      : Can't create main activity
              E Qt      : java.io.FileNotFoundException: --Added-by-androiddeployqt--/qml/QtQuick/Controls.2/designer/BusyIndicatorSpecifics.qml
              E Qt      : 	at android.content.res.AssetManager.openAsset(Native Method)
              E Qt      : 	at android.content.res.AssetManager.open(AssetManager.java:363)
              E Qt      : 	at android.content.res.AssetManager.open(AssetManager.java:337)
              E Qt      : 	at org.qtproject.qt5.android.bindings.QtLoader.copyAsset(QtLoader.java:358)
              E Qt      : 	at org.qtproject.qt5.android.bindings.QtLoader.extractBundledPluginsAndImports(QtLoader.java:467)
              E Qt      : 	at org.qtproject.qt5.android.bindings.QtLoader.startApp(QtLoader.java:546)
              E Qt      : 	at org.qtproject.qt5.android.bindings.QtActivityLoader.onCreate(QtActivityLoader.java:181)
              E Qt      : 	at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:269)
              E Qt      : 	at android.app.Activity.performCreate(Activity.java:6876)
              E Qt      : 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)
              E Qt      : 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3206)
              E Qt      : 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349)
              E Qt      : 	at android.app.ActivityThread.access$1100(ActivityThread.java:221)
              E Qt      : 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
              E Qt      : 	at android.os.Handler.dispatchMessage(Handler.java:102)
              E Qt      : 	at android.os.Looper.loop(Looper.java:158)
              E Qt      : 	at android.app.ActivityThread.main(ActivityThread.java:7225)
              E Qt      : 	at java.lang.reflect.Method.invoke(Native Method)
              E Qt      : 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
              E Qt      : 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
              D ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{18e33cc I.E...... R.....ID 0,0-0,0}
              D SecWifiDisplayUtil: Metadata value : none
              D OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
              I Adreno  : QUALCOMM build                   : d842ad3, Ia10634f51b
              I Adreno  : Build Date                       : 01/04/16
              I Adreno  : OpenGL ES Shader Compiler Version: XE031.06.00.05
              I Adreno  : Local Branch                     : mybranch17578993
              I Adreno  : Remote Branch                    : quic/LA.BF.2.1.2_rb1.7
              I Adreno  : Remote Branch                    : NONE
              I Adreno  : Reconstruct Branch               : NOTHING
              D libEGL  : eglInitialize EGLDisplay = 0xb2a907c4
              I OpenGLRenderer: Initialized EGL, version 1.4
              D ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=1
              W DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
              D libGLESv1: DTS_GLAPI : DTS is not allowed for Package : org.qtproject.example
              I Timeline: Timeline: Activity_idle id: android.os.BinderProxy@4023417 time:343061117
              I Timeline: Timeline: Activity_idle id: android.os.BinderProxy@4023417 time:343064851
              
              T Offline
              T Offline
              TheCrowKaka
              wrote on last edited by
              #5

              @tomaslov
              Hello
              Did you solve this problem of Barcode scanning on IOS?
              If Yes, could you please share the solution?

              A Qt Enthusiastic...

              T 1 Reply Last reply
              0
              • lukas_kosinskiL Offline
                lukas_kosinskiL Offline
                lukas_kosinski
                wrote on last edited by
                #6

                Hi @TheCrowKaka! You can scan/generate barcodes, and QR codes on IOS using SCodes. It's based on recent C++ Zxing port. Check it out here.

                1 Reply Last reply
                0
                • T TheCrowKaka

                  @tomaslov
                  Hello
                  Did you solve this problem of Barcode scanning on IOS?
                  If Yes, could you please share the solution?

                  T Offline
                  T Offline
                  tomaslov
                  wrote on last edited by
                  #7

                  @TheCrowKaka Yes, we now have the same solution running on Windows desktop, Android and iOS, basicly using this method: https://www.kdab.com/efficient-barcode-scanning-qzxing/

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved