0

This is a part of examples, HelloEvents, on Sony addon sdk' examples.

I've managed to access the startVibrator and change vibrations successfully on SmartWatch2.

But, I want to change the vibration pattern more details such as pattern like android vibrate, eg.{500,500,500,500,1000,1000,1000,1000}.

So, I used startVibrator twice, but it didn't work. It just did last one(startVibrate(1000,1000,2)).

for example,

 if (event.getAction() == Control.Intents.TOUCH_ACTION_RELEASE) {`enter code here`
            if (mTouchRect.contains(event.getX(), event.getY())) {
                sendEventToActivity(EventType.TOUCH, event.getX() + ", " + event.getY());

                startVibrator(500, 500, 2); // not working 
                startVibrator(1000,1000,2); // only working 
                }        
             }

Any help would be appreciated.

Thank you.

Roddy
  • 66,617
  • 42
  • 165
  • 277
  • I guess you need to startVibrator after the first one is finished. And most likely you also need to exit the event handler. So either there is a vibe-end event or you need to schedule a timed one. – eckes Nov 28 '14 at 19:03
  • Post the code for start vibrator. I know that came with example, but it might help. – weston Nov 29 '14 at 10:30

1 Answers1

0

The second vibration pattern is overriding the first one. You need to send it, after the first pattern is complete. You can do that for example by using postDelayed, where the delay will be the total duration of your first pattern.

peter.bartos
  • 11,855
  • 3
  • 51
  • 62