How to get pre-defined vibration patterns?

36
January 11, 2019, at 2:30 PM

I'm trying to make the device vibrate in a pre-defined pattern, which is defined in the VibrationEffect class, with patterns like EFFECT_CLICK, EFFECT_POP, and others. I noticed that they are all annotated by @hide, It seems like there's no public method for me to get these patterns, VibrationEffect.get() doesn't work.

So how should I get such patterns? Or is it not possible at all? I also tried to dig into the Android source code to find these patterns, I'm particularly interested in the pre-defined Ringtone vibration patterns, but I can't seem to find them, all I can find is the interface package that defines vibration patterns. Can someone point me the right way if I'm doing this wrong?

READ ALSO
Android debug build fetches updates from CodePush Production deployment and not Staging

Android debug build fetches updates from CodePush Production deployment and not Staging

Android debug build needs to fetch updates from Staging environment, instead it fetches from Production (I think)

26
When editing a table, it updates the last entry in the DB instead of the selected one

When editing a table, it updates the last entry in the DB instead of the selected one

I have a table that can have multiple posts, let’s say that I go to edit any random post

31
Searching a table for like matches based on 2 different vars

Searching a table for like matches based on 2 different vars

I have a form that submits 2 values to the post target:

50
Ordering by the order of values in a SQL IN() clause

Ordering by the order of values in a SQL IN() clause

I am wondering if there is away (possibly a better way) to order by the order of the values in an IN() clause

46