开发者

Vibrate pattern for incorrect input (Android)

开发者 https://www.devze.com 2023-04-01 19:39 出处:网络
I know how to create a vibrate pattern e.g: Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);

I know how to create a vibrate pattern e.g:

Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
long pattern[] = new long[] {0, 200, 100, 200};
vibrator.vibrate(pattern, -1);

But I don't know which pattern will communicate "incorrect input". Are there any guidelines or predefined patterns?

EDIT: Seems like my question is a bit confusing. What I mean is that there are sounds that you can identify as success or fail, they are quite common. Bu开发者_如何学Pythont are there any vibration patterns that can be used for success or fail that most people would understand?


Hopefully this answer comes through as better late than never! ;-)

I'm not aware of any particular standard in android, however it appears that in other areas of non-visual communications, repeating patterns of 3 are usually used to indicate distress or alarm. For example, the morse code for S.O.S is a repeating pattern of "threes". When learning to SCUBA dive, I was taught to tap my tank in patterns of 3 if I wanted to get urgent attention, and when going on a guided bushwalk, I've been instructed many times to carry a whistle, and to signal in long patterns of 3 if I wanted to indicate distress.

In lieu of a recognized standard, if you feel that you need to provide a success or fail pattern that uses vibrate, I would suggest a quick single vibration if you really want to indicate success, and a rapid triple vibration pattern to indicate a failure. I would also use this to supplement a visual cue, and of course to give the user the ability to turn off the vibration if they wish, as this will certainly contribute to additional battery drain.

Cheers,


Don't. No other Android apps do this. Use a visual indication instead.


I am not aware of any pattern guidelines, especially not one for incorrect input. Usually vibration is just used to convey a notification or the fact that something was pressed. For this 1-2 short vibrations is usually used.

Complex vibration patterns would most likely be useful for games and the like. If you want to alert the user of incorrect input I suggest using a Toast instead.


Vibrator v;
v = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
long[] p = { 50, 100, 50, 100 };
v.vibrate(p, -1);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号