Android Question Qr code not working when implemented into my project

toss

Member
Licensed User
Today at 1:40 PM

i came across your post on qr code scanner but when i try to implement the code in my project and execute it won't show anything rather it will log message "*** gniytvb: B4XPage_Appear [gniytvb]" and "Result has arrived" and "** Activity (main) Pause event (activity is not paused). **" and "*** gniytvb: B4XPage_Disappear [gniytvb]" and "onActivityResult: wi is null" and "** Activity (main) Resume **"

this is the post https://www.b4x.com/android/forum/t...s-and-other-1d-2d-barcodes.49084/page-7#posts

this is my code

B4X:
Sub Class_Globals
    Private Root As B4XView 'ignore
    Private xui As XUI 'ignore
    
    Dim zx As JhsIceZxing1
    Private btn_scan As B4XView
End Sub

'You can add more parameters here.
Public Sub Initialize As Object
    Return Me
End Sub

'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    'load the layout to Root
Root.LoadLayout("scannerD")
    
End Sub
Private Sub btn_scan_Click
    
    zx.isportrait = True
    zx.useFrontCam = False
    zx.theFrameColor = Colors.Red
    zx.theLaserColor = Colors.Green
    zx.theMaskColor = Colors.Blue
    zx.theResultColor = Colors.Yellow
    zx.theResultPointColor = Colors.Magenta
    zx.BeginScan("myzx")
End Sub
Sub myzx_result(atype As String,Values As String)
    Log("type:" & atype &  "Values:" & Values)
    Msgbox(Values,"type:" & atype)

End Sub

'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
 

Johan Schoeman

Expert
Licensed User
Longtime User
Today at 1:40 PM

i came across your post on qr code scanner but when i try to implement the code in my project and execute it won't show anything rather it will log message "*** gniytvb: B4XPage_Appear [gniytvb]" and "Result has arrived" and "** Activity (main) Pause event (activity is not paused). **" and "*** gniytvb: B4XPage_Disappear [gniytvb]" and "onActivityResult: wi is null" and "** Activity (main) Resume **"

this is the post https://www.b4x.com/android/forum/t...s-and-other-1d-2d-barcodes.49084/page-7#posts

this is my code

B4X:
Sub Class_Globals
    Private Root As B4XView 'ignore
    Private xui As XUI 'ignore
   
    Dim zx As JhsIceZxing1
    Private btn_scan As B4XView
End Sub

'You can add more parameters here.
Public Sub Initialize As Object
    Return Me
End Sub

'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    'load the layout to Root
Root.LoadLayout("scannerD")
   
End Sub
Private Sub btn_scan_Click
   
    zx.isportrait = True
    zx.useFrontCam = False
    zx.theFrameColor = Colors.Red
    zx.theLaserColor = Colors.Green
    zx.theMaskColor = Colors.Blue
    zx.theResultColor = Colors.Yellow
    zx.theResultPointColor = Colors.Magenta
    zx.BeginScan("myzx")
End Sub
Sub myzx_result(atype As String,Values As String)
    Log("type:" & atype &  "Values:" & Values)
    Msgbox(Values,"type:" & atype)

End Sub

'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
Show me your BA4 manifest file.
 
Upvote 0

toss

Member
Licensed User
this is my manifest
B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="29"/>
<supports-screens android:largeScreens="true" 
    android:normalScreens="true" 
    android:smallScreens="true" 
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.



SetApplicationAttribute(android:theme, "@style/LightTheme")
CreateResource(values, colors.xml,
<resources>
    <color name="actionbar">#073D6A</color>
   <color name="statusbar">#ff006db3</color>
   <color name="textColorPrimary">#ffffffff</color>
   <color name="navigationBar">#073D6A</color>
</resources>
)
CreateResource(values-v20, theme.xml,
<resources>
    <style name="LightTheme" parent="@android:style/Theme.Material.Light">
        <item name="android:colorPrimary">@color/actionbar</item>
        <item name="android:colorPrimaryDark">@color/statusbar</item>
        <item name="android:textColorPrimary">@color/textColorPrimary</item>
        <item name="android:navigationBarColor">@color/navigationBar</item>
    </style>
</resources>
)

CreateResource(values-v14, theme.xml,
<resources>
    <style name="LightTheme" parent="@android:style/Theme.Holo.Light">
       <item name="android:actionBarStyle">@style/CustomActionBarStyle</item>
    </style>
   <style name="CustomActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
       <item name="android:background">@color/actionbar</item>
   </style>
</resources>
)
' 28 - Non-ssl (non-https) communication is not permitted by default.
' It can be enabled in B4A v9+ by adding this line to the manifest editor:
CreateResourceFromFile(Macro, Core.NetworkClearText)



[code]
 
Upvote 0
Top