androidwear-osandroid-sensorssamsung-galaxy-gear

Does the integer type of sensors differ between smartwatches?


This might be a dumb question but i'm working on a project that uses smartwatch sensors either than the default accelerometer, gyroscope, etc.. sensors. So like PPG SDNN, PPG SPO2 and so on. My question is does the type integer differ from each smartwatch device? For example im using a Ticwatch 3 and the PPG SPO2 has the int type of 69640 and the SDNN is 69641. Will this be different on a Samsung watch if they have the same sensors or is it a standard and the same throughout all different smartwatches.

I saw this section on the documentation but it mainly talks about the availability of the sensors and not about what im asking


Solution

  • getType() should return the type of the sensor. Many of those will be part of the Android SDK (e.g., TYPE_ACCELEROMETER). Those types are standardized: if two watches have an accelerometer sensor, they each should have a Sensor for which getType() returns TYPE_ACCELEROMETER (which happens to be 1).

    Neither 69640 nor 69641 correspond to standard Sensor type constants, ones that are part of the Android SDK. There is no guarantee that any given watch will have a Sensor for which getType() returns either 69640 or 69641. Even for those watches that do, I would not assume that they are the same type of sensor between watch models. Once you veer off into undocumented, manufacturer-defined constants like these, there are no guarantees.