Mobile native

Account Manager

An account is a collection of information representing the user of a specific provider.

This feature is supported in mobile applications only.

The main features of the Account Manager API include:

  • Creating and managing accounts
  • Retrieving account information
  • Receiving account change notifications
Note
To add, update, or remove an account, you must register your account provider for all your applications belonging to the same package.

The account.h header file handles account-related information. The following table lists the account properties that can be modified.

Table: Account properties
Account property Data type Mandatory Description
User name String Yes Identity of an account.

If the display name and email address are not set for an account, the user name is shown for the account on the Accounts screen in the Setting application.

Display name String No Display name of an account.

Display name is shown for the account on the Accounts screen in the Setting application.

Email address String No Email address of an account.

If the display name is not set for an account, the email address is shown for the account on the Accounts screen in the Setting application.

Package name String No One of an account package IDs, like the app ID.

If the package name is not set for an account, the app ID is used as a package name.

Icon path String No Icon path of an account.

The icon is shown through the registered icon path as an account icon on the Accounts screen in the Setting application.

Domain name String No Domain name of an account.
Access token String No Access token of an account.
Auth type Integer No Authentication type, such as oauth or xauth.
Capability Key-value string-integer pairs No Capability of an account.
Secret Integer No The secret value is used to decide whether the account is shown on the Accounts screen in the Setting application.
Sync support Integer No Current synchronization status.
Source String No Source of an account.
User text String No String array which you can use freely.
User int Integer No Integer array which you can use freely.
Custom Key-value string pairs No Key-value pairs which you can use freely.

Account Providers

Account providers, such as Google and Facebook, represent specific service provider-related information or protocol that provides the user accounts. To add, update, or remove accounts, you must register a specific account provider in your application.

To register an account provider, define the account provider information in the Account tab of the manifest editor, as described in the following table, and implement the account application control.

Table: Account provider properties
Account property Data type Mandatory Description
Multiple accounts support bool Yes Indicates whether multiple accounts are supported.
Icon String Yes File path of the account provider icon.

The icon size is:

  • 72 x 72 for Xhigh (HD)
  • 48 x 48 for High (WVGA)

Since the icon is used in Settings > Accounts, place the icon in a shared directory.

Small icon String Yes File path of the account provider icon.

The icon size is:

  • 45 x 45 for Xhigh (HD)
  • 30 x 30 for High (WVGA)

Since the small icon is used in other applications, place the icon in a shared directory.

Display name String Yes Display name of the account provider.
Capabilities String No Capability of the account provider.

Capability can be a liaison between an account application and another application. If an account application registers a capability in the manifest file, other applications know that the account application has the capability. And if an account application gives an account a capability, other applications know that the account has the capability.

Several service-specific capabilities are defined for the Account Manager in Tizen:

  • Contact capability:

    ACCOUNT_SUPPORTS_CAPABILITY_CONTACT or "http://tizen.org/account/capability/contact"

    If you register this capability in the manifest file, the user using the contact application can see a list of accounts with the account of your service in the contact application.

  • Calendar capability:

    ACCOUNT_SUPPORTS_CAPABILITY_CALENDAR or "http://tizen.org/account/capability/calendar"

    If you register this capability in the manifest file, the user using the calendar application can see a list of accounts with the account of your service in the calendar application.

  • Email capability:

    ACCOUNT_SUPPORTS_CAPABILITY_EMAIL or "http://tizen.org/account/capability/email"

  • Photo capability:

    ACCOUNT_SUPPORTS_CAPABILITY_PHOTO or "http://tizen.org/account/capability/photo"

  • Video capability:

    ACCOUNT_SUPPORTS_CAPABILITY_VIDEO or "http://tizen.org/account/capability/video"

  • Music capability:

    ACCOUNT_SUPPORTS_CAPABILITY_MUSIC or "http://tizen.org/account/capability/music"

  • Document capability:

    ACCOUNT_SUPPORTS_CAPABILITY_DOCUMENT or "http://tizen.org/account/capability/document"

  • Message capability:

    ACCOUNT_SUPPORTS_CAPABILITY_MESSAGE or "http://tizen.org/account/capability/message"

  • Game capability:

    ACCOUNT_SUPPORTS_CAPABILITY_GAME or "http://tizen.org/account/capability/game"

If the application has defined the account provider information and implements the appcontrol for the account provider, the account provider is automatically registered when the application is installed.

Account Application Control

The account application control, which allows the user to add and configure accounts, must be implemented in all applications that define an account provider. You are not required to define the application control information in the Application Control tab of the manifest editor.

This application control supports the http://tizen.org/appcontrol/operation/account/add and http://tizen.org/appcontrol/operation/account/configure operations.

ACCOUNT_OPERATION_SIGNIN Operation

The http://tizen.org/appcontrol/operation/account/add operation enables the user to add a new account for a specific account provider. With the operation, the login page for the specific account provider can be displayed. In Settings > Accounts, if the account provider is clicked for adding a new account, this operation is launched.

You have to define the app_control_cb() callback and register it to ui_app_lifecycle_callback::app_control.

The results of the operation are returned in the app_control_get_operation() event handler.

The following table shows the ACCOUNT_OPERATION_SIGNIN (http://tizen.org/appcontrol/operation/account/add) operation.

Table: ACCOUNT_OPERATION_SIGNIN operation
Operation Description
ACCOUNT_OPERATION_SIGNIN Account ID of the added account.

ACCOUNT_OPERATION_VIEW Operation

The http://tizen.org/appcontrol/operation/account/configure operation enables the user to set account information, such as synchronization settings. The delete button must be included for removing accounts.

In Settings > Accounts, if the specific account is clicked for setting the account information, this operation is launched.

You have to define the app_control_cb() callback and register it to ui_app_lifecycle_callback::app_control.

The results of the operation are returned in the app_control_get_operation() event handler.

The following table shows the ACCOUNT_OPERATION_VIEW (http://tizen.org/appcontrol/operation/account/configure) operation.

Table: ACCOUNT_OPERATION_VIEW operation
Operation Description
ACCOUNT_OPERATION_VIEW Account ID for setting account information.
Go to top