[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

sample[jx8-android] Vibration


Expression to run this page
SwikiCodeRobot @> #JX8AndroidVibration

" Vibration test. "
| vibrator |
vibrator := MainActivity singleton
	getSystemService: Context vibratorService.

vibrator hasVibrator
	ifTrue: [ vibrator vibrate: 500 ]
	ifFalse: [ self error: 'Missing vibration support. Ensure that you have given your application the permission to vibrate' ].