Understanding The Android Vibration Pattern Behaviour

470 views Asked by At

I have recently started Android java development and I must say it is fascinating. I am writing my first application at the moment which is mainly based on vibrations. What the application does is do some gentle soothing vibrations to help someone relax and hopefully sleep based on some theoretical research done by my science project partner. I am using a vibration pattern that lasts exactly five minutes.

I have used the information from another stackoverflow question to do the vibration. My vibration code is pretty simple.

Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
v.vibrate(pattern, -1);

Where pattern is my theoretical soothing pattern. It works properly for the first 1-2 minutes. After that something happens causing a one second delay then everything after that gets messed up. In other words, the pattern gets scrambled not just the one second delay (some vibrations get skipped, too). I have made sure the pattern is working properly. I have even split the pattern into five smaller patterns then started testing each part individually. They have worked flawlessly like intended.

Can someone explain to me why this is happening please? Is there a flaw or limitation to long patterns on Android systems? I appreciate any feedback regarding this issue. I have tried looking over stackoverflow question and searched Google for four hours and ran out of search results.

Thanks for taking the time to read my problem.

0

There are 0 answers