Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mock sensor data on Android wear

Is there anyway I can create mock sensor data on watch emulator? Like heart rate, acceleration, .etc. I have a real Gear Live, but want to make sure it works on round watches, and test there as well. Thanks

like image 796
EyeQ Tech Avatar asked Nov 22 '22 17:11

EyeQ Tech


1 Answers

Yes, you can.

Use synthetic data providers to simulate sensor data from Health Services and test your app as though an exercise were really happening.

Considerations when using the emulator

When using the Wear OS emulator, there are two options available for generating simulated data:

Synthetic data providers: Offers extensive options for data generation. This is the covered throughout the rest of this page.

To use synthetic data providers on the emulator, ensure developer options are enabled.

Emulator extended controls: The emulator in Android Studio offers the extended controls panel, available by clicking the three dots in the button bar. From the extended controls, the developer can load in KML/GPX files to simulate location, or specify the behaviour of the heart rate sensor.

To use extended controls to generate data for health services, ensure that sensor providers are enabled.

Supported metrics

Synthetic data providers currently support the following metrics:

  1. Heart rate
  2. Step count per minute
  3. GPS location (using a single default route)
  4. Duration of the activity
  5. Elevation and floors
  6. Sleep state (asleep/awake)

For more information please refer the following.

https://developer.android.com/training/wearables/health-services/synthetic-data

like image 68
arango_86 Avatar answered Dec 24 '22 17:12

arango_86