Skip to content

Instantly share code, notes, and snippets.

@e23z
Last active July 26, 2017 14:30
Show Gist options
  • Select an option

  • Save e23z/654e79231cca1b9bd7a8153ea06934dc to your computer and use it in GitHub Desktop.

Select an option

Save e23z/654e79231cca1b9bd7a8153ea06934dc to your computer and use it in GitHub Desktop.
[Device Vibration] How to make the mobile device to vibrate for some action. #xamarin #ios #android #mobile #wp #ux
// Android
Vibrator vibrator = (Vibrator) this.ApplicationContext.GetSystemService(Context.VibratorService);
// iOS
SystemSound.Vibrate.PlayAlertSound();
// Windows Phone
VibrateController testVibrateController = VibrateController.Default;
vibrate.Start(TimeSpan.FromMilliseconds(1000));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment