本文实例讲述了Android实现调用震动的方法。分享给大家供大家参考,具体如下:
调用Android系统的震动,只需要一个类 那就是Vibrator ,这个类在hard包中,一看系统级的服务,又要通过manifest.xml文件设置权限了
package="uni.vibrator"
android:versionCode="1"
android:versionName="1.0">
android:label="@string/app_name">
下面还是一起学习一下SDK吧
Class that operates the vibrator on the device.
If your process exits, any vibration you started with will stop.
//Vibrator类用来操作设备上的震动,如果你的线程退出了,那么启动的震动也会停止
public void vibrate (long[] pattern, int repeat)
Since: API Level 1
Vibrate with a given pattern. //根据给定的节奏震动
Pass in an array of ints that are the durations for which to turn on or off the vibrator in milliseconds. The first value indicates the number of milliseconds to wait before turning the vibrator on. The next va