I have the method below. It gets all the apps on a device and looks for particular ones by name: Hangouts, Skype, Viber, WhatsApp. All 4 are installed on a Motorola Droid MAXX running Android 4.4.4. and a Samsung SM-T530NU with 5.0.2.
On both devices, it does not find Hangouts. Any ideas why this is?
Output:
com.skype.raider/.Main m=0x108000} Intent filter: null
com.viber.voip/.WelcomeActivity m=0x108000} Intent filter: null
com.whatsapp/.Main m=0x108000} Intent filter: null
I removed the if condition and list all the apps and search by hand (so to speak). I saw nothing about hangouts, hang, ho, ...
public static List<ResolveInfo> getAllInstalledApps(Context context) {
Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
List<ResolveInfo> appsList = context.getPackageManager().queryIntentActivities(mainIntent, 0);
for (ResolveInfo resolveInfo : appsList) {
String infoString = resolveInfo.toString();
if (infoString.contains("hangouts") ||
infoString.contains("skype") ||
infoString.contains("viber") ||
infoString.contains("whatsapp")) {
Log.i("getAllInstalledApps", resolveInfo.toString() + " Intent filter: " + resolveInfo.filter);
}
}
return appsList;
}
The app package name for Hangouts is actually
com.google.android.talk
. You should be looking for that. A tip for looking for package names is to go to the URL of the product page. It's part of theid
query in the URL. For example, the URL for Google Hangouts is:https://play.google.com/store/apps/details?id=com.google.android.talk