Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Is there any way to get connected Wear OS 3 watch data from Unity built Android app?

Discussion in 'Android' started by Devin_Stewart, Jun 13, 2023.

  1. Devin_Stewart

    Devin_Stewart

    Joined:
    Apr 21, 2015
    Posts:
    5
    I'm currently building an android app with Unity and would like to get workout data like heartrate from a connected android watch that is running wear OS 3 operating system. Is there an easy way to do this? What is a good method for achieving this?
     
  2. CubeJaw

    CubeJaw

    Joined:
    Jan 17, 2020
    Posts:
    3
    you figure it out?
     
  3. Devin_Stewart

    Devin_Stewart

    Joined:
    Apr 21, 2015
    Posts:
    5
    Not yet, but we'll be focusing on this task in the upcoming couple of weeks. Hoping someone has some info for us before we get started.
     
  4. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,682
    I don't think Unity directly supports WearOS, if it works - it works, if it doesn't, I am not sure if bug reports will be accepted.


    Regarding heartrate, Unity doesn't directly supports this sensor, but Unity should report data for it. Check this - https://github.com/Unity-Technologi...InputSystem/Plugins/Android/AndroidSensors.cs

    Assuming, you're using new input system, you'll need to create AndroidHeartRate sensor with variant 'HeartRate',

    then you'll need to register the layout

    Code (CSharp):
    1.             InputSystem.RegisterLayout<AndroidHeartRater>(
    2.                 matches: new InputDeviceMatcher()
    3.                     .WithInterface("Android")
    4.                     .WithDeviceClass("AndroidSensor")
    5.                     .WithCapability("sensorType", AndroidSensorType.HeartRate));
    Alternatively, try submitting a bug, about missing heart rate sensor, but it might take a while to fix it.