This is an excerpt from Learn by Doing - Android for Beginners on Udemy.
https://www.udemy.com/learn-by-doing-...
Video shows you how to use your device's vibrator.
Things to Remember
-----------------------------
1. You need to declare the android.permission.VIBRATE permission in the manifest to use the vibrator.
2. Get an instance of the Vibrator by calling the Context.getSystemService(Context.VIBRATOR_SERVICE).
3. To vibrate the device for a specific duration call the Vibrator.vibrate(long) method.
4. To vibrate the device in a specific pattern call the Vibrator.vibrate(long[], int) method.
5. To stop the device from vibrating, call the Vibrator.cancel() method.
6. Also make sure that you call Vibrator.cancel() by overriding the onPause() method inside your Activity.
Смотрите видео Android Tutorial 60 - Vibrating your Phone онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Code Here Now 25 Март 2014, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 4,443 раз и оно понравилось 20 людям.