# Sensors, Haptics & Biometrics

> Use the accelerometer, gyroscope and other sensors, give tactile feedback with haptics, and unlock features with Face ID or fingerprint. Free notes, key...

Canonical: https://www.internhack.in/roadmaps/tracks/mobile/sensors-biometrics
Last updated: 2026-11-28

Use the accelerometer, gyroscope and other sensors, give tactile feedback with haptics, and unlock features with Face ID or fingerprint.

Intermediate · about 5 hours · difficulty 3/5

Learn first: [Runtime Permissions & Privacy](https://www.internhack.in/roadmaps/tracks/mobile/permissions), [Local Storage: Key-value, SQLite & Files](https://www.internhack.in/roadmaps/tracks/mobile/local-storage)

Phones are packed with hardware that web apps rarely touch. A few well-chosen uses make an app feel truly mobile.

### Sensors

- **Accelerometer** and **gyroscope** for shake gestures, tilt effects and motion games.
- **Magnetometer** for compass headings, **barometer** for altitude, **pedometer** for step counts.
- Libraries: expo-sensors, sensors_plus, Android `SensorManager`, iOS Core Motion.
- Subscribe only while needed and choose a sensible update interval; high-frequency sensor streams cost battery and CPU.

### Haptics

Short vibrations confirm actions (success, warning, selection change). Use expo-haptics, `HapticFeedback` in Flutter, or the platform APIs. Keep them subtle and meaningful.

### Biometrics

Face ID, Touch ID and Android BiometricPrompt let users confirm identity locally (expo-local-authentication, local_auth).

- Biometrics **unlock** something already on the device (a stored token or key); they do not authenticate the user to your server by themselves.
- For stronger security, tie a Keychain/Keystore item to biometric access so the secret cannot be read without a successful scan.
- Always provide a fallback (device passcode or password). iOS needs `NSFaceIDUsageDescription`.

**Good enough to move on:** your app can lock sensitive screens behind biometrics with a fallback, and uses haptics for key confirmations.

## Key concepts

- **Accelerometer and gyroscope**
- **Pedometer and other sensors**
- **Sensor update intervals and battery**
- **Haptic feedback**
- **Face ID, Touch ID and BiometricPrompt**
- **Biometric-protected secure storage**
- **Fallback authentication**

## Mini project

Build a private notes app that requires biometrics to open, supports a passcode fallback, and clears the screen when you shake the phone.

## Check yourself

Why does a successful Face ID check alone not prove to your server who the user is?

## Free resources

- [Expo LocalAuthentication](https://docs.expo.dev/versions/latest/sdk/local-authentication/) (Expo)
- [Expo Sensors](https://docs.expo.dev/versions/latest/sdk/sensors/) (Expo)
- [Android: Show a biometric dialog](https://developer.android.com/identity/sign-in/biometric-auth) (Android Developers)

Previous: [Location & Maps](https://www.internhack.in/roadmaps/tracks/mobile/location-maps) · Next: [Background Tasks & App States](https://www.internhack.in/roadmaps/tracks/mobile/background-work)

## More in Device Capabilities & Background Work

- [Runtime Permissions & Privacy](https://www.internhack.in/roadmaps/tracks/mobile/permissions)
- [Camera, Photos & Media](https://www.internhack.in/roadmaps/tracks/mobile/camera-media)
- [Location & Maps](https://www.internhack.in/roadmaps/tracks/mobile/location-maps)
- [Sensors, Haptics & Biometrics](https://www.internhack.in/roadmaps/tracks/mobile/sensors-biometrics)
- [Background Tasks & App States](https://www.internhack.in/roadmaps/tracks/mobile/background-work)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Mobile App Developer Roadmap](https://www.internhack.in/roadmaps/tracks/mobile)
