Show / Hide Table of Contents

    Class AccountService

    Definition

    Namespace:
    Tizen.Account.AccountManager
    Assembly:
    Tizen.Account.AccountManager.dll
    API Level:
    3

    The AccountManager APIs are separated into two major sections:

    1. Registering an account provider while an application is installed. This information will be used for the Add account screen.
    2. Adding an account information when an application signs in successfully to share the account information to the Tizen system. This information will be shown in the Tizen settings account menu.

    The APIs of both of the sections consist of the following functionality:

    • Create an account or account provider.
    • Update an account or account provider (Only available for the creator).
    • Delete an account or account provider (Only available for the creator).
    • Read an account or account provider with some filter.

    public static class AccountService
    Inheritance
    Object
    AccountService

    Fields

    View Source

    CalendarCapability

    This is the calendar capability string.

    Declaration
    public static readonly string CalendarCapability
    Field Value
    Type Description
    String
    API Level: 3
    View Source

    ContactCapability

    This is the contact capability string.

    Declaration
    public static readonly string ContactCapability
    Field Value
    Type Description
    String
    API Level: 3
    View Source

    DocumentCapability

    This is the document capability string.

    Declaration
    public static readonly string DocumentCapability
    Field Value
    Type Description
    String
    API Level: 3
    View Source

    EmailCapability

    This is the email capability string.

    Declaration
    public static readonly string EmailCapability
    Field Value
    Type Description
    String
    API Level: 3
    View Source

    GameCapability

    This is the game capability string.

    Declaration
    public static readonly string GameCapability
    Field Value
    Type Description
    String
    API Level: 3
    View Source

    MessageCapability

    This is the message capability string.

    Declaration
    public static readonly string MessageCapability
    Field Value
    Type Description
    String
    API Level: 3
    View Source

    MusicCapability

    This is the music capability string.

    Declaration
    public static readonly string MusicCapability
    Field Value
    Type Description
    String
    API Level: 3
    View Source

    PhotoCapability

    This is the photo capability string.

    Declaration
    public static readonly string PhotoCapability
    Field Value
    Type Description
    String
    API Level: 3
    View Source

    VideoCapability

    This is the video capability string.

    Declaration
    public static readonly string VideoCapability
    Field Value
    Type Description
    String
    API Level: 3

    Methods

    View Source

    AddAccount(Account)

    Inserts into the Database with the new account Information.

    Declaration
    public static int AddAccount(Account account)
    Parameters
    Type Name Description
    Account account

    New Account instance to be added.

    Returns
    Type Description
    Int32

    The account ID of the account instance.

    Exceptions
    Type Condition
    InvalidOperationException

    In case of any DB error.

    ArgumentException

    In case of an invalid parameter.

    UnauthorizedAccessException

    In case of privilege not defined.

    OutOfMemoryException

    In case of OutOfMemory error.

    NotSupportedException

    The required feature is not supported.

    API Level: 3
    Privilege Level: public
    Privilege: http://tizen.org/privilege/account.readhttp://tizen.org/privilege/account.write
    Feature: http://tizen.org/feature/account
    View Source

    DeleteAccount(String)

    Deletes the account from the account database by package name.

    Declaration
    public static void DeleteAccount(string packageName)
    Parameters
    Type Name Description
    String packageName

    The package name of the account to delete.

    Exceptions
    Type Condition
    InvalidOperationException

    In case of any DB error.

    ArgumentException

    In case of an invalid parameter.

    UnauthorizedAccessException

    In case of privilege not defined.

    NotSupportedException

    The required feature is not supported.

    API Level: 3
    Privilege Level: public
    Privilege: http://tizen.org/privilege/account.readhttp://tizen.org/privilege/account.write
    Feature: http://tizen.org/feature/account
    View Source

    DeleteAccount(String, String)

    Deletes the account from the account database by user name.

    Declaration
    public static void DeleteAccount(string userName, string packageName)
    Parameters
    Type Name Description
    String userName

    The user name of the account to delete.

    String packageName

    The package name of the account to delete.

    Exceptions
    Type Condition
    InvalidOperationException

    In case of any DB error.

    ArgumentException

    In case of an invalid parameter.

    UnauthorizedAccessException

    In case of privilege not defined.

    NotSupportedException

    The required feature is not supported.

    API Level: 3
    Privilege Level: public
    Privilege: http://tizen.org/privilege/account.readhttp://tizen.org/privilege/account.write
    Feature: http://tizen.org/feature/account
    View Source

    DeleteAccount(Account)

    Deletes the account information from the database.

    Declaration
    public static void DeleteAccount(Account account)
    Parameters
    Type Name Description
    Account account

    Account instance to be deleted from the database.

    Exceptions
    Type Condition
    InvalidOperationException

    In case of any DB error.

    ArgumentException

    In case of an invalid parameter.

    UnauthorizedAccessException

    In case of privilege not defined.

    NotSupportedException

    The required feature is not supported.

    API Level: 3
    Privilege Level: public
    Privilege: http://tizen.org/privilege/account.readhttp://tizen.org/privilege/account.write
    Feature: http://tizen.org/feature/account
    View Source

    GetAccountById(Int32)

    Retrieves the account with the account ID.

    Declaration
    public static Account GetAccountById(int accountId)
    Parameters
    Type Name Description
    Int32 accountId

    The account ID to be searched.

    Returns
    Type Description
    Account

    Account instance with reference to the given ID.

    Exceptions
    Type Condition
    InvalidOperationException

    In case of any DB error or record not found for given account ID.

    ArgumentException

    In case of an invalid parameter.

    UnauthorizedAccessException

    In case of privilege not defined.

    NotSupportedException

    The required feature is not supported.

    API Level: 3
    Privilege Level: public
    Privilege: http://tizen.org/privilege/account.read
    Feature: http://tizen.org/feature/account
    View Source

    GetAccountProviderByAppId(String)

    Retrieves the account provider information with the application ID.

    Declaration
    public static AccountProvider GetAccountProviderByAppId(string appId)
    Parameters
    Type Name Description
    String appId

    The application ID.

    Returns
    Type Description
    AccountProvider

    The AccountProvider instance associated with the given application ID.

    Exceptions
    Type Condition
    InvalidOperationException

    In case of any DB error or record not found for given appId.

    ArgumentException

    In case of an invalid parameter.

    UnauthorizedAccessException

    In case of privilege not defined.

    NotSupportedException

    The required feature is not supported.

    API Level: 3
    Privilege Level: public
    Privilege: http://tizen.org/privilege/account.read
    Feature: http://tizen.org/feature/account
    View Source

    GetAccountProviders()

    Retrieves all the AccountProviders details from the account database.

    Declaration
    public static IEnumerable<AccountProvider> GetAccountProviders()
    Returns
    Type Description
    IEnumerable<AccountProvider>

    List of AccountProviders.

    Exceptions
    Type Condition
    InvalidOperationException

    In case of any DB error.

    UnauthorizedAccessException

    In case of privilege not defined.

    NotSupportedException

    The required feature is not supported.

    API Level: 3
    Privilege Level: public
    Privilege: http://tizen.org/privilege/account.read
    Feature: http://tizen.org/feature/account
    View Source

    GetAccountProvidersByFeature(String)

    Retrieves all the account providers information with feature.

    Declaration
    public static IEnumerable<AccountProvider> GetAccountProvidersByFeature(string feature)
    Parameters
    Type Name Description
    String feature

    The capability value to search for account providers.

    Returns
    Type Description
    IEnumerable<AccountProvider>

    Retrieves the AccountProviders information with the capability name.

    Exceptions
    Type Condition
    InvalidOperationException

    In case of any DB error or record not found for given feature.

    ArgumentException

    In case of invalid parameter.

    UnauthorizedAccessException

    In case of privilege not defined.

    NotSupportedException

    The required feature is not supported.

    API Level: 3
    Privilege Level: public
    Privilege: http://tizen.org/privilege/account.read
    Feature: http://tizen.org/feature/account
    View Source

    GetAccountsAsync()

    Retrieves all the accounts details from the account database.

    Declaration
    public static IEnumerable<Account> GetAccountsAsync()
    Returns
    Type Description
    IEnumerable<Account>

    List of accounts.

    Exceptions
    Type Condition
    InvalidOperationException

    In case of any DB error.

    UnauthorizedAccessException

    In case of privilege not defined.

    NotSupportedException

    The required feature is not supported.

    API Level: 3
    Privilege Level: public
    Privilege: http://tizen.org/privilege/account.read
    Feature: http://tizen.org/feature/account
    View Source

    GetAccountsByCapabilityType(String)

    Retrieves all accounts with the given capability type.

    Declaration
    public static IEnumerable<Account> GetAccountsByCapabilityType(string type)
    Parameters
    Type Name Description
    String type

    Capability type.

    Returns
    Type Description
    IEnumerable<Account>

    Accounts list matched with the capability type.

    Exceptions
    Type Condition
    InvalidOperationException

    In case of any DB error or record not found for the given capability type.

    ArgumentException

    In case of an invalid parameter.

    UnauthorizedAccessException

    In case of privilege not defined.

    NotSupportedException

    The required feature is not supported.

    API Level: 3
    Privilege Level: public
    Privilege: http://tizen.org/privilege/account.read
    Feature: http://tizen.org/feature/account
    View Source

    GetAccountsByPackageName(String)

    Retrieves all the accounts with the given package name.

    Declaration
    public static IEnumerable<Account> GetAccountsByPackageName(string packageName)
    Parameters
    Type Name Description
    String packageName

    The package name to search.

    Returns
    Type Description
    IEnumerable<Account>

    Accounts list matched with the package name.

    Exceptions
    Type Condition
    InvalidOperationException

    In case of any DB error or record not found for given package name.

    ArgumentException

    In case of an invalid parameter.

    UnauthorizedAccessException

    In case of privilege not defined.

    NotSupportedException

    The required feature is not supported.

    API Level: 3
    Privilege Level: public
    Privilege: http://tizen.org/privilege/account.read
    Feature: http://tizen.org/feature/account
    View Source

    GetAccountsByUserName(String)

    Retrieves all the accounts with the given user name.

    Declaration
    public static IEnumerable<Account> GetAccountsByUserName(string userName)
    Parameters
    Type Name Description
    String userName

    The user name to search.

    Returns
    Type Description
    IEnumerable<Account>

    Accounts list matched with the user name.

    Exceptions
    Type Condition
    InvalidOperationException

    In case of any DB error or record not found for given username.

    ArgumentException

    In case of an invalid parameter.

    UnauthorizedAccessException

    In case of privilege not defined.

    NotSupportedException

    The required feature is not supported.

    API Level: 3
    Privilege Level: public
    Privilege: http://tizen.org/privilege/account.read
    Feature: http://tizen.org/feature/account
    View Source

    GetAccountsCount()

    Gets the count of accounts in the account database.

    Declaration
    public static int GetAccountsCount()
    Returns
    Type Description
    Int32

    The number of accounts in the database.

    Exceptions
    Type Condition
    InvalidOperationException

    In case of any DB error.

    UnauthorizedAccessException

    In case of privilege not defined.

    NotSupportedException

    The required feature is not supported.

    API Level: 3
    Privilege Level: public
    Privilege: http://tizen.org/privilege/account.read
    Feature: http://tizen.org/feature/account
    View Source

    GetCapabilitiesById(Int32)

    Retrieves all the capabilities with the given account.

    Declaration
    public static Dictionary<string, CapabilityState> GetCapabilitiesById(int accountId)
    Parameters
    Type Name Description
    Int32 accountId

    Account instance.

    Returns
    Type Description
    Dictionary<String, CapabilityState>

    Capabilities list as dictionary of the capability type and state.

    Exceptions
    Type Condition
    InvalidOperationException

    In case of any DB error or record not found for given account ID.

    ArgumentException

    In case of an invalid parameter.

    UnauthorizedAccessException

    In case of privilege not defined.

    NotSupportedException

    The required feature is not supported.

    API Level: 3
    Privilege Level: public
    Privilege: http://tizen.org/privilege/account.read
    Feature: http://tizen.org/feature/account
    View Source

    UpdateAccount(Account)

    Updates the account details to the account database.

    Declaration
    public static void UpdateAccount(Account account)
    Parameters
    Type Name Description
    Account account

    Account instance to be updated.

    Exceptions
    Type Condition
    InvalidOperationException

    In case of any DB error.

    ArgumentException

    In case of an invalid parameter.

    UnauthorizedAccessException

    In case of privilege not defined.

    OutOfMemoryException

    In case of OutOfMemory error.

    NotSupportedException

    The required feature is not supported.

    API Level: 3
    Privilege Level: public
    Privilege: http://tizen.org/privilege/account.readhttp://tizen.org/privilege/account.write
    Feature: http://tizen.org/feature/account
    View Source

    UpdateSyncStatusById(Account, AccountSyncState)

    Updates the sync status of the given account.

    Declaration
    public static void UpdateSyncStatusById(Account account, AccountSyncState status)
    Parameters
    Type Name Description
    Account account

    Account for which the sync status needs to be updated.

    AccountSyncState status

    Sync State

    Exceptions
    Type Condition
    InvalidOperationException

    In case of any DB error.

    ArgumentException

    In case of an invalid parameter.

    UnauthorizedAccessException

    In case of privilege not defined.

    NotSupportedException

    The required feature is not supported.

    API Level: 3
    Privilege Level: public
    Privilege: http://tizen.org/privilege/account.readhttp://tizen.org/privilege/account.write
    Feature: http://tizen.org/feature/account

    Events

    View Source

    AccountUpdated

    ContentUpdated event is triggered when the media item info from DB changes.

    Declaration
    public static event EventHandler<AccountSubscriberEventArgs> AccountUpdated
    Event Type
    Type Description
    EventHandler<AccountSubscriberEventArgs>
    Remarks

    ContentUpdate event is triggered if the MediaInformation updated/deleted or new information is inserted.

    Exceptions
    Type Condition
    InvalidOperationException

    In case of any DB error.

    ArgumentException

    In case of an invalid parameter.

    UnauthorizedAccessException

    In case of privilege not defined.

    NotSupportedException

    The required feature is not supported.

    API Level: 3
    Privilege Level: public
    Privilege: http://tizen.org/privilege/account.read
    Feature: http://tizen.org/feature/account
    • View Source
    Back to top Copyright © 2016-2022 Samsung
    Generated by DocFX