I am developing an application which lists all application installed in users mobile. I retrieved all applications and I listed it in RecyclerView. Now I want to separate Social Media applications from that list for some other purposes. Is there any way to separate Social Media Apps ? I am using below code to retrieve all apps package names from phone.
public List<String> GetAllInstalledApkInfo(){
List<String> ApkPackageName = new ArrayList<>();
Intent intent = new Intent(Intent.ACTION_MAIN,null);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED );
List<ResolveInfo> resolveInfoList = context1.getPackageManager().queryIntentActivities(intent,0);
for(ResolveInfo resolveInfo : resolveInfoList){
ActivityInfo activityInfo = resolveInfo.activityInfo;
ApkPackageName.add(activityInfo.applicationInfo.packageName);
}
return ApkPackageName;
}