This will display the current pid of the running application.
B4X:
Dim jo As JavaObject
jo.InitializeStatic("java.lang.management.ManagementFactory")
Dim pid As String = jo.RunMethodJO("getRuntimeMXBean",Null).RunMethod("getName",Null)
Log("this pid : " & pid.SubString2(0,pid.IndexOf("@")))