Usage

Strategies for Using Jabber Guest on a Mobile Device

A core design tenet of the Jabber Guest for Android SDK is design flexibility. Using the common patterns of Android, every effort was made to make implementation simple and straightforward. For example, you are free to approach integration in three main ways.

  1. Rely on the existing Jabber Guest client application provided by Cisco to handle the video call.
  2. Use the larger CallFragment and PreviewFragment components to integrate Jabber Guest quickly into your application.
  3. Take the sub-components themselves, like the RemoteView, SelfView, and ControlBarView, and create your own custom solution.

Cross Launching the Jabber Guest client

In situations where developing your own integration is difficult or impossible, you can still rely on the default Jabber Guest client application to establish a video or audio call. This is done by having the end user install the Jabber Guest client—which is available from the Google Play Store—and call the appropriate intent to launch a Jabber Guest call. This is called cross launching.

Pros
Cons

Using Jabber Guest SDK Components

Another strategy for integrating Jabber Guest technology involves reusing the common components already available within the SDK.

Pros
Cons

Creating Your Own Custom User Interface

The most flexible approach for using the Jabber Guest SDK is to use the component pieces however you see fit within your own application.

Pros
Cons

Using an Activity versus Fragments

There is no special requirement to use Activities in favor of Fragments or vice versa. This should allow the ability to include Jabber Guest SDK components into older designs that are composed of mostly Activities. For new development, we suggest to use Fragments for dynamic, modern user interfaces.

Using Cross Launching to Place a Call

To cross launch from within your application, the first step involves checking that the Jabber Guest client application is actually installed on the device. If the client is not available, the application can inform the user and then route to the Play Store to allow them to install the required application package. Once the Jabber Guest client is installed and available, a simple URI passed by using an intent can start the video call.

Checking for the existence of Jabber Guest

To handle the existence or lack of Jabber Guest on the device, consider using the Android Package Manager to query for the Jabber Guest package.

This code is from the Launch Sample and shows how to query for the com.cisco.jabber.guest package name and version. This package name identifies the Jabber Guest client.

final String packageName = "com.cisco.jabber.guest";

String packageVersion;

PackageManager pm = this.getPackageManager();
try {
  PackageInfo pi = pm.getPackageInfo(packageName, PackageManager.GET_META_DATA);
  packageVersion = pi.versionName;
} catch (NameNotFoundException e) {
  // The Jabber Guest client application is not installed, route accordingly
}
// The Jabber Guest client application is installed and packageVersion contains the version

If the com.cisco.jabber.guest package is not available the application could direct the user directly to the Play Store through the following code:

try {
  startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + packageName)));
} catch (android.content.ActivityNotFoundException e) {
  startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + packageName)));
}

Placing a Call Using the CallFragment

The simplest and most straightforward usage of the SDK is to include the pre-built CallFragment into your application to handle placing and displaying the active call within your application. This is done by wiring your existing layout and events to include the CallFragment when a call needs to be placed. The JabbeGuestCall instance is initialized and the URI of the called party is used to connect the video call.

Review the CallSample sample included with the SDK for more insight on how to use a CallFragment

Using the PreviewFragment

Using another of the SDK components, the PreviewFragment, allows the user to set up their local view before connecting a call. If you would like to give users the opportunity to preview themselves through a SelfView, you should consider including the PreviewFragment as the first step of a call flow.

Review the PreviewSample sample included with the SDK for more insight on how to use a PreviewFragment

Including Individual Views into Your Layouts

To get the fullest amount of flexibility in your use of Jabber Guest a developer can include the component pieces directly within their own layouts.