Check If an Android Device supports Call Making

by Sasikumar 2013-10-08 14:43:51

Check if an android device supports making call using the following code :

Step 1: Add the following code to AndroidManifest.xml file
<uses-feature android:required="true" android:name="android.hardware.telephony" />

Step 2: In the required activity class add the following code:

if (getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY))
{
// Your Device Supports Making Call.
Toast.makeText(getApplicationContext(), "Your Device Supports Making Call", Toast.LENGTH_LONG).show();
}
else
{
// Your Device Doesn't Supports Making Call.
Toast.makeText(getApplicationContext(), "Your Device Doesn't Supports Making Call.", Toast.LENGTH_LONG).show();
}



This will be handy when your providing option for the user to make call from your Android Application.
396
like
1
dislike
0
mail
flag

You must LOGIN to add comments