English | Site Directory

Android - An Open Handset Alliance Project

com.google.android.gtalkservice.IChatSession

com.google.android.gtalkservice.IChatSession IInterface

IChatSession interface definition file for chat session. The chat session can be both a single person chat or a group chat.

Nested Classes
IChatSession.Stub Local-side IPC implementation stub class. 
Known Indirect Subclasses

Summary

Public Methods

        void  addRemoteChatListener(IChatListener listener)
Adds a chat listener to this chat session.
        String[]  getParticipants()
Gets the participant usernames of this chat session.
        void  inviteContact(String to)
Invites a contact to join this ChatSession.
        boolean  isGroupChat()
Tells if this ChatSession is a group chat session.
        void  leave()
Leaves this ChatSession.
        void  markAsRead()
Marks that the messages in this ChatSession have been read.
        void  removeRemoteChatListener(IChatListener listener)
Remove a chat listener from this chat sesison.
        void  sendDataMessage(Intent broadcastIntent)
Sends a data message to the contact.
        void  sendTextMessage(String text)
Sends a message to all participants in this ChatSession.
Methods inherited from interface android.os.IInterface

Details

Public Methods

public void addRemoteChatListener(IChatListener listener)

Adds a chat listener to this chat session. When a chat session has a chat listener, it will notify the chat listener incoming messages specific to this chat session. If there isn't a chat listener, the chat session will defer to a more generic handler for notifying incoming messages.

public String[] getParticipants()

Gets the participant usernames of this chat session.

public void inviteContact(String to)

Invites a contact to join this ChatSession. The user can only invite contacts to join this ChatSession if it's a group session. Nothing will happen if this is a simple one-to-one ChatSession.

public boolean isGroupChat()

Tells if this ChatSession is a group chat session.

public void leave()

Leaves this ChatSession. For a group chat session, this sends the server a "leave room" type of message. For a single person chat session, this will clean up the local database entries for the chat session.

public void markAsRead()

Marks that the messages in this ChatSession have been read.

public void removeRemoteChatListener(IChatListener listener)

Remove a chat listener from this chat sesison.

public void sendDataMessage(Intent broadcastIntent)

Sends a data message to the contact. A data message is a user non-visible message. This is a mechanism for peer to peer communication between two devices.

Parameters

broadcastIntent the intent object contains the action to be broadcasted by the receiving device's XmppService, as well as a Bundle that contains a map of key/value pairs to be send to the other device. Althought the class Bundle can contain data of different types, XmppService currently only supports string types for the OTA protocol. All non-string values will be ignored. In the future, data types other than string may be supported.

public void sendTextMessage(String text)

Sends a message to all participants in this ChatSession.
Build m5-rc15g - 14 May 2008 12:50