Tizen Native API
3.0
|
The Application Information API contains functions for obtaining information about installed applications.
Required Header
#include <app_manager.h>
Overview
- Remarks:
- The Application Information API provides two types of functionality:
- Provides installed application's information such as name, type, icon path, and exec path.
- Supports filtering
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_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_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(). | |
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 Documentation
#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.
- Since :
- 2.3.1
#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.
- Since :
- 2.3.1
#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".
- Since :
- 3.0
#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.
- Since :
- 2.3.1
#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.
- Since :
- 2.3.1
#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.
- Since :
- 2.3.1
Typedef Documentation
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.
- Since :
- 2.3.1
- Parameters:
-
[in] app_info The application information of each installed application [in] user_data The user data passed from the foreach function
- Returns:
true
to continue with the next iteration of the loop,
otherwisefalse
to break out of the loop
- Precondition:
- app_manager_foreach_app_info() will invoke this callback.
- See also:
- app_manager_foreach_app_info()
typedef struct app_info_filter_s* app_info_filter_h |
Application filter handle.
- Since :
- 2.3.1
typedef struct app_info_s* app_info_h |
Application information handle.
- Since :
- 2.3.1
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().
- Since :
- 2.3.1
- Parameters:
-
[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()
- Returns:
true
to continue with the next iteration of the loop,
otherwisefalse
to break out of the loop
- Precondition:
- app_info_foreach_metadata() will invoke this callback.
- See also:
- app_info_foreach_metadata()
typedef struct app_info_metadata_filter_s* app_info_metadata_filter_h |
Application metadata filter handle.
- Since :
- 2.3.1
Function Documentation
int app_info_clone | ( | app_info_h * | clone, |
app_info_h | app_info | ||
) |
Clones the application information handle.
- Since :
- 2.3.1
- Parameters:
-
[out] clone A newly created application information handle, if successfully cloned [in] app_info The application information
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 2.3.1
- Parameters:
-
[in] app_id The application ID [out] app_info The application information handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 2.3.1
- Parameters:
-
[in] app_info The application information handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 2.3.1
- Parameters:
-
[in] handle The pointer to the application info filter handle [in] property The integer property name [in] value The value corresponding to the property
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 2.3.1
- Parameters:
-
[in] handle The pointer to the application info filter handle [in] property The integer property name [in] value The value corresponding to the property
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 2.3.1
- Parameters:
-
[in] handle The pointer to the application info filter handle [out] count The pointer to the variable for count
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 2.3.1
- Parameters:
-
[out] handle The pointer to the application info filter handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 2.3.1
- Parameters:
-
[in] handle The pointer to the application info filter handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 2.3.1
- Parameters:
-
[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
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
APP_MANAGER_ERROR_NONE Successful APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter APP_MANAGER_ERROR_IO_ERROR I/O error
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.
- Since :
- 2.3.1
- Parameters:
-
[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
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 2.3.1
- Remarks:
- You must release app_id using free().
- Parameters:
-
[in] app_info The application information [out] app_id The application ID of the given application context
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 2.3.1
- Remarks:
- You must release exec path using free().
- Parameters:
-
[in] app_info The application information [out] exec The executable path of the application
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 2.3.1
- Remarks:
- You must release path using free().
- Parameters:
-
[in] app_info The application information [out] path The absolute path to the icon
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 2.3.1
- Remarks:
- You must release label using free().
- Parameters:
-
[in] app_info The application information [out] label The label of the application
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 2.3.1
- Remarks:
- You must release localed name using free().
- Parameters:
-
[in] app_id The application ID [in] locale The locale information [out] label The localed name of the application
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 2.3.1
- Remarks:
- You must release package name using free().
- Parameters:
-
[in] app_info The application information [out] package The package name
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 2.3.1
- Remarks:
- You must release package type name using free().
- Parameters:
-
[in] app_info The application information [out] type The package type
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 2.3.1
- Parameters:
-
[in] app_info The application information [out] enabled true
if the application is enabled,
otherwisefalse
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 2.3.1
- Parameters:
-
[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,
otherwisefalse
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 2.3.1
- Parameters:
-
[in] app_info The application information [out] nodisplay true
if the application is nodisplay,
otherwisefalse
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 2.3.1
- Parameters:
-
[in] app_info The application information [out] onboot true
if the application is launched on booting time,
otherwisefalse
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 2.3.1
- Parameters:
-
[in] app_info The application information [out] preload true
if the application is preloaded,
otherwisefalse
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 2.3.1
- Parameters:
-
[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
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 2.3.1
- Parameters:
-
[out] handle The pointer to the application metadata info filter handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 2.3.1
- Parameters:
-
[in] handle The pointer to the application info filter handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
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.
- Since :
- 2.3.1
- Parameters:
-
[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
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
APP_MANAGER_ERROR_NONE Successful APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter APP_MANAGER_ERROR_IO_ERROR I/O error