GithubHelp home page GithubHelp logo

jbasu2013 / accelerator-sample-apps-android Goto Github PK

View Code? Open in Web Editor NEW

This project forked from opentok/accelerator-sample-apps-android

1.0 0.0 0.0 12.2 MB

A sample app built by OpenTok Accelerator Packs

License: MIT License

Kotlin 100.00%

accelerator-sample-apps-android's Introduction

OpenTok Accelerator Sample App for Android

Tokbox is now known as Vonage

This project demonstrates Accelerator Sample App - multiparty, web-based audio, video, and messaging solution for Android Platform. This project utilizes accelerator-core-android.

Under the hood accelerator-core-android utilizes Vonage Video API Android SDK and opentokRTC.

Getting started

Open this project

There are a few ways to open this project.

Android Studio

  1. Go to Android Studio and select File > New > From Version control > Git
  2. Enter [email protected]:opentok/accelerator-sample-apps-android.git into URL field

Command-line + Android Studio

  1. Run git clone [email protected]:opentok/accelerator-sample-apps-android.git to clone project
  2. Go to Android Studio and select File > Open and navigate to the newly cloned directory

Set app config

Before running the application, we need to configure project specific settings. Open the dashboard, select specific application and to get the apiKey, sessionId and token.

Open com.opentok.accelerator.sample.AppConfig file and fill the apiKey, sessionId and token for your Android project.

For production deployment, you must generate the SessionId and token using one of the OpenTok Server SDKs (https://tokbox.com/developer/sdks/server/).

Replace maven dependency with accelerator-core-android code

This project is using implementation 'com.opentok.android:opentok-accelerator-core:x.y.z' dependency to utilize accelerators. This dependency can be replaced with accelerator-core-android source code to facilicate developement of your application.

Remove dependency

  1. Modify the root build.gradle file and remove the custom repository:
maven { 
  url  "http://tokbox.bintray.com/maven" 
}
  1. Modify the app/build.gradle file and remove accelerator dependency:
implementation 'com.opentok.android:opentok-accelerator-core:x.y.z'

Using the repository

  1. Clone the OpenTok Accelerator Core repo.
  2. Go to Android Studio and select New > Module > Import Gradle Project and navigate to the newly cloned directory.

Exploring the code

This section describes the best practices the sample app code uses to implement the communication features.

For detail about the APIs used to develop this sample, see the OpenTok Android SDK Reference and Android API Reference.

Class design

Class Description
MainActivity Implements the UI and media control callbacks.
OpenTokConfig Stores the information required to configure the session and authorize the app to make requests to the backend server.
ActionBarFragment Manages the toolbar for the local audio and video controls, the start/end call, text-chat, and screen sharing buttons.
ScreensharingBar Defines a view to represent the ScreenSharingBar.
Participant Represents an item in the data set
ParticipantAdapter Custom RecyclerView.Adapter responsible for providing views that represent items in the data set.

Session and streams management

The OTWrapper class, included in the accelerator-core-android is the backbone of the communication features for this app.

This class uses the OpenTok API to initiate the client connection to the OpenTok session and manage the audio and video streams.

otWrapper.connect()
val previewConfig = new PreviewConfig.PreviewConfigBuilder().name("myConfig").build()
otWrapper.startPublishingMedia(previewConfig, false)
otWrapper.enableLocalMedia(MediaType.AUDIO, audio)
otWrapper.disconnect()

The BasicListener and AdvancedListener interface monitor OTWraper state changes.

Development and Contributing

Interested in contributing? We ❤️ pull requests! See the Contribution guidelines.

Getting Help

We love to hear from you so if you have questions, comments or find a bug in the project, let us know! You can either:

Further Reading

accelerator-sample-apps-android's People

Contributors

igorwojda avatar marinaserranomontes avatar michaeljolley avatar robjperez avatar txusms avatar

Stargazers

 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.