Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Make phone call programmatically

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 217
    Comment on it

    Its easy to make a phone call by using intent in android for this example we can user an editText and button with property of editText is set to inputType="phone" that ll accept only numbers.

    On basis of intent an action to be performed i.e ACTION_DIAL, and data to be set will be mobile number in uri parsing. Uri.parse creates a Uri which parses the given encoded URI string.

    Intent intnet = new Intent(Intent.ACTION_CALL);
    intnet.setData(Uri.parse("tel:"+number));
    

    Finally, we should start the activity as shown below :

    startActivity(callIntent);
    

    Android permission to make call

    <uses-permission android:name="android.permission.CALL_PHONE" />
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: