Filter SystemApp from getInstalled app
<p>I am developing one app in which i am getting Installed app from system.and display in listview successfully. i got each thing successfully. but now here it getting me system app also that i dont want.
System app like ... Browser,setting,Alarm clock like this so that i dont needed. so what i do to filter this?
can you help me out this...</p>

<p><strong>Code ::</strong></p>

<pre><code>private ArrayList&lt;PInfo&gt; getInstalledApps(boolean getSysPackages) {
        ArrayList&lt;PInfo&gt; res = new ArrayList&lt;PInfo&gt;();
        List&lt;PackageInfo&gt; packs = getPackageManager().getInstalledPackages(0);

        for (int i = 0; i &lt; packs.size(); i++) {
            PackageInfo p = packs.get(i);
            // Fill PackageInfo
            if ((!getSysPackages) &amp;&amp; (p.versionName == null)) {
                continue;
            }

            PInfo newInfo = new PInfo();
            newInfo.appname = p.applicationInfo.loadLabel(getPackageManager())
                    .toString();

            newInfo.pname = p.packageName;
            newInfo.versionName = p.versionName;
            newInfo.versionCode = p.versionCode;

            PackageManager pm = getPackageManager();

            ApplicationInfo appInfo;
            try {
                // Get all app information in Application info
                appInfo = pm.getApplicationInfo(newInfo.pname, 0);

                String appFile = appInfo.sourceDir;
                newInfo.size = String.valueOf(new File(appFile).length());

                long installed = new File(appFile).lastModified();
                newInfo.date = String.valueOf(installed);

                Date dtappdate = new Date(installed);
                newInfo.instdate = String.valueOf(dtappdate.toString());

            } catch (NameNotFoundException e) {
                e.printStackTrace();

            }catch (Exception e) {
                e.printStackTrace();
            }
            newInfo.icon = p.applicationInfo.loadIcon(getPackageManager());
            res.add(newInfo);
        }
        return res;
    }
</code></pre>
