P Pesciolina Active Member Licensed User Longtime User Dec 31, 2024 #1 I migrated the app with the camera reader to B4a Page and the PlayTone function no longer works, what does it depend on? B4X: Copy Sub Class_Globals Private NativeMe As JavaObject End Sub Private Sub FoundBarcode (msg As String) EditTextNumero.Text = msg NativeMe.RunMethod("playTone", Null) Dim tim As Long = 100 NativeMe.RunMethod("vibrateOnce", Array(tim)) End Sub B4X: Copy Logger connesso a: wheatek WP36 --------- beginning of main Error occurred on line: 559 (B4XMainPage) java.lang.RuntimeException: Method: playTone not found in: b4a.SendBiB.main at anywheresoftware.b4j.object.JavaObject$MethodCache.getMethod(JavaObject.java:363) at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:120) at b4a.SendBiB.b4xmainpage._foundbarcode(b4xmainpage.java:830) at b4a.SendBiB.b4xmainpage._camera1_preview(b4xmainpage.java:810) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732) at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351) at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157) at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1114) at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:1069) at b4a.SendBiB.cameraexclass._camera_preview(cameraexclass.java:387) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732) at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351) at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157) at anywheresoftware.b4a.BA.raiseEvent(BA.java:201) at anywheresoftware.b4a.objects.CameraW$2$1$1.onPreviewFrame(CameraW.java:147) at android.hardware.Camera$EventHandler.handleMessage(Camera.java:1238) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7937) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:569) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1019)
I migrated the app with the camera reader to B4a Page and the PlayTone function no longer works, what does it depend on? B4X: Copy Sub Class_Globals Private NativeMe As JavaObject End Sub Private Sub FoundBarcode (msg As String) EditTextNumero.Text = msg NativeMe.RunMethod("playTone", Null) Dim tim As Long = 100 NativeMe.RunMethod("vibrateOnce", Array(tim)) End Sub B4X: Copy Logger connesso a: wheatek WP36 --------- beginning of main Error occurred on line: 559 (B4XMainPage) java.lang.RuntimeException: Method: playTone not found in: b4a.SendBiB.main at anywheresoftware.b4j.object.JavaObject$MethodCache.getMethod(JavaObject.java:363) at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:120) at b4a.SendBiB.b4xmainpage._foundbarcode(b4xmainpage.java:830) at b4a.SendBiB.b4xmainpage._camera1_preview(b4xmainpage.java:810) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732) at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351) at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157) at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1114) at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:1069) at b4a.SendBiB.cameraexclass._camera_preview(cameraexclass.java:387) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732) at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351) at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157) at anywheresoftware.b4a.BA.raiseEvent(BA.java:201) at anywheresoftware.b4a.objects.CameraW$2$1$1.onPreviewFrame(CameraW.java:147) at android.hardware.Camera$EventHandler.handleMessage(Camera.java:1238) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7937) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:569) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1019)
teddybear Well-Known Member Licensed User Dec 31, 2024 #2 What is the NativeMe‘s reference? which app are you migrating? Upvote 0
DonManfred Expert Licensed User Longtime User Dec 31, 2024 #3 Pesciolina said: what does it depend on? Click to expand... on the inlinejava from the example your copied your code from. Check the examples inline jaja-code Last edited: Dec 31, 2024 Upvote 0
Pesciolina said: what does it depend on? Click to expand... on the inlinejava from the example your copied your code from. Check the examples inline jaja-code
P Pesciolina Active Member Licensed User Longtime User Dec 31, 2024 #4 Thanks for opening my eyes. I had put the Java code in the MainPage page and not under Main. Happy New Year 2025 Upvote 0
Thanks for opening my eyes. I had put the Java code in the MainPage page and not under Main. Happy New Year 2025