Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.

nexmo-community/Android-Voice-Api-Playground

Repository files navigation

Android-Voice-Api-Playground

An Android app to build a simple NCCO(Nexmo Call Control Object) and create an outgoing phone call.

Set up

To run this project you'll have to create a Nexmo Apllication, and authenticate your network calls with your JWT. There are a few ways to accomplish it.

To do that without your server side supprt, here are instructions to do it with Nexmo CLI:

  1. If you don't already have one, setup a [Nexmo account]((https://dashboard.nexmo.com/).

  2. Use npm to install and setup the Nexmo CLI:

$ npm install nexmo-cli -g
  1. Set up Nexmo CLI with your API_KEY and API_SECRET, which can be found on Nexmo dashboard
$ nexmo setup <API_KEY> <API_SECRET>
  1. Create a new Nexmo Voice Application, and generate locally a private key file:
$ nexmo app:create "My Nexmo App" http://example.com/answer http://example.com/event --type=voice --keyfile=private.key

In the output of that command you'll find the ID of the generated app. Take a note of it.

  1. Create a JSON Web Token (JWT). Make sure to replace MY_APP_ID with the Nexmo Application Id generated on previous step. in this example the JWT will expire in 1 day from the moment it was generated.
nexmo jwt:generate ./private.key exp=$(($(date +%s)+86400)) acl='/**' application_id=MY_APP_ID

The output will give you a JWT. Copy it.

After opening this project in Android Studio, open NexmoApiService.kt file, paste your JWT as the value of const val APP_JWT

Now you'll be able to make authenticated network calls.

How to use this app?

After running the app:

  • Insert the phone number you'd like to call to.

  • Click on Talk, Stream or Input buttons to add an action to the NCCO.

  • When you're ready, click the Call button below to place the call. (notice: the calls will be charged on your Nexmo account credit)

Alt Text

Read more about Nexmo Voice API

About

An Android app to build a simple NCCO(Nexmo Call Control Object) and create an outgoing phone call.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages