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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With