1. Introduction :

 

Android has got a lot of features which all of us know and in every tutorial i am using one of it to make our app’s and this time i have brought a vibration tool which you might have experienced a lot of times.

Yes, you are right vibration is not only a feature of android but you can also find it in many basic devices.Here, we are going to see how to implement it in android.

Generally vibration mode is used to notify user regarding any message, phone call, when we deactivate sounds i.e., ringtones and also for any other notifications which may include alert / error messages.

So here i think i now you got a basic knowledge regarding vibration mode, or uses of vibration, so we can move forward.

2. Creating activity_vibrate.xml :

 

Its a simple interface where just we require a button.

 

3. Creating a VibrateActivity.java :

 

 Here we will be using vibrator service which is a part of system services in android.

 

 

4. AndroidManifest.xml :

 

We need to add a permission for vibration. 

 

 

5. Output :

vibration1

Show Buttons
Hide Buttons
Read previous post:
Android spinner drop down arrow color change

Close