Siam Active Member Licensed User Longtime User Aug 12, 2015 #1 Hello, is it Possible that i can use Inline Java Code only in The main Activity ? if i put the inline Java code in the main Activity it works. if i Put it into Code or Class Module i receive this error: java.lang.RuntimeException: Method: chkssl2 not found in: b4a.example.main the test code i use ist in the main: ssl.startssl("http://kleinersonnenschein.de") and in the class module with the name ssl: Sub Process_Globals Dim NativeMe As JavaObject End Sub Sub startssl(url As String) NativeMe.InitializeContext Log ("b4a log : "&NativeMe.RunMethod("chkssl2",Array(url))) End Sub #if java public String chkssl2(String Server) { BA.Log("response "+ Server); return "test"; } #end if
Hello, is it Possible that i can use Inline Java Code only in The main Activity ? if i put the inline Java code in the main Activity it works. if i Put it into Code or Class Module i receive this error: java.lang.RuntimeException: Method: chkssl2 not found in: b4a.example.main the test code i use ist in the main: ssl.startssl("http://kleinersonnenschein.de") and in the class module with the name ssl: Sub Process_Globals Dim NativeMe As JavaObject End Sub Sub startssl(url As String) NativeMe.InitializeContext Log ("b4a log : "&NativeMe.RunMethod("chkssl2",Array(url))) End Sub #if java public String chkssl2(String Server) { BA.Log("response "+ Server); return "test"; } #end if
Erel B4X founder Staff member Licensed User Longtime User Aug 12, 2015 #2 See the example attached to the tutorial: https://www.b4x.com/android/forum/threads/inline-java-code.50141/ It is possible to add inline code to all modules. Upvote 0
See the example attached to the tutorial: https://www.b4x.com/android/forum/threads/inline-java-code.50141/ It is possible to add inline code to all modules.
Siam Active Member Licensed User Longtime User Aug 12, 2015 #3 super Thank you !!!! one question to the Inline Java funktion if i Compile this to a Library is there a way to set the Permissions ? in my case i need android.permission.INTERNET this seems not to work : @Permissions(values={"android.permission.INTERNET"}) and the entry in the manifest file seems to be ignored. greetings andy Upvote 0
super Thank you !!!! one question to the Inline Java funktion if i Compile this to a Library is there a way to set the Permissions ? in my case i need android.permission.INTERNET this seems not to work : @Permissions(values={"android.permission.INTERNET"}) and the entry in the manifest file seems to be ignored. greetings andy
Erel B4X founder Staff member Licensed User Longtime User Aug 13, 2015 #4 You can edit the generated xml and add the permission. Start a new thread for more information. Upvote 0