Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any method to use to check whether Android Wear is worn or not?

Is there any generic mechanism to check whether the paired Android Wear is worn (and within range)?

The criteria for worn could be one or more of the following: - Wear within range of Phone (connected). - Has a pulse (if device has that capability). - Wear has moved (if device has a motion sensor).

My goal is only to send notifications to the Android Wear from the phone if it is connected and worn. Otherwise it should only be displayed on the phone.

like image 878
hirro Avatar asked Apr 24 '15 09:04

hirro


1 Answers

Motion sensors are your best bet. You can try monitoring changes and if there is none for a certain amount of time, you can treat it as a device not being worn.

However, Google already did that for you: https://developer.android.com/reference/com/google/android/gms/location/DetectedActivity.html ActivityRecognitionApi will give you information about motion of the device, so you don't need to figure these things again yourself.

Most specifically, you are looking for this: https://developer.android.com/reference/com/google/android/gms/location/DetectedActivity.html#STILL

like image 88
gruszczy Avatar answered Oct 21 '22 06:10

gruszczy