I want to implement a list showing Android applications using them on the Internet. First of all, I have to list all the applications, I did this with the PackageManager, for example:
packageManager = getPackageManager();
List<PackageInfo> packageList = packageManager
.getInstalledPackages(PackageManager.GET_META_DATA);
apkList = (ListView) findViewById(R.id.applist);
apkList.setAdapter(new ApkAdapter(this, packageList, packageManager));
But this code lists all system applications, as well as: Android Sytem, โโCalculator, Calender, Status Bar, Live Wallpapers, etc., which are not suitable. I tried filtering system applications using:
for(PackageInfo pi : packageList) {
boolean b = isSystemPackage(pi);
if(!b) {
packageList1.add(pi);
}
}
But then the code only displays installed applications, such as whatsapp, tango, foursquare, etc. It does not show applications such as gmail, facebook, browser, maps. Can anyone suggest how I write code that only displays a list of applications that actually use the Internet. Thanks in advance!