public final class

ImageSharingService

extends RcsService
java.lang.Object
   ↳ com.gsma.services.rcs.RcsService
     ↳ com.gsma.services.rcs.sharing.image.ImageSharingService

Class Overview

This class offers the main entry point to transfer image during a CS call. Several applications may connect/disconnect to the API. The parameter contact in the API supports the following formats: MSISDN in national or international format, SIP address, SIP-URI or Tel-URI.

Summary

[Expand]
Inherited Constants
From class com.gsma.services.rcs.RcsService
Public Constructors
ImageSharingService(Context ctx, RcsServiceListener listener)
Constructor
Public Methods
void addEventListener(ImageSharingListener listener)
Adds a listener on image sharing events
final void connect()
Connects to the API
void deleteImageSharing(String sharingId)
deletes an image sharing by its sharing id from history and abort/reject any associated ongoing session if such exists.
void deleteImageSharings()
Deletes all image sharing from history and abort/reject any associated ongoing session if such exists.
void deleteImageSharings(ContactId contact)
Deletes image sharing with a given contact from history and abort/reject any associated ongoing session if such exists
void disconnect()
Disconnects from the API
ImageSharingServiceConfiguration getConfiguration()
Returns the configuration of image sharing service
ImageSharing getImageSharing(String sharingId)
Returns a current image sharing from its unique ID
void removeEventListener(ImageSharingListener listener)
Removes a listener on image sharing events
ImageSharing shareImage(ContactId contact, Uri file)
Shares an image with a contact.
[Expand]
Inherited Methods
From class com.gsma.services.rcs.RcsService
From class java.lang.Object

Public Constructors

public ImageSharingService (Context ctx, RcsServiceListener listener)

Since: API Level 1.5

Constructor

Parameters
ctx Application context
listener Service listener

Public Methods

public void addEventListener (ImageSharingListener listener)

Since: API Level 1.5

Adds a listener on image sharing events

Parameters
listener Listener
Throws
RcsServiceNotAvailableException
RcsGenericException
RcsServiceNotAvailableException

public final void connect ()

Since: API Level 1.5

Connects to the API

public void deleteImageSharing (String sharingId)

Since: API Level 1.5

deletes an image sharing by its sharing id from history and abort/reject any associated ongoing session if such exists.

Parameters
sharingId the sharing ID
Throws
RcsServiceNotAvailableException
RcsGenericException
RcsServiceNotAvailableException

public void deleteImageSharings ()

Since: API Level 1.5

Deletes all image sharing from history and abort/reject any associated ongoing session if such exists.

Throws
RcsServiceNotAvailableException
RcsGenericException
RcsServiceNotAvailableException

public void deleteImageSharings (ContactId contact)

Since: API Level 1.5

Deletes image sharing with a given contact from history and abort/reject any associated ongoing session if such exists

Parameters
contact The remote contact
Throws
RcsServiceNotAvailableException
RcsGenericException
RcsServiceNotAvailableException

public void disconnect ()

Since: API Level 1.5

Disconnects from the API

public ImageSharingServiceConfiguration getConfiguration ()

Since: API Level 1.5

Returns the configuration of image sharing service

Returns
  • ImageSharingServiceConfiguration
Throws
RcsServiceNotAvailableException
RcsGenericException
RcsServiceNotAvailableException

public ImageSharing getImageSharing (String sharingId)

Since: API Level 1.5

Returns a current image sharing from its unique ID

Parameters
sharingId Sharing ID
Returns
  • ImageSharing Image sharing or null if not found
Throws
RcsServiceNotAvailableException
RcsGenericException
RcsServiceNotAvailableException

public void removeEventListener (ImageSharingListener listener)

Since: API Level 1.5

Removes a listener on image sharing events

Parameters
listener Listener
Throws
RcsServiceNotAvailableException
RcsGenericException
RcsServiceNotAvailableException

public ImageSharing shareImage (ContactId contact, Uri file)

Since: API Level 1.5

Shares an image with a contact. The parameter file contains the URI of the image to be shared (for a local or a remote image). An exception if thrown if there is no ongoing CS call. The parameter contact supports the following formats: MSISDN in national or international format, SIP address, SIP-URI or Tel-URI. If the format of the contact is not supported an exception is thrown.

Parameters
contact Contact identifier
file Uri of file to share
Returns
  • ImageSharing
Throws
RcsServiceNotRegisteredException
RcsPersistentStorageException
RcsServiceNotAvailableException
RcsGenericException
RcsPersistentStorageException
RcsServiceNotAvailableException
RcsServiceNotRegisteredException