atasoyh
atasoyh

Reputation: 3145

How can I detect if device is an android wear?

I have an android library for some common works. I used this library for phone apps. With android wear development, I can use same library on wear projects. But I need to detect if device is an android wear. I can send a parameter with context, like a boolean parameter named isWear ex... But I dont want to do like this. I couldn't find any sample code. How/where should I check on the device?

Thanks.

Upvotes: 0

Views: 215

Answers (1)

gruszczy
gruszczy

Reputation: 42228

Check the Configuration, the ui mode should have the right bit set:

http://developer.android.com/reference/android/content/res/Configuration.html#UI_MODE_TYPE_WATCH

Upvotes: 1

Related Questions