より低い振動を作りたい場合は、真ん中に空白のあるパターンを作成する必要があります.
次のような定数を使用します。
int dot = 200;
int short_gap = 200; // Length of Gap
次に、配列とパターンを定義します。
long[] pattern = {
0, // Start immediately
dot, short_gap };
次に、次のように呼び出すことができます。
v.vibrate(pattern, x);
// x value:
// 0 repeat infinite
// -1 no repeat
// n number of repetitions
ドットとギャップの長さを変更する (またはさまざまなパターンを実行するために新しいドットを定義する) ことで、振動のパワーを調整できます。
EDIT1:これが私のものですVibrationConstants.java
public class VibrationConstants {
private static int p = 5; // five millisecond of vibration
private static int s = 5; // five millisecond of break - could be more to
// weaken
// the vibration
private static int pp = 10; // ten millisecond of vibration
private static int ss = 10; // ten millisecond of break - could be more to
// weaken
// the vibration
private static int ppp = 50; // fifty millisecond of vibration
private static int sss = 50; // fifty millisecond of break - could be more to
// weaken
// the vibration
public static long[] HARD_VIBRATION = { 0, ppp, sss };
public static long[] MIDDLE_VIBRATION = { 0, pp, ss };
public static long[] SOFT_VIBRATION_2 = { 0, p, s };
public static long[] PATTERN_VIBRATION = { 0, 250, 200, 250, 150, 150, 75,
150, 75, 150 };
}
だから、あなたがそれを呼び出したいとき:
v.vibrate(VibrationConstants.SOFT_VIBRATION_2, x);
// x value:
// 0 repeat infinite
// -1 no repeat
// n number of repetitions
バイブレーションとブレークの値が同じである結果が期待どおりに正確でない場合は、ブレーク値のみを変更してみてください。これは素晴らしい効果をもたらします。:)
お役に立てば幸いです。Google Samsung や Xperia などの電話ブランドのパターンを見つけようとしましたが、見つけることができませんでした...そのパターンをシミュレートすると良い結果が得られましたが、すべて要件によって異なります。
目標を達成するにはいくつかのテストを行う必要があると確信していますが、それほど難しくはありません。