Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect HTC Sense?

Can I somehow detect if my app is running on HTC Sense?

More generally, the problem is, that I have a Button with custom drawable. It's something very similar to the account switcher in the top right of Gmail app. When pressed or focused, the button has orange highlight. But that doesn't look nice on HTC Sense - because the standard highlight color there is green.

like image 822
fhucho Avatar asked Sep 09 '10 13:09

fhucho


People also ask

What is Home Sense on HTC phone?

HTC Sense™ Home is a behaviour-detecting homescreen widget that uses a geo fence to surface apps that you need based on your location. Using your preferences, it provides the tools that you need based on three categories: home, work or out. Your homescreen auto loads with the apps that you use throughout your day.

Why won't my HTC phone connect to my computer?

Check the cable connection Make sure you connect your phone to a USB 2.0 or faster port on your computer. Try a different USB cable. Make sure to use an HTC-branded cable. Try connecting your phone to another computer that has the latest HTC Sync Manager version installed.


2 Answers

Lets see android.os.Build strings I am not sure what the HTC folks use a combination to indicate a HTC sense device..

like image 177
Fred Grott Avatar answered Oct 12 '22 18:10

Fred Grott


Here's a link suggesting a way to detect HTC Sense on the device, about 1/3 the way down the discussion. I've tested on Desire and Desire Z.

Code is below (from a user: David):

private static final String SENSE_UI_LAUNCHER_NAME = 
          "com.htc.launcher.Launcher"; 
    private static Boolean senseUI; 

    public static final boolean isSenseUI(Context context) {
        if (senseUI == null) {
            senseUI = false;
            PackageManager packageManager = context.getPackageManager();

            Intent intent = new Intent(Intent.ACTION_MAIN);
            intent.addCategory(Intent.CATEGORY_HOME);
            List<ResolveInfo> list = packageManager.queryIntentActivities(
                    intent, PackageManager.MATCH_DEFAULT_ONLY);
            for (ResolveInfo info : list) {
                if (info.activityInfo != null
                        && SENSE_UI_LAUNCHER_NAME
                                .equals(info.activityInfo.name)) {
                    senseUI = true;
                    break;
                }
            }
        }
        return senseUI;
    }
like image 23
scottyab Avatar answered Oct 12 '22 17:10

scottyab