Tizen Native API
|
The Application Information API contains functions for obtaining information about installed applications.
#include <app_manager.h>
Property for filtering | Type |
---|---|
PACKAGE_INFO_PROP_APP_ID | String |
PACKAGE_INFO_PROP_APP_TYPE | String |
PACKAGE_INFO_PROP_APP_CATEGORY | String |
PACKAGE_INFO_PROP_APP_INSTALLED_STORAGE | String |
PACKAGE_INFO_PROP_APP_NODISPLAY | Boolean |
PACKAGE_INFO_PROP_APP_TASKMANAGE | Boolean |
Functions | |
int | app_info_create (const char *app_id, app_info_h *app_info) |
Creates the application information handle. | |
int | app_info_destroy (app_info_h app_info) |
Destroys the application information handle and releases all its resources. | |
int | app_info_get_app_id (app_info_h app_info, char **app_id) |
Gets the application ID with the given application context. | |
int | app_info_get_exec (app_info_h app_info, char **exec) |
Gets the executable path of the application. | |
int | app_info_get_label (app_info_h app_info, char **label) |
Gets the label of the application. | |
int | app_info_get_localed_label (const char *app_id, const char *locale, char **label) |
Gets the localed name of the application. | |
int | app_info_get_icon (app_info_h app_info, char **path) |
Gets the absolute path to the icon image. | |
int | app_info_get_package (app_info_h app_info, char **package) |
Gets the package name. | |
int | app_info_get_type (app_info_h app_info, char **type) |
Gets the package type name. | |
int | app_info_get_app_component_type (app_info_h app_info, app_info_app_component_type_e *type) |
Gets the application component type. | |
int | app_info_foreach_metadata (app_info_h app_info, app_info_metadata_cb callback, void *user_data) |
Gets the list of metadata for a particular application. | |
int | app_info_is_nodisplay (app_info_h app_info, bool *nodisplay) |
Checks whether application information is nodisplay. | |
int | app_info_is_equal (app_info_h lhs, app_info_h rhs, bool *equal) |
Checks whether two application information are equal. | |
int | app_info_is_enabled (app_info_h app_info, bool *enabled) |
Checks whether application is enabled. | |
int | app_info_is_onboot (app_info_h app_info, bool *onboot) |
Checks whether application is launched on booting time. | |
int | app_info_is_preload (app_info_h app_info, bool *preload) |
Checks whether application is preloaded. | |
int | app_info_clone (app_info_h *clone, app_info_h app_info) |
Clones the application information handle. | |
int | app_info_foreach_category (app_info_h app_info, app_info_category_cb callback, void *user_data) |
Runs a callback for each category which the given application belongs to. | |
int | app_info_filter_create (app_info_filter_h *handle) |
Creates the application information filter handle from DB. All filter properties will be ANDed. | |
int | app_info_filter_destroy (app_info_filter_h handle) |
Destroys the application information filter handle, freeing up all the resources. | |
int | app_info_filter_add_bool (app_info_filter_h handle, const char *property, const bool value) |
Adds a boolean filter property to the filter handle. | |
int | app_info_filter_add_string (app_info_filter_h handle, const char *property, const char *value) |
Adds a string filter property to the filter handle. | |
int | app_info_filter_count_appinfo (app_info_filter_h handle, int *count) |
Gets the count of filtered apps. | |
int | app_info_filter_foreach_appinfo (app_info_filter_h handle, app_info_filter_cb callback, void *user_data) |
Executes the user supplied callback function for each application that satisfy the filter conditions. | |
int | app_info_metadata_filter_create (app_info_metadata_filter_h *handle) |
Creates the application's metadata information filter handle from DB. | |
int | app_info_metadata_filter_destroy (app_info_metadata_filter_h handle) |
Destroys the application's metadata information filter handle. | |
int | app_info_metadata_filter_add (app_info_metadata_filter_h handle, const char *key, const char *value) |
Adds filter condition for the query API. | |
int | app_info_metadata_filter_foreach (app_info_metadata_filter_h handle, app_info_filter_cb callback, void *user_data) |
Executes the filter query. | |
Typedefs | |
typedef struct app_info_s * | app_info_h |
Application information handle. | |
typedef struct app_info_filter_s * | app_info_filter_h |
Application filter handle. | |
typedef struct app_info_metadata_filter_s * | app_info_metadata_filter_h |
Application metadata filter handle. | |
typedef bool(* | app_info_filter_cb )(app_info_h app_info, void *user_data) |
Called to get the application information once for each installed application. | |
typedef bool(* | app_info_metadata_cb )(const char *metadata_key, const char *metadata_value, void *user_data) |
Called to get application metadata in app_info_foreach_metadata(). | |
typedef bool(* | app_info_category_cb )(const char *category, void *user_data) |
Called for each application category in app_info_foreach_category(). | |
Defines | |
#define | PACKAGE_INFO_PROP_APP_ID "PACKAGE_INFO_PROP_APP_ID" |
Definition for string property for filtering based on app info: String property for filtering packages with app id. | |
#define | PACKAGE_INFO_PROP_APP_TYPE "PACKAGE_INFO_PROP_APP_TYPE" |
Definition for string property for filtering based on app info: String property for filtering packages with app type. | |
#define | PACKAGE_INFO_PROP_APP_CATEGORY "PACKAGE_INFO_PROP_APP_CATEGORY" |
Definition for string property for filtering based on app info: String property for filtering packages with app category. | |
#define | PACKAGE_INFO_PROP_APP_INSTALLED_STORAGE "PACKAGE_INFO_PROP_APP_INSTALLED_STORAGE" |
Definition for string property for filtering based on app info: String property for filtering packages with installed storage of app Value related with this property should be "installed_internal" or "installed_external". | |
#define | PACKAGE_INFO_PROP_APP_NODISPLAY "PACKAGE_INFO_PROP_APP_NODISPLAY" |
Definition for boolean property for filtering based on app info: Boolean property for filtering whether the package is nodisplay or not based on package info. | |
#define | PACKAGE_INFO_PROP_APP_TASKMANAGE "PACKAGE_INFO_PROP_APP_TASKMANAGE" |
Definition for boolean property for filtering based on app info: Boolean property for filtering whether the package has the authority to manage task or not based on package info. | |
#define | PACKAGE_INFO_PROP_APP_DISABLED "PACKAGE_INFO_PROP_APP_DISABLED" |
Definition for boolean property for filtering based on app info: Boolean property for filtering whether the application has been disabled. | |
#define | PACKAGE_INFO_PROP_APP_COMPONENT_TYPE "PACKAGE_INFO_PROP_APP_COMPONENT_TYPE" |
Definition for string property for filtering based on app info: String property for filtering with the application component type. Value related with this property should be one of "uiapp", "svcapp", "widgetapp" and "watchapp". |
#define PACKAGE_INFO_PROP_APP_CATEGORY "PACKAGE_INFO_PROP_APP_CATEGORY" |
Definition for string property for filtering based on app info: String property for filtering packages with app category.
#define PACKAGE_INFO_PROP_APP_COMPONENT_TYPE "PACKAGE_INFO_PROP_APP_COMPONENT_TYPE" |
Definition for string property for filtering based on app info: String property for filtering with the application component type. Value related with this property should be one of "uiapp", "svcapp", "widgetapp" and "watchapp".
#define PACKAGE_INFO_PROP_APP_DISABLED "PACKAGE_INFO_PROP_APP_DISABLED" |
Definition for boolean property for filtering based on app info: Boolean property for filtering whether the application has been disabled.
#define PACKAGE_INFO_PROP_APP_ID "PACKAGE_INFO_PROP_APP_ID" |
Definition for string property for filtering based on app info: String property for filtering packages with app id.
#define PACKAGE_INFO_PROP_APP_INSTALLED_STORAGE "PACKAGE_INFO_PROP_APP_INSTALLED_STORAGE" |
Definition for string property for filtering based on app info: String property for filtering packages with installed storage of app Value related with this property should be "installed_internal" or "installed_external".
#define PACKAGE_INFO_PROP_APP_NODISPLAY "PACKAGE_INFO_PROP_APP_NODISPLAY" |
Definition for boolean property for filtering based on app info: Boolean property for filtering whether the package is nodisplay or not based on package info.
#define PACKAGE_INFO_PROP_APP_TASKMANAGE "PACKAGE_INFO_PROP_APP_TASKMANAGE" |
Definition for boolean property for filtering based on app info: Boolean property for filtering whether the package has the authority to manage task or not based on package info.
#define PACKAGE_INFO_PROP_APP_TYPE "PACKAGE_INFO_PROP_APP_TYPE" |
Definition for string property for filtering based on app info: String property for filtering packages with app type.
typedef bool(* app_info_category_cb)(const char *category, void *user_data) |
Called for each application category in app_info_foreach_category().
[in] | category | The name of the category |
[in] | user_data | The user data passed to app_info_foreach_category() |
true
to continue with the next iteration of the loop, false
to break out of the loop typedef bool(* app_info_filter_cb)(app_info_h app_info, void *user_data) |
Called to get the application information once for each installed application.
[in] | app_info | The application information of each installed application |
[in] | user_data | The user data passed from the foreach function |
true
to continue with the next iteration of the loop, false
to break out of the loop typedef struct app_info_filter_s* app_info_filter_h |
Application filter handle.
typedef struct app_info_s* app_info_h |
Application information handle.
typedef bool(* app_info_metadata_cb)(const char *metadata_key, const char *metadata_value, void *user_data) |
Called to get application metadata in app_info_foreach_metadata().
[in] | metadata_name | The name of the metadata |
[in] | metadata_value | The value of the metadata |
[in] | user_data | The user data passed to app_info_foreach_metadata() |
true
to continue with the next iteration of the loop, false
to break out of the loop typedef struct app_info_metadata_filter_s* app_info_metadata_filter_h |
Application metadata filter handle.
Enumeration for application component type.
A component is an application considered as a part of a package. The application component type indicates what type of a component an application is in a package.
int app_info_clone | ( | app_info_h * | clone, |
app_info_h | app_info | ||
) |
Clones the application information handle.
[out] | clone | A newly created application information handle, if successfully cloned |
[in] | app_info | The application information |
0
on success, otherwise a negative error value APP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
APP_MANAGER_ERROR_OUT_OF_MEMORY | Out of memory |
APP_MANAGER_ERROR_NO_SUCH_APP | The app is not installed |
int app_info_create | ( | const char * | app_id, |
app_info_h * | app_info | ||
) |
Creates the application information handle.
[in] | app_id | The application ID |
[out] | app_info | The application information handle |
0
on success, otherwise a negative error value APP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
APP_MANAGER_ERROR_NO_SUCH_APP | The app is not installed |
APP_MANAGER_ERROR_OUT_OF_MEMORY | Out of memory |
int app_info_destroy | ( | app_info_h | app_info | ) |
Destroys the application information handle and releases all its resources.
[in] | app_info | The application information handle |
0
on success, otherwise a negative error value APP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
int app_info_filter_add_bool | ( | app_info_filter_h | handle, |
const char * | property, | ||
const bool | value | ||
) |
Adds a boolean filter property to the filter handle.
[in] | handle | The pointer to the application info filter handle |
[in] | property | The integer property name |
[in] | value | The value corresponding to the property |
0
on success, otherwise a negative error value APP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
APP_MANAGER_ERROR_IO_ERROR | I/O error |
int app_info_filter_add_string | ( | app_info_filter_h | handle, |
const char * | property, | ||
const char * | value | ||
) |
Adds a string filter property to the filter handle.
[in] | handle | The pointer to the application info filter handle |
[in] | property | The integer property name |
[in] | value | The value corresponding to the property |
0
on success, otherwise a negative error value APP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
APP_MANAGER_ERROR_IO_ERROR | I/O error |
int app_info_filter_count_appinfo | ( | app_info_filter_h | handle, |
int * | count | ||
) |
Gets the count of filtered apps.
[in] | handle | The pointer to the application info filter handle |
[out] | count | The pointer to the variable for count |
0
on success, otherwise a negative error value APP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
APP_MANAGER_ERROR_IO_ERROR | I/O error |
int app_info_filter_create | ( | app_info_filter_h * | handle | ) |
Creates the application information filter handle from DB. All filter properties will be ANDed.
[out] | handle | The pointer to the application info filter handle |
0
on success, otherwise a negative error value APP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
APP_MANAGER_ERROR_OUT_OF_MEMORY | Out of memory |
APP_MANAGER_ERROR_IO_ERROR | I/O error |
int app_info_filter_destroy | ( | app_info_filter_h | handle | ) |
Destroys the application information filter handle, freeing up all the resources.
[in] | handle | The pointer to the application info filter handle |
0
on success, otherwise a negative error value APP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
APP_MANAGER_ERROR_IO_ERROR | I/O error |
int app_info_filter_foreach_appinfo | ( | app_info_filter_h | handle, |
app_info_filter_cb | callback, | ||
void * | user_data | ||
) |
Executes the user supplied callback function for each application that satisfy the filter conditions.
[in] | handle | The pointer to the application info filter handle |
[in] | callback | The callback function |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error value APP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
APP_MANAGER_ERROR_IO_ERROR | I/O error |
int app_info_foreach_category | ( | app_info_h | app_info, |
app_info_category_cb | callback, | ||
void * | user_data | ||
) |
Runs a callback for each category which the given application belongs to.
[in] | app_info | The application information |
[in] | callback | The callback function |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error value APP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
APP_MANAGER_ERROR_IO_ERROR | I/O error |
APP_MANAGER_ERROR_PERMISSION_DENIED | Permission denied |
int app_info_foreach_metadata | ( | app_info_h | app_info, |
app_info_metadata_cb | callback, | ||
void * | user_data | ||
) |
Gets the list of metadata for a particular application.
[in] | app_info | The application information |
[in] | callback | The callback function for list |
[in] | user_data | The user data to be passed to callback function |
0
on success, otherwise a negative error value APP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
APP_MANAGER_ERROR_IO_ERROR | I/O error |
int app_info_get_app_component_type | ( | app_info_h | app_info, |
app_info_app_component_type_e * | type | ||
) |
Gets the application component type.
[in] | app_info | The application information |
[out] | type | The application component type |
0
on success, otherwise a negative error value APP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
APP_MANAGER_ERROR_IO_ERROR | I/O error |
int app_info_get_app_id | ( | app_info_h | app_info, |
char ** | app_id | ||
) |
Gets the application ID with the given application context.
[in] | app_info | The application information |
[out] | app_id | The application ID of the given application context |
0
on success, otherwise a negative error value APP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
APP_MANAGER_ERROR_OUT_OF_MEMORY | Out of memory |
int app_info_get_exec | ( | app_info_h | app_info, |
char ** | exec | ||
) |
Gets the executable path of the application.
[in] | app_info | The application information |
[out] | exec | The executable path of the application |
0
on success, otherwise a negative error value APP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
APP_MANAGER_ERROR_OUT_OF_MEMORY | Out of memory |
int app_info_get_icon | ( | app_info_h | app_info, |
char ** | path | ||
) |
Gets the absolute path to the icon image.
[in] | app_info | The application information |
[out] | path | The absolute path to the icon |
0
on success, otherwise a negative error value APP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
APP_MANAGER_ERROR_OUT_OF_MEMORY | Out of memory |
int app_info_get_label | ( | app_info_h | app_info, |
char ** | label | ||
) |
Gets the label of the application.
[in] | app_info | The application information |
[out] | label | The label of the application |
0
on success, otherwise a negative error value APP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
APP_MANAGER_ERROR_OUT_OF_MEMORY | Out of memory |
int app_info_get_localed_label | ( | const char * | app_id, |
const char * | locale, | ||
char ** | label | ||
) |
Gets the localed name of the application.
[in] | app_id | The application ID |
[in] | locale | The locale information |
[out] | label | The localed name of the application |
0
on success, otherwise a negative error value APP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
APP_MANAGER_ERROR_OUT_OF_MEMORY | Out of memory |
int app_info_get_package | ( | app_info_h | app_info, |
char ** | package | ||
) |
Gets the package name.
[in] | app_info | The application information |
[out] | package | The package name |
0
on success, otherwise a negative error value APP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
APP_MANAGER_ERROR_OUT_OF_MEMORY | Out of memory |
int app_info_get_type | ( | app_info_h | app_info, |
char ** | type | ||
) |
Gets the package type name.
[in] | app_info | The application information |
[out] | type | The package type |
0
on success, otherwise a negative error value APP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
APP_MANAGER_ERROR_OUT_OF_MEMORY | Out of memory |
int app_info_is_enabled | ( | app_info_h | app_info, |
bool * | enabled | ||
) |
Checks whether application is enabled.
[in] | app_info | The application information |
[out] | enabled | true if the application is enabled, otherwise false |
0
on success, otherwise a negative error value APP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
int app_info_is_equal | ( | app_info_h | lhs, |
app_info_h | rhs, | ||
bool * | equal | ||
) |
Checks whether two application information are equal.
[in] | lhs | The first application information to compare |
[in] | rhs | The second application information to compare |
[out] | equal | true if the application information are equal, otherwise false |
0
on success, otherwise a negative error value APP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
int app_info_is_nodisplay | ( | app_info_h | app_info, |
bool * | nodisplay | ||
) |
Checks whether application information is nodisplay.
[in] | app_info | The application information |
[out] | nodisplay | true if the application is nodisplay, otherwise false |
0
on success, otherwise a negative error value APP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
int app_info_is_onboot | ( | app_info_h | app_info, |
bool * | onboot | ||
) |
Checks whether application is launched on booting time.
[in] | app_info | The application information |
[out] | onboot | true if the application is launched on booting time, otherwise false |
0
on success, otherwise a negative error value APP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
int app_info_is_preload | ( | app_info_h | app_info, |
bool * | preload | ||
) |
Checks whether application is preloaded.
[in] | app_info | The application information |
[out] | preload | true if the application is preloaded, otherwise false |
0
on success, otherwise a negative error value APP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
int app_info_metadata_filter_add | ( | app_info_metadata_filter_h | handle, |
const char * | key, | ||
const char * | value | ||
) |
Adds filter condition for the query API.
The query will search the entire application metadata information collected from the manifest file of all the installed packages. You can specify value as NULL
to search based on key only.
[in] | handle | The pointer to the application metadata info filter handle |
[in] | key | The pointer to metadata key |
[in] | value | The pointer to metadata value |
0
on success, otherwise a negative error value APP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
APP_MANAGER_ERROR_IO_ERROR | I/O error |
int app_info_metadata_filter_create | ( | app_info_metadata_filter_h * | handle | ) |
Creates the application's metadata information filter handle from DB.
[out] | handle | The pointer to the application metadata info filter handle |
0
on success, otherwise a negative error value APP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
APP_MANAGER_ERROR_OUT_OF_MEMORY | Out of memory |
APP_MANAGER_ERROR_IO_ERROR | I/O error |
int app_info_metadata_filter_destroy | ( | app_info_metadata_filter_h | handle | ) |
Destroys the application's metadata information filter handle.
[in] | handle | The pointer to the application info filter handle |
0
on success, otherwise a negative error value APP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
APP_MANAGER_ERROR_IO_ERROR | I/O error |
int app_info_metadata_filter_foreach | ( | app_info_metadata_filter_h | handle, |
app_info_filter_cb | callback, | ||
void * | user_data | ||
) |
Executes the filter query.
The query will search the entire application metadata information collected from the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns negative value, no more callbacks will be called and API will return.
[in] | handle | The pointer to the application metadata info filter handle |
[in] | callback | The function pointer to callback |
[in] | user_data | The pointer to user data |
0
on success, otherwise a negative error value APP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
APP_MANAGER_ERROR_IO_ERROR | I/O error |