Git Product home page Git Product logo

android-voice-api-playground's Introduction

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

android-voice-api-playground's People

Contributors

brittbarak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.