Search code examples
androidandroid-widgetsamsung-touchwiz

How to tell if a device is using TouchWiz programmatically


I need to check from within my code whether the device I am using has TouchWiz enabled. I tried using

if(android.os.Build.MANUFACTURER.equals(MANUFACTURER_SAMSUNG))

But it turns out some devices are made by Samsung and don't use TouchWiz.

How can I figure this out?


Solution

  • check the default launcher.. i believe touchwiz is a launcher

    final Intent intent = new Intent(Intent.ACTION_MAIN); 
    intent.addCategory(Intent.CATEGORY_HOME); 
    final ResolveInfo res = getPackageManager().resolveActivity(intent, 0); 
    if (res.activityInfo == null) {
        // should not happen. A home is always installed, isn't it?
    } if ("android".equals(res.activityInfo.packageName)) {
        // No default selected     
    } else {
         // res.activityInfo.packageName and res.activityInfo.name gives you the default app
    }