Browse SDKs · Android
SDKsAndroid

User overview

Learn about current-user profiles, public user profiles, account settings, and online status in the Android SDK.

Copy

OpenIM Android SDK identifies each user by userID. User APIs retrieve and update the current account profile, retrieve public user profiles, and subscribe to user online status.

Friends, friend requests, and blacklists are relationship capabilities between users. See Relationship overview for their types, APIs, and state updates.

User objects

Android SDK returns different user objects for different scenarios:

TypeUse caseMain APIs
LocalUserThe signed-in user's local profile, settings page, avatar, nickname, and account-level settingsgetSelfLocalUserInfo(), setSelfInfo()
PublicUserInfoApplication user lookup and public profile cardsgetUsersInfo()
UsersOnlineStatusUser online status and connected platformssubscribeUsersOnlineStatus(), getSubscribeOnlineUsersStatus(), unsubscribeOnlineUsersStatus()

LocalUser represents the signed-in user, while PublicUserInfo represents a public user profile returned by a query. Group member profiles, in-group nicknames, and member management belong to group capabilities.

Feature entry points

RequirementRecommended page
Retrieve public profiles by userID for profile cardsGet specified user profiles
Read or update the current user's nickname, avatar, and extension dataGet the current user profile, Update the current user profile
Configure account-level message reception and notification behaviorSet global message reception
Choose how other users can add the current accountSet friend request permissions
Subscribe to, retrieve, and unsubscribe from online statusSubscribe to user online status, Get subscribed user online status, Unsubscribe from user status
Manage friends, friend requests, or the blacklistRelationship overview

State updates

The Android SDK retains only one OnUserListener. Set it in the shared event center, then dispatch profile and online-status changes to the relevant screens. This overview does not register another listener. See the owning pages below for event data and handling details: