Sub App_Exist(package As String) As Boolean
Private appExist As Boolean = False
Dim pm As PackageManager
Dim packages As List
packages = pm.GetInstalledPackages
For i = 0 To packages.Size - 1
If package = packages.Get(i) Then appExist = True
Next
Return appExist
End Sub
Sub Download_App(package As String)
Try
Private withGooglePlay As Intent
withGooglePlay.Initialize (withGooglePlay.ACTION_VIEW, "market://details?id=" & package)
StartActivity (withGooglePlay)
Catch
Private withoutGooglePlay As Intent
withoutGooglePlay.Initialize (withoutGooglePlay.ACTION_VIEW, "https://play.google.com/store/apps/details?id=" & package)
StartActivity (withoutGooglePlay)
End Try
End Sub