Prerequisites

Our SDK is written in Java and is compatible with API 18+.

Note that the SDK will work even if the device doesn't have Google PlayServices.

We currently don't offer compatibility with NDK or cross-platform environnements (like Unity, Cordova or AIR) and don't support Eclipse (ant build tools).

Emulator: The SDK will not work on an emulator (AVD) because of hardware video encoding requirements that are not available in software emulation (i.e. createInputSurface()).

Integrate the SDK

Permissions

The SDK requires the following permissions:

  • INTERNET
  • ACCESS_NETWORK_STATE
  • CAMERA
  • RECORD_AUDIO
  • WRITE_EXTERNAL_STORAGE

It will add them automatically to your manifest if you don't have them already.

Those permissions aren't requested at runtime by the SDK and are all mandatory: If you target API 23 or more (Android 6) you MUST ensure that those permissions are granted before using the LiveRecorder. See Requesting permissions at runtime for more infos.

Integrate in your app

1. Add Newzulu nexus repository:

Add the following lines at the root of your app's build.gradle:

repositories {
    mavenCentral()
    maven { url "https://nexus.octiplex.com/content/repositories/public" }
}

2. Add dependency to live sdk:

You can now add the dependency to the live SDK to your app:

dependencies {
    ...

    compile 'com.newzulu:livesdk:1.0'
}

You can also add the dependency to Newzulu Platform SDK to support authentication via Newzulu Platform:

compile 'com.newzulu:platform:1.1'

Proguard users

Currently we don't have any custom proguard rules but if it changes in the future it will be listed here.

Using the SDK

Get your server information

The first step is to get your Newzulu Live server information.

You'll need:

  • The Newzulu Domain of the Live server (e.g. EU, NA, AU)
  • The site code of your project

Please contact us if you're having difficulties finding this information.

Get an authenticator

Newzulu Live does not implement authentication directly. Instead it expects an authenticator to perform the authentication and provide an authenticated session. This enables you to either use an existing authentication mechanism or to implement you own authentication mechanism.

It very likely that your Newzulu Live server uses the default Newzulu Platform authentication. In that case, you can simply obtain an authenticator from the the Newzulu Platform SDK.

PlatformClient platformClient = new PlatformClient(new com.newzulu.platform.Host(YOUR_PLATFORM_DOMAIN, YOUR_PLATFORM_VHOST));
String email =  "user@example.com";
String password =  "*****";
platformClient.setCredentials(email, password, new SharedPreferencesSessionStore(this));

Authenticator authenticator = platformClient.getAuthenticator();

Please consult the documentation of the Newzulu Platform SDK to learn more about the PlatformClient class: http://developer.newzulu.com/androidsdk.

That authenticator object uses the credentials you supplied to authenticate to Newzulu Platform and automatically renew the authenticated session whenever it expires.

Create the authenticated client

You can now create an instance of Newzulu Live AuthenticatedClient that will be used to perform the requests on the Newzulu Live server.

Here's how to do it:

Host liveHost = new Host(YOUR_LIVE_DOMAIN, "YOUR_SITE_CODE");
AuthenticatedClient authenticatedClient = new AuthenticatedClient(liveHost, authenticator);

Replace:

  • YOUR_LIVE_DOMAIN with the Domain of your Newzulu Live server: Domain.NA, Domain.EU or Domain.AU.
  • YOUR_SITE_CODE with your Newzulu Live site code.

Note that Platform Domain and Live Domain are two different Objects, same goes for Host, be sure to use the right one.

That's it, you are now ready to access Newzulu Live.

Next steps