Tizen Native API
Application Information

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_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.

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_NODISPLAY Boolean
    PACKAGE_INFO_PROP_APP_TASKMANAGE Boolean

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
#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
#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
#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
#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

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
Parameters:
[in]app_infoThe application information of each installed application
[in]user_dataThe user data passed from the foreach function
Returns:
true to continue with the next iteration of the loop,
otherwise false 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
typedef struct app_info_s* app_info_h

Application information handle.

Since :
2.3
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
Parameters:
[in]metadata_nameThe name of the metadata
[in]metadata_valueThe value of the metadata
[in]user_dataThe user data passed to app_info_foreach_metadata()
Returns:
true to continue with the next iteration of the loop,
otherwise false 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

Enumeration Type Documentation

Enumeration for Application Information Event.

Since :
2.3
Enumerator:
APP_INFO_EVENT_INSTALLED 

The application is newly installed

APP_INFO_EVENT_UNINSTALLED 

The application is uninstalled

APP_INFO_EVENT_UPDATED 

The application is updated


Function Documentation

int app_info_clone ( app_info_h clone,
app_info_h  app_info 
)

Clones the application information handle.

Since :
2.3
Parameters:
[out]cloneA newly created application information handle, if successfully cloned
[in]app_infoThe application information
Returns:
0 on success, otherwise a negative error value
Return values:
APP_MANAGER_ERROR_NONESuccessful
APP_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
APP_MANAGER_ERROR_OUT_OF_MEMORYOut of memory
APP_MANAGER_ERROR_NO_SUCH_APPThe 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
Parameters:
[in]app_idThe application ID
[out]app_infoThe application information handle
Returns:
0 on success, otherwise a negative error value
Return values:
APP_MANAGER_ERROR_NONESuccessful
APP_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
APP_MANAGER_ERROR_NO_SUCH_APPThe app is not installed
APP_MANAGER_ERROR_OUT_OF_MEMORYOut of memory
See also:
app_manager_foreach_app_info()
app_manager_get_app_info()
int app_info_destroy ( app_info_h  app_info)

Destroys the application information handle and releases all its resources.

Since :
2.3
Parameters:
[in]app_infoThe application information handle
Returns:
0 on success, otherwise a negative error value
Return values:
APP_MANAGER_ERROR_NONESuccessful
APP_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
See also:
app_manager_foreach_app_info()
app_manager_get_app_info()
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
Parameters:
[in]handleThe pointer to the application info filter handle
[in]propertyThe integer property name
[in]valueThe value corresponding to the property
Returns:
0 on success, otherwise a negative error value
Return values:
APP_MANAGER_ERROR_NONESuccessful
APP_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
APP_MANAGER_ERROR_IO_ERRORI/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
Parameters:
[in]handleThe pointer to the application info filter handle
[in]propertyThe integer property name
[in]valueThe value corresponding to the property
Returns:
0 on success, otherwise a negative error value
Return values:
APP_MANAGER_ERROR_NONESuccessful
APP_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
APP_MANAGER_ERROR_IO_ERRORI/O error
int app_info_filter_count_appinfo ( app_info_filter_h  handle,
int *  count 
)

Gets the count of filtered apps.

Since :
2.3
Parameters:
[in]handleThe pointer to the application info filter handle
[out]countThe pointer to the variable for count
Returns:
0 on success, otherwise a negative error value
Return values:
APP_MANAGER_ERROR_NONESuccessful
APP_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
APP_MANAGER_ERROR_IO_ERRORI/O error

Creates the application information filter handle from DB. All filter properties will be ANDed.

Since :
2.3
Parameters:
[out]handleThe pointer to the application info filter handle
Returns:
0 on success, otherwise a negative error value
Return values:
APP_MANAGER_ERROR_NONESuccessful
APP_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
APP_MANAGER_ERROR_OUT_OF_MEMORYOut of memory
APP_MANAGER_ERROR_IO_ERRORI/O error

Destroys the application information filter handle, freeing up all the resources.

Since :
2.3
Parameters:
[in]handleThe pointer to the application info filter handle
Returns:
0 on success, otherwise a negative error value
Return values:
APP_MANAGER_ERROR_NONESuccessful
APP_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
APP_MANAGER_ERROR_IO_ERRORI/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
Parameters:
[in]handleThe pointer to the application info filter handle
[in]callbackThe callback function
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
APP_MANAGER_ERROR_NONESuccessful
APP_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
APP_MANAGER_ERROR_IO_ERRORI/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
Parameters:
[in]app_infoThe application information
[in]callbackThe callback function for list
[in]user_dataThe user data to be passed to callback function
Returns:
0 on success, otherwise a negative error value
Return values:
APP_MANAGER_ERROR_NONESuccessful
APP_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
APP_MANAGER_ERROR_IO_ERRORI/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
Remarks:
You must release app_id using free().
Parameters:
[in]app_infoThe application information
[out]app_idThe application ID of the given application context
Returns:
0 on success, otherwise a negative error value
Return values:
APP_MANAGER_ERROR_NONESuccessful
APP_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
APP_MANAGER_ERROR_OUT_OF_MEMORYOut of memory
int app_info_get_exec ( app_info_h  app_info,
char **  exec 
)

Gets the executable path of the application.

Since :
2.3
Remarks:
You must release exec path using free().
Parameters:
[in]app_infoThe application information
[out]execThe executable path of the application
Returns:
0 on success, otherwise a negative error value
Return values:
APP_MANAGER_ERROR_NONESuccessful
APP_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
APP_MANAGER_ERROR_OUT_OF_MEMORYOut 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
Remarks:
You must release path using free().
Parameters:
[in]app_infoThe application information
[out]pathThe absolute path to the icon
Returns:
0 on success, otherwise a negative error value
Return values:
APP_MANAGER_ERROR_NONESuccessful
APP_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
APP_MANAGER_ERROR_OUT_OF_MEMORYOut of memory
int app_info_get_label ( app_info_h  app_info,
char **  label 
)

Gets the label of the application.

Since :
2.3
Remarks:
You must release label using free().
Parameters:
[in]app_infoThe application information
[out]labelThe label of the application
Returns:
0 on success, otherwise a negative error value
Return values:
APP_MANAGER_ERROR_NONESuccessful
APP_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
APP_MANAGER_ERROR_OUT_OF_MEMORYOut 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
Remarks:
You must release localed name using free().
Parameters:
[in]app_idThe application ID
[in]localeThe locale information
[out]labelThe localed name of the application
Returns:
0 on success, otherwise a negative error value
Return values:
APP_MANAGER_ERROR_NONESuccessful
APP_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
APP_MANAGER_ERROR_OUT_OF_MEMORYOut of memory
int app_info_get_package ( app_info_h  app_info,
char **  package 
)

Gets the package name.

Since :
2.3
Remarks:
You must release package name using free().
Parameters:
[in]app_infoThe application information
[out]packageThe package name
Returns:
0 on success, otherwise a negative error value
Return values:
APP_MANAGER_ERROR_NONESuccessful
APP_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
APP_MANAGER_ERROR_OUT_OF_MEMORYOut of memory
int app_info_get_type ( app_info_h  app_info,
char **  type 
)

Gets the package type name.

Since :
2.3
Remarks:
You must release package type name using free().
Parameters:
[in]app_infoThe application information
[out]typeThe package type
Returns:
0 on success, otherwise a negative error value
Return values:
APP_MANAGER_ERROR_NONESuccessful
APP_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
APP_MANAGER_ERROR_OUT_OF_MEMORYOut of memory
int app_info_is_enabled ( app_info_h  app_info,
bool *  enabled 
)

Checks whether application is enabled.

Since :
2.3
Parameters:
[in]app_infoThe application information
[out]enabledtrue if the application is enabled,
otherwise false
Returns:
0 on success, otherwise a negative error value
Return values:
APP_MANAGER_ERROR_NONESuccessful
APP_MANAGER_ERROR_INVALID_PARAMETERInvalid 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
Parameters:
[in]lhsThe first application information to compare
[in]rhsThe second application information to compare
[out]equaltrue if the application information are equal,
otherwise false
Returns:
0 on success, otherwise a negative error value
Return values:
APP_MANAGER_ERROR_NONESuccessful
APP_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
int app_info_is_nodisplay ( app_info_h  app_info,
bool *  nodisplay 
)

Checks whether application information is nodisplay.

Since :
2.3
Parameters:
[in]app_infoThe application information
[out]nodisplaytrue if the application is nodisplay,
otherwise false
Returns:
0 on success, otherwise a negative error value
Return values:
APP_MANAGER_ERROR_NONESuccessful
APP_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
int app_info_is_onboot ( app_info_h  app_info,
bool *  onboot 
)

Checks whether application is launched on booting time.

Since :
2.3
Parameters:
[in]app_infoThe application information
[out]onboottrue if the application is launched on booting time,
otherwise false
Returns:
0 on success, otherwise a negative error value
Return values:
APP_MANAGER_ERROR_NONESuccessful
APP_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
int app_info_is_preload ( app_info_h  app_info,
bool *  preload 
)

Checks whether application is preloaded.

Since :
2.3
Parameters:
[in]app_infoThe application information
[out]preloadtrue if the application is preloaded,
otherwise false
Returns:
0 on success, otherwise a negative error value
Return values:
APP_MANAGER_ERROR_NONESuccessful
APP_MANAGER_ERROR_INVALID_PARAMETERInvalid 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
Parameters:
[in]handleThe pointer to the application metadata info filter handle
[in]keyThe pointer to metadata key
[in]valueThe pointer to metadata value
Returns:
0 on success, otherwise a negative error value
Return values:
APP_MANAGER_ERROR_NONESuccessful
APP_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
APP_MANAGER_ERROR_IO_ERRORI/O error

Creates the application's metadata information filter handle from DB.

Since :
2.3
Parameters:
[out]handleThe pointer to the application metadata info filter handle
Returns:
0 on success, otherwise a negative error value
Return values:
APP_MANAGER_ERROR_NONESuccessful
APP_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
APP_MANAGER_ERROR_OUT_OF_MEMORYOut of memory
APP_MANAGER_ERROR_IO_ERRORI/O error

Destroys the application's metadata information filter handle.

Since :
2.3
Parameters:
[in]handleThe pointer to the application info filter handle
Returns:
0 on success, otherwise a negative error value
Return values:
APP_MANAGER_ERROR_NONESuccessful
APP_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
APP_MANAGER_ERROR_IO_ERRORI/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
Parameters:
[in]handleThe pointer to the application metadata info filter handle
[in]callbackThe function pointer to callback
[in]user_dataThe pointer to user data
Returns:
0 on success, otherwise a negative error value
Return values:
APP_MANAGER_ERROR_NONESuccessful
APP_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
APP_MANAGER_ERROR_IO_ERRORI/O error