Avaya Client SDK

< Back to Package Overview

Adding support for Web Collaboration

The collaboration service API provide collaboration functionality to the client application. Further, it takes care of retrieving data from the server, managing and performing business logic on this data and finally presenting it to the UI layer. This API attempts to use closures where possible.

It provides core collaboration functions for clients served by Collaboration server:

  • receive new collaborations
  • display the shared information from other participants
  • allows getting the Capabilities
  • allows to share (screen, whiteboard ...)
  • allows send/receive the chat messages

Most of the API calls allow a listener to pass in to handle success/fail.

Initialization and Configuration

The CollaborationService object is obtained from the Client SDK's User object. The UserConfiguration object will be used to define the services that will be available to end users of your application. Each service is configured individually; its configuration is stored in a dedicated object, referenced from the UserConfiguration object.

Note: More information on service configuration can be found in the article configuring the SDK.

Start by obtaining any existing service configuration:

WCSConfiguration wcsConfiguration = new WCSConfiguration();

Enable the service and configure the collaboration parameters supplied by your administrator:

wcsConfiguration.setEnabled(true);

And finally save your configuration back to your User object:

userConfiguration. setWCSConfiguration(wcsConfiguration);

After you instantiate and set up any required configuration objects, you are now ready to create the User and then call the start() method of your User to start all services. Then you can get the CollaborationService for its further usage:

CollaborationService collaborationService = mUser.getCollaborationService();

Receive new collaborations

To receive new collaborations you should implement CollaborationServiceListener from public API and provide instance to collaboration service.

CollaborationServiceListenerImpl collaborationServiceListener =  
new CoCollaborationServiceListenerImpl();
collaborationService.addListener(collaborationServiceListener);

Messages about new collaboration will come in: collaborationServiceListener -> onCollaborationServiceCollaborationCreationSucceeded(CollaborationService collaborationService, Collaboration collaboration)

In this point you will have instance of new collaboration. To be able to receive and display the sharing stream from the collaboration server you should do the following:

1) Create and store the instance of the class from the public API - ContentSharingRenderer. And provide this instance to collaboration as listener

ContentSharingRenderer contentSharingRenderer = new ContentSharingRenderer();
collaboration.getContentSharing().addListener(contentSharingRenderer);

2) Create and store the instance of the class implementing the ContentSharingListener and provide this instance to collaboration as listener:

ContentSharingListenerImpl contentSharingListener =
 new ContentSharingListenerImpl();
collaboration.getContentSharing().addListener(contentSharingListener);

Display the shared information from other participants.

When any participants from the collaboration will start sharing, your instance of the ContentSharingListenerImpl will receive the event -onContentSharingStarted(ContentSharing contentSharing, Participant participant) In this point you should initialize and start any element to display content sharing stream.

getFragmentManager().beginTransaction().replace(R.id.dynamic_view, 
anyContentSharingFragment).addToBackStack(null).commit();

To be able to handle content sharing stream, your fragment should do the following:

1) Implement the listener from public API - ContentSharingListener

2) Fragment should be added as listener in ContentSharing instance

collaboration.getContentSharing().addListener(contentSharingFragment);

3) Use the instance of the class ContentSharingRenderer to create view:

layout.addView(mContentSharingRenderer.getContentSharingView(getActivity()));