How to install GoCoder SDK for Android

This article describes how to install Wowza GoCoder™ SDK for Android.

Contents


Minimum requirements
Import the Wowza GoCoder SDK library into an Android Studio project
About the SDK sample apps

Minimum requirements


  • Android SDK 4.4.2 or later
  • Android Studio 1.2.0 or later

Note: Running and debugging apps that use the GoCoder SDK using a device emulator isn't recommended due to the wide variance in functionality between the software-based audio and video codecs used by the emulator and the hardware-based codecs installed on most devices.

Download the Wowza GoCoder SDK for Android. The SDK is distributed as a .zip file that contains the following files and folders:

com.wowza.gocoder.sdk.aar

The Android archive file that contains the GoCoder SDK library.

docs

The SDK API reference documentation in HTML format. Open index.html in this folder to view the documentation.

sample-app

A sample application that can be imported directly into Android Studio that demonstrates many of the SDK's capabilities. For more information, see About the SDK sample app.

Import the Wowza GoCoder SDK library into an Android Studio project


  1. Copy com.wowza.gocoder.sdk.aar to the libs folder of the Android Studio project. In a typical project structure, the libs folder is located at [project_root]/app/libs.
  2. Add a dependency for the SDK library in the app module's build.gradle file, which is typically located at [project_root]/app/build.gradle, as follows:
// This enables Gradle to locate Android library dependencies in the same manner as jar-based dependencies

repositories {
    flatDir {
        dirs 'libs'
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])

    // The GoCoder SDK library dependency declaration

    compile 'com.wowza.gocoder.sdk.android:com.wowza.gocoder.sdk:1.0b7@aar'

    // List additional dependencies here...

}
  1. Add the following permissions to the app's AndroidManifest.xml file:
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

Expand the disclosure triangle next to the new Run Script phase that was just added. In the script editor box, paste in the following.

About the SDK sample app


To build and run the sample applications included with the SDK, open an existing project in Android Studio and select the sample-app folder. Then you can build, deploy, and run the sample app in debug mode. The sample app demonstrates the following capabilities:

CameraActivity.java An activity that demonstrates how to use the SDK to capture and broadcast video using the device's internal cameras. The Settings screen in the app allows you to modify various video, audio, capture and broadcast settings.
InfoActivity.java An activity that demonstrates how to use the version and device interrogation APIs to list detailed information about the SDK and mobile device.
ScreenshotActivity.java An activity that demonstrates how to use the WZRenderAPI.VideoFrameListener API to capture a frame from the camera preview display and save it as a bitmap.
MP4BroadcastActivity.java

An activity that demonstrates how to broadcast the frames from a local MP4 file by using WZBroadcast, WZBroadcastAPI, and related classes and interfaces, which provide lower-level access to the various components of a Wowza broadcast.

MP4CaptureActivity.java An activity that demonstrates how to save the video stream to an MP4 file stored on the local device using the WZMP4Writer API class.
BitmapOverlayActivity.java An activity that demonstrates how to use the WZBitmap API to overlay a bitmap on the video stream.
TextOverlayActivity.java An activity that demonstrates how to use the WZText and WZTextManager APIs to overlay text on the video stream.
FaceActivity.java An activity that demonstrates how to use the SDK in conjunction with a device's face detection capabilities to superimpose an image on the viewer's face.
AudioMeterActivity.java An activity that demonstrates how to use the WZAudioDevice.AudioSampleListener API to display an audio level meter.
BluetoothActivity.java An activity that demonstrates how to capture and stream audio from a Bluetooth device.

If you're having problems or want to discuss this article, post in our forum.