Hello, I'be been trying to use the JavaObject to access a Java API for a rfid reader sdk.
The fist code I tried is below :
#Region Project Attributes
#ApplicationLabel: Test RFID
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
#AdditionalJar: DeviceAPIver20150929
Sub Process_Globals
Dim mReader As JavaObject
End Sub
Sub Globals
End Sub
Sub Activity_Create(FirstTime As Boolean)
mReader.InitializeStatic("com.rscja.deviceapi.RFIDWithUHF")
mReader.RunMethod("init",Null)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
When running this code, the following exception occurs :
java.lang.IllegalArgumentException: expected receiver of type com.rscja.deviceapi.RFIDWithUHF, but got java.lang.Class<com.rscja.deviceapi.RFIDWithUHF>
in the line
mReader.RunMethod("init",Null)
Next, I tried to use the following :
Sub Activity_Create(FirstTime As Boolean)
Dim F As Boolean
mReader.InitializeNewInstance("com.rscja.deviceapi.RFIDWithUHF",Null)
F =mReader.RunMethod("init",Null)
End Sub
which throws me the error :
java.lang.IllegalAccessException: access to constructor not allowed
I have just a basic knowledge of Java, not enough to determine the cause of the errors...
Could someone please give me some advice on this issue ?
Thanks in advance for your kind assistance.