Twilio Client for Android Quickstart
This application should give you a ready-made starting point for writing your own voice-enabled apps with Twilio Client. Before we begin, you need to collect the credentials to run the Twilio Client Quickstart web app.
Config Value | Description |
---|---|
Account SID | Your primary Twilio account identifier - find this in the console here. |
Auth Token | Used to authenticate - just like the above, you'll find this here. |
TwiML App SID | The TwiML application with a voice URL configured to access your server running this app - create one in the console here. Also, you will need to configure the Voice "REQUEST URL" on the TwiML app once you've got your server up and running. |
Twilio Phone # | A Twilio phone number in E.164 format - you can get one here |
Choose a download package for your server-side language of choice. If you're primarily a mobile app developer and don't have a strong preference, Node.js or Ruby will probably get you up and running the fastest.
- Download for C#
- Download for Java
- Download for Node.js
- Download for PHP
- Download for Python
- Download for Ruby
##Setting up the web app Follow the instructions in the README for each starter application to configure and run it on your machine, using the four values we created above:
- Instructions for C#
- Instructions for Java
- Instructions for Node.js
- Instructions for PHP
- Instructions for Python
- Instructions for Ruby
Your application should now be running locally.
Once you've got your server up and running, you will need to host it somewhere Twilio can access it. You can publish your app to a web hosting provider, or you can run it locally and use ngrok to create a tunnel to your development machine with a publicly accessible URL. See the README above for the specific ngrok instructions for your preferred platform.
Now, configure the Voice "REQUEST URL" on your TwiML App to hit the voice URL on your server. Again, see the README above for platform-specific instructions.
In the ClientActivity.java file, on this line,
private static final String TOKEN_SERVICE_URL = "TOKEN_SERVICE_URL";
Replace the URL with the address of your server, followed by /token, for instance, https://asdf456.ngrok.io/token
Go ahead and run your application, either in the Android Emulator, or on your device, and you should be up and running! You can make Twilio Client connections to other users of your quickstart server (find your identity at the bottom of the app), or make outgoing phone calls from the app.
MIT