Sub RumblePattern(Pattern() As Long)
Dim r As Reflector
r.Target = r.GetContext
r.Target = r.RunMethod2("getSystemService", "vibrator", "java.lang.String")
r.RunMethod4("vibrate", Array As Object(Pattern, 0), Array As String("[J", "java.lang.int"))
End Sub
RumblePattern( Array As Long(75,50, 75,50, 75,50, 75, 25, 75,25, 75,12, 75,12))
What is the error? No other code is shown, but when doing this you also need the Vibration Right which you get by using the Phone library and just dim a PhoneVibrate object that is never used. Mine worked fine yesterday after this. Remember to code a Cancel option too...this could get messy if not and it will continue vibrating after exit until you reboot or cancel it.
Yup, the attached code compiles and runs fine. Sounds kinda like some of the night bugs around here. Tap screen to stop it.
Might remove the FirstRun Check. I was worried about rotating the screen sending multiple rumble commands and making a mess, but it appears that is not the case and what you send replaces previous. FirstRun isn't very reliable on my device too and it appears to stay in memory long and doesn't vibrate on other attempts. Doesn't look like it is tied that much to the context either and you can still exit the app and leave it going and stop it by loading the app again and taping...might be interesting to test if it can be stopped from another app.
There is also a hasVibrator you can send. It has no parameters and returns a Boolean...should be able to use r.RunMethod to call it and store the result in a Boolean to see if a vibrator is even in the device...or if Android detects it is there for this.
They are identical, I did a direct copy from here. Where did you put your call to RumblePattern? Might look there, could be an issue with the event sub not getting called or some type of logic/flow error with an If/Then block or something.