开发者

Is there a way to detect whether Sense UI is running on a device?

开发者 https://www.devze.com 2023-01-06 19:29 出处:网络
Is there any way in Android to determine whether a device is running Sense UI? I\'m work开发者_如何学JAVAing on an app that is working fine with vanilla Android, but Sense UI is messing with layouts a

Is there any way in Android to determine whether a device is running Sense UI? I'm work开发者_如何学JAVAing on an app that is working fine with vanilla Android, but Sense UI is messing with layouts and sizes. I'd like to be able to see whether the device is running Sense UI and so I can take appropriate action.


There is nothing built into Android that indicates what sorts of modifications like Sense are running on the device. You would either need to use PackageManager to look for HTC Sense components or use the Build class to determine what model device you are on. In either case, you would need to keep updating that "sniffing" logic as Sense is changed and is rolled out to new devices.

but Sense UI is messing with layouts and sizes

If you have a reproducible test case with source code that demonstrates these problems, I would be interested in seeing it.

There are only two scenarios I can think of that would fit your description:

  1. App widgets may display differently on the HTC Sense home screen, just as they may display differently on other home screens. Ideally, there would be no modification, but since you are running in another app's process, I can't rule it out.

  2. If you rely on android.R resources, those might have been modified by HTC as part of creating Sense, though you can always grab the standard ones from your SDK and ship them with your app.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号