Back to project page android-gear.
The source code is released under:
MIT License
If you think the Android project android-gear listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.androidgear.core; /*from w ww .j ava 2s . c o m*/ import android.content.Context; import android.os.Process; import android.os.Vibrator; public class AndroidGearCommands extends GearCommands { private AbstractAndroidGearActivity activity; public AbstractAndroidGearActivity getActivity() { return activity; } public void setActivity(AbstractAndroidGearActivity activity) { this.activity = activity; } @Override public void killGame() { int myPid = Process.myPid(); Process.killProcess(myPid); } @Override public void vibrate(long milis) { Vibrator v = (Vibrator) activity.getSystemService(Context.VIBRATOR_SERVICE); v.vibrate(milis); } }