Public Sub ListApplication
Dim args(1) As Object
Dim Obj1, Obj2, Obj3 As Reflector
Dim size, i, flags As Int
Dim Types(1), Name, Pkn As String
Obj1.Target = Obj1.GetContext
Obj1.Target = Obj1.RunMethod("getPackageManager")
Obj2.Target = Obj1.RunMethod2("getInstalledPackages", 0, "java.lang.int")
size = Obj2.RunMethod("size")
For i = 0 To size -1
Obj3.Target = Obj2.RunMethod2("get", i, "java.lang.int")
Pkn = Obj3.GetField("packageName")
Obj3.Target = Obj3.GetField("applicationInfo")
flags = Obj3.GetField("flags")
If Bit.And(flags, 1) = 0 Then
args(0) = Obj3.Target
Types(0) = "android.content.pm.ApplicationInfo"
Name = Obj1.RunMethod4("getApplicationLabel", args, Types)
Log("Name: " & Name)
Log("PackageName:" & Pkn)
'StartApp(Pkn)
End If
Next
End Sub