Hi, I am just started to learn JavaObject lib, trying to use it to call some method.
The following code gives an error: java.lang.IllegalArgumentException: Expected receiver of type android.hardware.camera2.CameraManager, but got java.lang.Class<android.hardware.camera2.CameraManager>.
I don't have any idea on how to write code to use JavaObject.
I write the above codes following the codes in https://www.b4x.com/android/forum/threads/javaobject-library.34486/.
Please give me some advice on how to change the above code to run the method and get the return value.
But the following code does work, which uses Camera2 library to declare JavaObject. "cam2" is declared as Camera2.
The following code gives an error: java.lang.IllegalArgumentException: Expected receiver of type android.hardware.camera2.CameraManager, but got java.lang.Class<android.hardware.camera2.CameraManager>.
B4X:
Dim bo As JavaObject
bo.InitializeStatic("android.hardware.camera2.CameraManager")
Dim tt() As String = bo.RunMethod("getCameraIdList", Null)
I write the above codes following the codes in https://www.b4x.com/android/forum/threads/javaobject-library.34486/.
Please give me some advice on how to change the above code to run the method and get the return value.
But the following code does work, which uses Camera2 library to declare JavaObject. "cam2" is declared as Camera2.
B4X:
Dim tt As List
Dim jo As JavaObject=cam2.GetCameraCharacteristics(0)
tt=jo.RunMethod("getKeys",Null)