B4A Library MVBarcodeReader

A wrap for this Github project (read this Github post to understand how this scanner works). Have tested it on Kitkat and Lollipop. It does not return anything to the B4A project. I am posting the Java source code so I will leave it up to you to amend the code to return scanned barcode info the B4A project.

Download and extract DemoRes.zip, LibRes.zip, and sources.zip and then copy these folders and their content so that all 3 of them are on the same folder level as that of the /Files and /Objects folders of the attached B4A project.

Posting:
1. B4A sample project
2. B4A library files
3. Here is a link to other jars that you will require - https://www.dropbox.com/s/s0dibwvgee9qawi/MVBarcodeREaderOtherJars.zip?dl=0
4. The java code. You need to create a libs folder on the same folder level as the src folder and copy the jars from the link in (3) above into this libs folder to compile the java code. You also need to copy the jars from the link in (3) above to your additional library folder.

Set your path correctly for the following in the B4A project:
B4X:
#AdditionalRes: C:\Android\extras\android\support\v7\appcompat\res, android.support.v7.appcompat
#AdditionalRes: C:\Android\extras\google\google-play-services\libproject\google-play-services_lib\res, com.google.android.gms
#AdditionalRes: C:\Android\extras\android\support\design\res, android.support.design

Take note of the B4A Manifest file:
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="22"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
SetApplicationAttribute(android:theme, "@style/MyAppTheme")
AddApplicationText(<activity android:name="devliving.online.mvbarcodereadersample.MainActivity">
        </activity>)
    
AddApplicationText(<meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
        <meta-data
            android:name="com.google.android.gms.vision.DEPENDENCIES"
            android:value="barcode" />
        <activity android:name="devliving.online.mvbarcodereader.BarcodeCaptureActivity"
            android:screenOrientation="portrait" android:configChanges="orientation|keyboardHidden">
        </activity>)        
    


AddManifestText(<uses-feature android:name="android.hardware.camera" />)

1.png


2.png



3.png


6.png
 

Attachments

  • MVBarcodeReaderLibFiles.zip
    61.4 KB · Views: 320
  • b4aMVBarcodeReader.zip
    8.6 KB · Views: 266
  • TheJavaCode.zip
    34.6 KB · Views: 250
  • LibRes.zip
    18.3 KB · Views: 260
  • DemoRes.zip
    14.5 KB · Views: 252
  • resource.zip
    423 bytes · Views: 259
Last edited:
Top