Course Content

Course Content

Description

Create Call Application in Android

 

In today's video we are going to create a Call application in Android.

First of all we will design the layout of our application, for that we will go to activity_main.xml file and inside we have designed TextView stating 'Enter Phone Number', EditText to write phone number, and a 'Dial' Button.

Now we will take instance for our button and edittext,

private Button button;

private EditText etPhoneno;

Now we will do view identification for required,

button=(Button)findViewById(R.id.buttonCall);

etPhoneno=(EditText)findViewById (R.id.editText1);

Further we will create one listener for our button, button.setOnClickListener(new onClickListener())

{

@Override

public void onClick(View v)

{

String phnum=etPhoneno.getText().toString();

Intent callintent=new Intent(Intent.ACTION_CALL);

callIntent.setData(Uri.parse("telephone "+phnum));

startActivity(callIntent);

}

}

Now we will execute our code, it runs successfully and after we enter the phone number, call gets dialled.

FAQs

Recommended Courses

Share With Friend

Have a friend to whom you would want to share this course?

Download LearnVern App

App Preview Image
App QR Code Image
Code Scan or Download the app
Google Play Store
297K+ Downloads
App Download Section Circle 1
4.5 Rating
App Download Section Circle 2
10K+ Reviews
App Download Section Circle 3
  • Learn anywhere on the go
  • Get regular updates about your enrolled or new courses
  • Share content with your friends
  • Evaluate your progress through practice tests
  • No internet connection needed
  • Enroll for the webinar and join at the time of the webinar from anywhere