• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Introduction to Sensor Service Kit
2
3## When to Use
4
5Sensor Service Kit enables applications to obtain raw data from sensors and provides vibration control capabilities.
6
7- The sensor module provides APIs for applications to access the underlying sensor hardware. Using these APIs, you can query sensors on your device and subscribe to sensor data. Based on the sensor data obtained, you can customize algorithms and develop various sensor-based applications, such as compass, motion-controlled games, and fitness and health applications.
8  - Local sensors: sensors built into the device. Typical examples include accelerometers, gyroscopes, and temperature sensors.
9  - Dynamic sensors: external sensors. The sensor module supports refined control over dynamic sensors, and listening for status changes (such as connection and disconnection) of dynamic sensors can be enabled or disabled via the **on** or **off** API.
10
11- The vibrator module maximally unlocks the capabilities of the vibrator device. By expanding the vibrator services, it achieves an integrated design of vibration and interaction, creating a delicate and sophisticated vibration experience that takes user interaction efficiency and usability to the next level.
12  - Local vibrators: vibrators built into the device. Typical examples include rotor vibrators and linear vibrators.
13  - Dynamic vibrators: external vibrators, which support independent control and management based on information such as device connection status and vibrator status. Dynamic vibrators are widely used in peripherals, including game controllers and external vibrators.
14
15
16## Constraints
17
18### Sensor
19
20- To use sensor functions, ensure that the device where your application runs has the required sensor components.
21
22- To obtain data of some sensors, you need to request the required permissions.
23
24- The APIs for subscribing to and unsubscribing from sensor data work in pairs. If you do not need sensor data, call the unsubscription API to stop sensor data reporting.
25
26- If a dynamic sensor is disconnected, the application needs to disable listening for sensor data changes.
27
28### Vibrator
29
30- To use vibrator functions, ensure that the device where your application runs has the required misc components.
31- To use vibrators, you need to request the required permissions.
32- If there are multiple devices and vibrators, the application must determine which vibrator to use.
33