Implement haptics

Device manufacturers are generally considered the owners of the private assets created for each device. As such, their engineering efforts are often focused on a per-device basis; little to no effort goes to the consistency of other devices in the ecosystem.

In direct contrast, developers strive to build apps that work on all Android phones in the ecosystem, regardless of each device's technical specifications. This difference in approach can cause a fragmentation problem, for example, the hardware capabilities of certain phones don't match expectations set by the app developers. So if the haptics APIs work on some Android phones but not others, the result is an inconsistent ecosystem. This is why hardware configuration plays a critical role in ensuring that manufacturers can implement Android haptics APIs on every device.

This page provides a step-by-step checklist to set up hardware compliance for the best use of the Android haptics APIs.

The following figure illustrates building common knowledge between device manufacturers and developers, which is a critical step in creating a cohesive ecosystem:

Diagram of haptics use cases for app developers and device
manufacturers

Figure 1. Building knowledge between device manufacturers and developers

Haptics implementation checklist

  1. Implement constants

    • List of constants to implement haptics.
  2. Implement primitives

    • Implementation guidance for HAL composition primitives.
  3. Map constants between HAL and API

  4. Assess the hardware

    • Instructions on target haptic effects. Use these instructions to perform quick checks on your hardware.