Sub GetPackagename As String
Dim ActMan As JavaObject
Dim R As Reflector
R.Target=R.GetContext
'Get Activity Manager Object
ActMan = R.RunMethod2("getSystemService","activity","java.lang.String")
Dim TaskInfo As JavaObject = ActMan.RunMethod("getRunningTasks",Array As Object(1))
Dim CompInfo As JavaObject = TaskInfo.RunMethodJO("get",Array As Object(0)).GetField("topActivity")
Dim PackageName As String = CompInfo.RunMethod("getPackageName",Null)
Return PackageName
End Sub