'retrieves android.content.pm.PackageInfo
'throws PackageManager.NameNotFoundException if a package with the given name can not be found on the system
Sub getPackageInfo(packageName As String, flags As Int) As Object
Dim pmObj As Reflector
pmObj.Target = getPackageManager
Return pmObj.RunMethod3("getPackageInfo", packageName, "java.lang.String", flags, "java.lang.int")
End Sub
'retrieves field of android.content.pm.PackageInfo
Sub getPackageInfoField(packageInfo As Object, fieldName As String) As Object
Dim piField As Reflector
piField.Target = packageInfo
Return piField.GetField(fieldName)
End Sub
'retrieves android.content.pm.ApplicationInfo
Sub getApplicationInfo(packageInfo As Object) As Object
Return getPackageInfoField(packageInfo, "applicationInfo") 'ApplicationInfo
End Sub
'retrieves field of android.content.pm.ApplicationInfo
Sub getApplicationInfoField(applicationInfo As Object, fieldName As String) As Object
Dim aiField As Reflector
aiField.Target = applicationInfo
Return aiField.GetField(fieldName)
End Sub
'retrieves application public source dir
Sub getApplicationPublicSourceDir(applicationInfo As Object) As String
Return getApplicationInfoField(applicationInfo, "publicSourceDir")
End Sub