question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for on-device haptics

See original GitHub issue

Home Assistant Android version: 2.5.0-full Android version: 11 Phone model: Google Pixel 4a Home Assistant version: 0.115.3

Description of ~problem~ feature request:

~My phone supports haptics natively, but I get vibrations when tapping on buttons in the front-end.~

Google Pixel devices have haptics, similar to iPhone devices, and is measured in ms. Instead of a single form of vibration, haptics provide subtle but differential feedback during interactions with the frontend such as tapping buttons or opening menus.

Per Apple’s Human Interface Guidelines, the following options are available for haptics and is currently implemented by devs, so they’re maximum compatible.

https://companion.home-assistant.io/docs/integrations/haptics#developers-integrating-haptics-into-custom-cards

image

Additional information: N/A

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
agneevXcommented, Feb 6, 2021

Thanks for looking into this @dshokouhi.

So we need to basically define what we expect them to do, does apple have the specific patterns documented? We probably need to do our own thing here if we don’t see anything defined.

Basically yeah.

A couple of things that could be useful:

  1. https://developer.apple.com/search/?q=haptic
  2. https://developer.apple.com/documentation/corehaptics/chhapticevent/parameterid/3114595-hapticintensity
  3. https://developer.apple.com/documentation/corehaptics/chhapticevent/parameterid/3114596-hapticsharpness
1reaction
dshokouhicommented, Feb 5, 2021

I tried taking a look at this. Android does not really support the constants defined by Apple. Only a handful exist and thats only available to users on the latest version API 30.

https://developer.android.com/reference/android/view/HapticFeedbackConstants

I don’t see apple defining how many ms each of the above is mentioned. I think this feature was designed specifically for iOS so we may need to map our ms response for users who cant use teh constants up above. Additionally it will not be as easy to map them to iOS and as of now the external bus sends back everything we see in the link so we can’t really change that.

Some reference to use for older devices: https://stackoverflow.com/questions/25748230/confused-about-haptic-feedback-in-android

So we need to basically define what we expect them to do, does apple have the specific patterns documented? We probably need to do our own thing here if we don’t see anything defined.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Preparing Your App to Play Haptics - Apple Developer
For example, iPad and iPod touch don't support haptic feedback, so calls to Core Haptics won't result in haptics. Check for haptics compatibility...
Read more >
Practice audio haptic design - WWDC21 - Videos
Discover how you can deliver rich app experiences that include animation, sound, and haptics on iPhone. Learn key concepts for designing...
Read more >
Xamarin.Essentials: Haptic Feedback - Microsoft Learn
Essentials, which lets you control haptic feedback on device. ... Open the AssemblyInfo.cs file under the Properties folder and add:.
Read more >
An Add-On Device to Perform Dexterous Grasping Tasks With ...
Here, a new device called HaptiHand is proposed that can be added to a haptic feedback arm and provide the user with enough...
Read more >
Nice Vibrations, the best way to add vibrations to your Unity ...
Nice Vibrations is the easiest way to add support for iOS and Android vibrations and haptic feebdacks to your game available on the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found