So I got this good suggestion from one user’s comment: when shake to shuffle, make the phone vibrate.
It’s actually a very simple 2-step operation, but android developer site wasn’t very clear about. Here’s how I did it:
- Add permission in AndroidManifest.xml file like this:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> <uses-permission android:name="android.permission.VIBRATE" /> ...... </manifest>
- In your program when you want the phone to vibrate:
// vibration lasts 300 milliseconds ((Vibrator)getSystemService(VIBRATOR_SERVICE)).vibrate(300);
Done!


Comments (9)