User overview
Learn about current-user profiles, public user profiles, account settings, and online status in the Android SDK.
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:
| Type | Use case | Main APIs |
|---|---|---|
LocalUser | The signed-in user's local profile, settings page, avatar, nickname, and account-level settings | getSelfLocalUserInfo(), setSelfInfo() |
PublicUserInfo | Application user lookup and public profile cards | getUsersInfo() |
UsersOnlineStatus | User online status and connected platforms | subscribeUsersOnlineStatus(), 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
| Requirement | Recommended page |
|---|---|
Retrieve public profiles by userID for profile cards | Get specified user profiles |
| Read or update the current user's nickname, avatar, and extension data | Get the current user profile, Update the current user profile |
| Configure account-level message reception and notification behavior | Set global message reception |
| Choose how other users can add the current account | Set friend request permissions |
| Subscribe to, retrieve, and unsubscribe from online status | Subscribe to user online status, Get subscribed user online status, Unsubscribe from user status |
| Manage friends, friend requests, or the blacklist | Relationship 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:
- Current user profile changes: Update the current user profile.
- Online status changes: Subscribe to user online status.
- Friend, friend-request, and blacklist changes: Relationship overview.
Was this page helpful?