Hammad Shahid
Hammad Shahid

Reputation: 2216

How to find list of third party installed applications programmatically in android

I am using this code to the third party applications :

 List<ApplicationInfo> packages = pm.getInstalledApplications(PackageManager.GET_META_DATA);

    for (ApplicationInfo appInfo : packages)
    {
        if ((appInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0)
        {
            // IS A SYSTEM APP
        }
        else
        {
            // Third Party Applications
        }
    }

This code is almost working fine , but I am not getting some third party applications. Like Gmail , Google Play Store. Some applications which I am getting are Google Play Services , Skype.

What could be the problem ? Am I missing some flags ?

Upvotes: 3

Views: 2153

Answers (1)

Hammad Shahid
Hammad Shahid

Reputation: 2216

I found the answer , I was missing this flag

ApplicationInfo.FLAG_UPDATED_SYSTEM_APP

Upvotes: 4

Related Questions