net.rim.blackberry.api.bbm.platform.profile
Class UserProfile

java.lang.Object
  |
  +--net.rim.blackberry.api.bbm.platform.profile.UserProfile
All Implemented Interfaces:
Presence

public abstract class UserProfile
extends Object
implements Presence

This class provides methods to access the current user's BBM profile.


Field Summary
 
Fields inherited from interface net.rim.blackberry.api.bbm.platform.profile.Presence
STATUS_AVAILABLE, STATUS_BUSY
 
Method Summary
abstract  String getDisplayName()
          Gets the display name of the current user.
 Bitmap getDisplayPicture()
          Gets the display picture of the current user.
abstract  String getHandle()
          Retrieves userís unique ID - it will be different for every BBM instance (BlackBerry, PlayBook, etc)
abstract  String getPersonalMessage()
          Gets the personal message of the current user.
abstract  String getPPID()
          Retrieves userís unique ID - it will be same for every BBM instance (BlackBerry, PlayBook, etc)
abstract  UserProfileBox getProfileBox()
          Gets the current user's profile box for this application.
 ProfileLocation getProfileLocation()
          Gets the location of the current user.
 int getStatus()
          Gets the status of the current user.
abstract  String getStatusMessage()
          Gets the status message of the current user.
abstract  boolean setDisplayPicture(Bitmap pic)
          Sets the display picture of the user.
abstract  boolean setDisplayPicture(EncodedImage pic)
          Sets the display picture of the user.
abstract  boolean setPersonalMessage(String personalMessage)
          Sets the personal message of the user.
abstract  boolean setStatus(int status, String customStatusMessage)
          Sets the status of the user.
 
Methods inherited from interface net.rim.blackberry.api.bbm.platform.profile.Presence
getAppVersion, getBBMSDKVersion
 

Method Detail

getDisplayName

public abstract String getDisplayName()
Gets the display name of the current user.
Returns:
The display name of the current user.
Throws:
PersistentContentException - when Content Protection is enabled and device is locked
Since:
BBM SDK 1.0

getDisplayPicture

public Bitmap getDisplayPicture()
Gets the display picture of the current user.
Returns:
display picture of the current user.
Since:
BBM SDK 1.0

getHandle

public abstract String getHandle()
Retrieves userís unique ID - it will be different for every BBM instance (BlackBerry, PlayBook, etc)
Returns:
Unique ID as Base64Encoded String
Since:
BBM SDK 1.0

getPersonalMessage

public abstract String getPersonalMessage()
Gets the personal message of the current user.
Returns:
The personal message of the current user.
Throws:
PersistentContentException - when Content Protection is enabled and device is locked
Since:
BBM SDK 1.0

getPPID

public abstract String getPPID()
Retrieves userís unique ID - it will be same for every BBM instance (BlackBerry, PlayBook, etc)
Returns:
unique ID
Since:
BBM SDK 1.0

getProfileBox

public abstract UserProfileBox getProfileBox()
                                      throws UserProfileBoxAccessException
Gets the current user's profile box for this application.
Returns:
The profile box.
Throws:
UserProfileBoxAccessException - if the device is in mass storage mode.
Since:
BBM SDK 1.0

getProfileLocation

public ProfileLocation getProfileLocation()
Gets the location of the current user.
Returns:
Location of the current user, or null if the user has disabled it.
Since:
BBM SDK 1.0

getStatus

public int getStatus()
Gets the status of the current user.
Returns:
Status of the current user, defined in Presence.
Since:
BBM SDK 1.0

getStatusMessage

public abstract String getStatusMessage()
Gets the status message of the current user.
Returns:
Status message of the current user. In the English locale, it can be "Available" or "Busy", or a customized message that the user specifies.
Throws:
PersistentContentException - when Content Protection is enabled and device is locked
Since:
BBM SDK 1.0

setDisplayPicture

public abstract boolean setDisplayPicture(Bitmap pic)
Sets the display picture of the user. This method will block as a dialog is presented to the user to allow or deny the change.
Parameters:
pic - Bitmap of the display picture.
Returns:
true if the user allowed the change; false otherwise.
Throws:
NullPointerException - if pic is null.
Since:
BBM SDK 1.0

setDisplayPicture

public abstract boolean setDisplayPicture(EncodedImage pic)
Sets the display picture of the user. This method will block as a dialog is presented to the user to allow or deny the change.
Parameters:
pic - Encoded image of the display picture.
Returns:
true if the user allowed the change; false otherwise.
Throws:
NullPointerException - if pic is null.
Since:
BBM SDK 1.0

setPersonalMessage

public abstract boolean setPersonalMessage(String personalMessage)
Sets the personal message of the user. This method will block as a dialog is presented to the user to allow or deny the change.
Parameters:
personalMessage - The personal message. It supports up to 160 characters; anything over will be truncated. If null is provided then the personal message will be cleared.
Returns:
true if the user allowed the change; false otherwise.
Since:
BBM SDK 1.0

setStatus

public abstract boolean setStatus(int status,
                                  String customStatusMessage)
Sets the status of the user. This method will block as a dialog is presented to the user to allow or deny the change.
Parameters:
status - One of the statuses defined in Presence
customStatusMessage - A customized status message. If null is given, the default status message (e.g. "Available") will be used.
Returns:
true if the user allowed the change; false otherwise.
Since:
BBM SDK 1.0



Copyright 1999- Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.