Until now I used PackageManager to check which applications were installed (for example WhatsApp)
Currently google requires QUERY_ALL_PACKAGES in Manifest in order to have a list of Installed Packages.
Is it possible to know if WhatsApp is installed, via tried through some kind of Try-Catch error?
Currently google requires QUERY_ALL_PACKAGES in Manifest in order to have a list of Installed Packages.
Is it possible to know if WhatsApp is installed, via tried through some kind of Try-Catch error?
B4X:
Sub APKinstalada(packagename As String) As Boolean
Try
Dim PM As PackageManager
Dim ApplicationLabel As String = PM.GetApplicationLabel(packagename)
log("Installed: " & ApplicationLabel)
Return True
Catch
log("Not Installed: " & packagename)
Return False
End Try
End Sub
B4X:
Dim pm As PackageManager
Dim in As Intent
in = pm.GetApplicationIntent("com.somewhat.package")
If in.IsInitialized Then
' Package is installed
End If
Last edited: