Hi all,
i'm writing my first app that run in android bar code scanner (DataLogic DL-Axist) with android 4.4.4.
For test i use intent wedge available in this scanner with this code:
(MAIN)
#Region Project Attributes
#ApplicationLabel: Scantest
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim ScanTxt As String
Dim Timer1 As Timer
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim ScanLabel As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
Timer1.Initialize("Timer1", 100)
Timer1.Enabled= True
Activity.LoadLayout("Main")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Timer1_Tick
ScanLabel.Text=ScanTxt
End Sub
(In service module: WedgeService)
#Region Service Attributes
#StartAtBoot: False
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Service_Create
End Sub
Sub Service_Start (StartingIntent As Intent)
If StartingIntent.Action ="com.datalogic.decodewedge.decode_action" Then
Log("Extra :"& StartingIntent.GetExtra("com.datalogic.decode.intentwedge.barcode_string"))
Main.ScanTxt=StartingIntent.GetExtra("com.datalogic.decode.intentwedge.barcode_string")
End If
End Sub
Sub Service_Destroy
End Sub
(MANIFEST EDITOR)
'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="14"/>
<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, "@android:style/Theme.Holo")
AddReceiverText(WedgeService, <intent-filter>
<action android:name="com.datalogic.decodewedge.decode_action" />
<category android:name="com.datalogic.decodewedge.decode_category" />
<extra android:name="com.datalogic.decodewedge.intentwedge.barcode_string" />
</intent-filter>)
The code run correctly for first scan and for all scans but only if wait about 10..15 seconds between 2 scans.
if scans are fast (every 2..3 seconds) the intent service "store" all scans that appear together in logs view after 10..15 seconds.
I test code in debug mode and also in release mode with BA7.30.
I notice that sometimes on app appear a toast message "Waiting for IDE debugger to connect" but i had compiled in release mode for sure.
I try to unintall app and install again from APK deleting cache and data with no results.
Any suggestion about this strange topic?
thanks
i'm writing my first app that run in android bar code scanner (DataLogic DL-Axist) with android 4.4.4.
For test i use intent wedge available in this scanner with this code:
(MAIN)
#Region Project Attributes
#ApplicationLabel: Scantest
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim ScanTxt As String
Dim Timer1 As Timer
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim ScanLabel As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
Timer1.Initialize("Timer1", 100)
Timer1.Enabled= True
Activity.LoadLayout("Main")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Timer1_Tick
ScanLabel.Text=ScanTxt
End Sub
(In service module: WedgeService)
#Region Service Attributes
#StartAtBoot: False
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Service_Create
End Sub
Sub Service_Start (StartingIntent As Intent)
If StartingIntent.Action ="com.datalogic.decodewedge.decode_action" Then
Log("Extra :"& StartingIntent.GetExtra("com.datalogic.decode.intentwedge.barcode_string"))
Main.ScanTxt=StartingIntent.GetExtra("com.datalogic.decode.intentwedge.barcode_string")
End If
End Sub
Sub Service_Destroy
End Sub
(MANIFEST EDITOR)
'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="14"/>
<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, "@android:style/Theme.Holo")
AddReceiverText(WedgeService, <intent-filter>
<action android:name="com.datalogic.decodewedge.decode_action" />
<category android:name="com.datalogic.decodewedge.decode_category" />
<extra android:name="com.datalogic.decodewedge.intentwedge.barcode_string" />
</intent-filter>)
The code run correctly for first scan and for all scans but only if wait about 10..15 seconds between 2 scans.
if scans are fast (every 2..3 seconds) the intent service "store" all scans that appear together in logs view after 10..15 seconds.
I test code in debug mode and also in release mode with BA7.30.
I notice that sometimes on app appear a toast message "Waiting for IDE debugger to connect" but i had compiled in release mode for sure.
I try to unintall app and install again from APK deleting cache and data with no results.
Any suggestion about this strange topic?
thanks