Android Question check if an app.package is installed without long getting all packages

peacemaker

Expert
Licensed User
Longtime User
Hi, All

Is any system Android API request to check if some "app.package" is installed ?
Without need to get firstly all packages list of the device, that is sloooow way.
 

DonManfred

Expert
Licensed User
Longtime User
Without need to get firstly all packages on the device, that is sloooow way.
Why you ARE requesting all packes if you just want to check one?
B4X:
    Dim pm As PackageManager
    Dim in As Intent
    in = pm.GetApplicationIntent("com.somewhat.package")
    If in.IsInitialized Then
        ' Package is installed
    End If
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Why you ARE requesting all packes if you just want to check one?

Thanks, Don. I just remember that long ago used such search, and seems, there was no way without getting the whole list firstly. Maybe i remember wrong...
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Not really much here... 109ms for 528 Apps
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
What is the output of this code (release mode):
Indeed, Erel, i have remembered now - the process is slow, if each package name is processed anyhow.
The list itself is got fastly: 300 ms for 170 apps.
Thanks for help.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…