User overview
Understand current user profiles, public profiles, account settings, and presence management in the OpenIM Android SDK.
The OpenIM Android SDK identifies users through unique userID values. User APIs read and update the current user's profile, retrieve public user information, and subscribe to real-time online presence states.
Friend relationships, friend applications, and blocklists belong to relationship management; for their associated data types, APIs, and state updates, see Relationship overview.
User data models
The Android SDK uses distinct data models tailored to different application contexts:
| Class | Application scenario | Primary operations |
|---|---|---|
LocalUser | The authenticated user's profile, settings screens, avatar, nickname, and account preferences. | Get current user profile, Update the current user profile |
PublicUserInfo | Querying application users and presenting public profile cards. | Get user profiles |
UsersOnlineStatus | Online presence, connection status, and active platform lists. | Subscribe to user status, Refresh subscribed user status, Unsubscribe from user status |
LocalUser represents the authenticated user, whereas PublicUserInfo models queryable public contact profiles. Group member profiles, in-group nicknames, and member moderation belong to group capabilities.
Navigation by task
| Task | Documentation page |
|---|---|
Query public profiles by userID to display contact cards | Get user profiles |
| Retrieve or update the current user's nickname, avatar, and custom extensions | Get current user profile, Update the current user profile |
| Set account-level message reception and notification rules | Set global message reception |
| Configure how incoming friend requests are evaluated | Set friend request permissions |
| Subscribe to, query, and cancel user online presence | Subscribe to user status, Refresh subscribed user status, Unsubscribe from user status |
| Manage friends, applications, or blocklists | Relationship overview |
State updates
The Android SDK's UserInfoManager retains a single listener instance. Register OnUserListener centrally within an application event manager, and merge local cached user state using userID as the unique key before dispatching updates to UI observers:
- Current user profile changes: see Update the current user profile.
- Online presence changes: see Subscribe to user status.
- Friend relationships, requests, and blocklist updates: see Relationship overview.
Was this page helpful?