And The Service Class

Do Not Forget To Declare the Service in Manifest like<service android:name=".VibrateService"/>

public class VibrateService extends Service{ @Override public void onStart(Intent intent, int startId) { // TODO Auto-generated method stub super.onStart(intent, startId); Vibrator v = (Vibrator)getSystemService(Context.VIBRATOR_SERVICE);// pass the number of millseconds fro which you want to vibrate the phone here we // have passed 2000 so phone will vibrate for 2 seconds. v.vibrate(2000); // If you want to vibrate in a pattern // long pattern[]={0,800,200,1200,300,2000,400,4000}; // 2nd argument is for repetition pass -1 if you do not want to repeat the Vibrate // v.vibrate(pattern,-1);

Point To Note:

long pattern[]={0,800,200,1200,300,2000,400,4000}

this is pattern in which we want to Vibrate the Phone
first 0 means silent for 0 milisecond
800 means vibrate for 800 milisecond
200 means means silent for 200 milisecond
1200 means vibrate for 1200 miliseconds

Telephony Manager

Telephony Manager provides access to information about the telephony services on the device. Applications can use the methods in this class to determine telephony services and states, as well as to access some types of subscriber information. Applications can also register a listener to receive notification of telephony state changes.

You do not instantiate this class directly; instead, you retrieve a reference to an instance through Context.getSystemService(Context.TELEPHONY_SERVICE).

How To Launch the Dialer to Initiate Phone Calls:

Use an Intent action to start a dialer activity; you should specify the number to dial using the tel: schema as the data component of the Intent.

Use the Intent.ACTION_DIAL Activity action to launch a dialer rather than dial the number immediately.
This action starts a dialer Activity, passing in the specified number but allowing the dialer application
to manage the call initialization (the default dialer asks the user to explicitly initiate the call). This
action doesn’t require any permissions and is the standard way applications should initiate calls.