This sample application demonstrates how to receive a call on your android application from the Plivo platform using the Android SDK
- Clone our android sample apps repository.
git clone https://github.com/plivo/plivo-android-examples.gitor download the zip
- Setup Android with Eclipse and Launch eclipse
- Select File -> New -> Other
- Choose 'Android Project From Existing Code' and navigate to the plivo-android-examples folder and click Open
- Create an endpoint with a username and a password.
- Create another endpoint, this will be used to make the call to the application set up on android.
- Load the PlivoInbound application in eclipse.
- Edit the source file in the PlivoInbound application
MainActivity.java. Assign your endpoint username and password to the respective variables.
public final static String PLIVO_USERNAME = ""; public final static String PLIVO_PASSWORD = "";
- Launch the application from eclipse.
Setup to receive a call
- Setup your Plivo number to forward the call to your SIP endpoint registered with the Android app using this guide.
- Make a call to the Plivo number and receive the call on the Android app.
When the call is received on the app, the answer button will light up. Click on the answer button to answer the call.