Java

Building the interface

To be able to place the call, you need to add three elements to the screen:

  • A TextView to show the connection status
  • A Button to start the call
  • A Button to end the call

Open the app/res/layout/activity_main.xml file. Click the Code button in the top right corner:

Code view

Replace the file contents with the following:

You will control the view using code, so you have to store references to the views. Add these properties at the top of the MainActivity class:

Now you need to assign views to previously added properties. Add below code to the onCreate method inside MainActivity class (below request permissions code):

Now you need to assign views to previously added properties. Add below code to the onCreate method inside MainActivity class (below request permissions code):

Build and Run

Run the project again (Ctrl + R).