0
0
React Nativemobile~5 mins

Device info and haptics in React Native - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the purpose of the react-native-device-info library?
It provides easy access to device information like model, system version, unique ID, and more, helping apps adapt to different devices.
Click to reveal answer
beginner
How do you trigger a simple vibration in React Native?
Use the Vibration.vibrate() method from the react-native module to make the device vibrate.
Click to reveal answer
beginner
What is haptic feedback and why is it useful in mobile apps?
Haptic feedback is a tactile response (like vibration) that confirms user actions, improving user experience by making interactions feel more natural.
Click to reveal answer
intermediate
Name one way to get the device's unique ID in React Native.
Using DeviceInfo.getUniqueId() from the react-native-device-info library returns a unique identifier for the device.
Click to reveal answer
intermediate
What should you consider when using vibration on different devices?
Different devices support different vibration patterns and durations; also, some users may disable vibration, so always provide alternative feedback.
Click to reveal answer
Which React Native module is used to access device vibration?
AHaptics
BDeviceInfo
CSensors
DVibration
What does DeviceInfo.getSystemVersion() return?
AUnique device ID
BDevice model name
COperating system version
DBattery level
Why is haptic feedback important in mobile apps?
ATo provide tactile confirmation of user actions
BTo improve app speed
CTo save battery life
DTo change screen brightness
Which of these is NOT a typical device info property?
AUser's password
BSystem version
CDevice model
DUnique device ID
How can you make a device vibrate for 1 second in React Native?
AVibration.vibrate()
BVibration.vibrate(1000)
CVibration.vibrate(true)
DVibration.vibrate('1s')
Explain how you would use React Native to get device information and provide haptic feedback in an app.
Think about libraries and modules that give device details and how vibration can improve user experience.
You got /3 concepts.
    Describe some challenges you might face when using vibration and device info across different mobile devices.
    Consider how Android and iOS might behave differently and user preferences.
    You got /3 concepts.