Android Question Inline Java in a Code or Class Module

Siam

Active Member
Licensed User
Longtime User
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
 

Siam

Active Member
Licensed User
Longtime User
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
Top