Tizen Native API
5.5
|
The Application Manager API provides functions to get information about installed or running applications and manage the applications.
#include <app_manager.h>
The Application Manager API provides information about applications. There are several different sorts of queries. Two iterator functions step through a list of applications. One is used in running applications(app_manager_foreach_app_context()), and the other is used in available ("installed") but not necessarily running applications(app_manager_foreach_app_info()). Each will call a callback function, passing the package name of each application found. A query function will respond whether the application represented by a particular package name is running. Other query functions return static information about an application, such as a name, a type, an icon path, or a version. The API provides functions to manage applications also. By using them, it is possible to resume(app_manager_resume_app) applications.
Functions | |
int | app_manager_set_app_context_event_cb (app_manager_app_context_event_cb callback, void *user_data) |
Registers a callback function to be invoked when the applications get launched or terminated. | |
void | app_manager_unset_app_context_event_cb (void) |
Unregisters the callback function. | |
int | app_manager_foreach_app_context (app_manager_app_context_cb callback, void *user_data) |
Retrieves all application contexts of running applications. | |
int | app_manager_foreach_running_app_context (app_manager_app_context_cb callback, void *user_data) |
Retrieves all application contexts of running applications including sub apps. | |
int | app_manager_get_app_context (const char *app_id, app_context_h *app_context) |
Gets the application context for the given ID of the application. | |
int | app_manager_get_app_id (pid_t pid, char **app_id) |
Gets the ID of the application for the given process ID. | |
int | app_manager_is_running (const char *app_id, bool *running) |
Checks whether the application with the given ID of the application is running. | |
int | app_manager_resume_app (app_context_h app_context) |
Resumes the application. | |
int | app_manager_request_terminate_bg_app (app_context_h app_context) |
Terminates the back ground application. UI applications that are in paused state or some service applications could be required to terminate by this API. | |
int | app_manager_foreach_app_info (app_manager_app_info_cb callback, void *user_data) |
Retrieves all installed applications information. | |
int | app_manager_get_app_info (const char *app_id, app_info_h *app_info) |
Gets the application information for the given application ID. | |
int | app_manager_get_shared_data_path (const char *app_id, char **path) |
Gets the absolute path to the shared data directory of the application specified with an application ID. | |
int | app_manager_get_shared_resource_path (const char *app_id, char **path) |
Gets the absolute path to the shared resource directory of the application specified with an application ID. | |
int | app_manager_get_shared_trusted_path (const char *app_id, char **path) |
Gets the absolute path to the shared trusted directory of the application specified with an application ID. | |
int | app_manager_get_external_shared_data_path (const char *app_id, char **path) TIZEN_DEPRECATED_API |
Gets the absolute path to the shared data directory of the application specified with an application ID. | |
int | app_manager_event_create (app_manager_event_h *handle) |
Creates a app manager event handle. | |
int | app_manager_event_set_status (app_manager_event_h handle, int status_type) |
Sets the event to handle to listen. You can combine multiple status using OR operation which you want to listen. | |
int | app_manager_set_event_cb (app_manager_event_h handle, app_manager_event_cb callback, void *user_data) |
Registers a callback function to be invoked when the app is event has occurred. | |
int | app_manager_unset_event_cb (app_manager_event_h handle) |
Unregisters the callback function. | |
int | app_manager_event_destroy (app_manager_event_h handle) |
Destroys the app manager event handle. | |
int | app_manager_set_app_icon (const char *app_id, const char *icon_path) |
Sets the application's icon path into given path. | |
Typedefs | |
typedef struct app_manager_event_s * | app_manager_event_h |
App manager event handle. | |
typedef void(* | app_manager_event_cb )(const char *type, const char *app_id, app_manager_event_type_e event_type, app_manager_event_state_e event_state, app_manager_event_h handle, void *user_data) |
Called when the application is enabled or disabled. | |
typedef void(* | app_manager_app_context_event_cb )(app_context_h app_context, app_context_event_e event, void *user_data) |
Called when an application is launched or terminated. | |
typedef bool(* | app_manager_app_context_cb )(app_context_h app_context, void *user_data) |
Called to get the application context once for each running application. | |
typedef bool(* | app_manager_app_info_cb )(app_info_h app_info, void *user_data) |
Called to get the application information once for each installed application. |
typedef bool(* app_manager_app_context_cb)(app_context_h app_context, void *user_data) |
Called to get the application context once for each running application.
[in] | app_context | The application context of each running 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 void(* app_manager_app_context_event_cb)(app_context_h app_context, app_context_event_e event, void *user_data) |
Called when an application is launched or terminated.
[in] | app_context | The application context of the application launched or terminated |
[in] | event | The application context event |
[in] | user_data | The user data passed from the foreach function |
typedef bool(* app_manager_app_info_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 void(* app_manager_event_cb)(const char *type, const char *app_id, app_manager_event_type_e event_type, app_manager_event_state_e event_state, app_manager_event_h handle, void *user_data) |
Called when the application is enabled or disabled.
[in] | type | The type of the app to be enabled or disabled |
[in] | app_id | The app id to be enabled or disabled |
[in] | event_type | The event type of the app |
[in] | event_state | The current event state of the app |
[in] | handle | The app manager event handle |
[in] | user_data | The user data passed from app_manager_set_event_cb() |
typedef struct app_manager_event_s* app_manager_event_h |
App manager event handle.
enum app_manager_error_e |
Enumerations for Application Manager Error.
int app_manager_event_create | ( | app_manager_event_h * | handle | ) |
Creates a app manager event handle.
[out] | handle | The app manager event handle that is newly created on success |
0
on success, otherwise a negative error valueAPP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_OUT_OF_MEMORY | Out of memory |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
int app_manager_event_destroy | ( | app_manager_event_h | handle | ) |
Destroys the app manager event handle.
[in] | handle | The app manager event handle |
0
on success, otherwise a negative error valueAPP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_REQUEST_FAILED | Internal error |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
int app_manager_event_set_status | ( | app_manager_event_h | handle, |
int | status_type | ||
) |
Sets the event to handle to listen. You can combine multiple status using OR operation which you want to listen.
[in] | handle | The app manager event handle |
[in] | status_type | The status of the application |
0
on success, otherwise a negative error valueAPP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
APP_MANAGER_ERROR_REQUEST_FAILED | Internal error |
int app_manager_foreach_app_context | ( | app_manager_app_context_cb | callback, |
void * | user_data | ||
) |
Retrieves all application contexts of running applications.
[in] | callback | The callback function to invoke |
[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 | Internal I/O error |
int app_manager_foreach_app_info | ( | app_manager_app_info_cb | callback, |
void * | user_data | ||
) |
Retrieves all installed applications information.
[in] | callback | The callback function to invoke |
[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 |
int app_manager_foreach_running_app_context | ( | app_manager_app_context_cb | callback, |
void * | user_data | ||
) |
Retrieves all application contexts of running applications including sub apps.
You can iterate all the running application contexts using this API. This API is similar to app_manager_foreach_app_context() except that this API iterates application contexts including sub apps in application groups.
[in] | callback | The callback function to invoke |
[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 | Internal I/O error |
int app_manager_get_app_context | ( | const char * | app_id, |
app_context_h * | app_context | ||
) |
Gets the application context for the given ID of the application.
[in] | app_id | The ID of the application |
[out] | app_context | The application context of the given application ID |
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 | No such application |
int app_manager_get_app_id | ( | pid_t | pid, |
char ** | app_id | ||
) |
Gets the ID of the application for the given process ID.
[in] | pid | The process ID of the application |
[out] | app_id | The ID 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_manager_get_app_info | ( | const char * | app_id, |
app_info_h * | app_info | ||
) |
Gets the application information for the given application ID.
[in] | app_id | The ID of the application |
[out] | app_info | The application information for the given application ID |
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 | No such application |
int app_manager_get_external_shared_data_path | ( | const char * | app_id, |
char ** | path | ||
) |
Gets the absolute path to the shared data directory of the application specified with an application ID.
An application can only read the files of other application's shared data directory.
[in] | app_id | The ID of the application |
[in,out] | path | The absolute path to the shared data directory of the application specified with the app_id |
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 | No such application |
APP_MANAGER_ERROR_OUT_OF_MEMORY | Out of memory |
int app_manager_get_shared_data_path | ( | const char * | app_id, |
char ** | path | ||
) |
Gets the absolute path to the shared data directory of the application specified with an application ID.
An application can only read the files of other application's shared data directory.
[in] | app_id | The ID of the application |
[in,out] | path | The absolute path to the shared data directory of the application specified with the app_id |
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 | No such application |
APP_MANAGER_ERROR_OUT_OF_MEMORY | Out of memory |
APP_MANAGER_ERROR_NOT_SUPPORTED | Not supported |
int app_manager_get_shared_resource_path | ( | const char * | app_id, |
char ** | path | ||
) |
Gets the absolute path to the shared resource directory of the application specified with an application ID.
An application can only read the files of other application's shared resource directory.
[in] | app_id | The ID of the application |
[in,out] | path | The absolute path to the shared resource directory of the application specified with the app_id |
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 | No such application |
APP_MANAGER_ERROR_OUT_OF_MEMORY | Out of memory |
int app_manager_get_shared_trusted_path | ( | const char * | app_id, |
char ** | path | ||
) |
Gets the absolute path to the shared trusted directory of the application specified with an application ID.
An application signed with the same certificate can read and write the files of other application's shared trusted directory.
[in] | app_id | The ID of the application |
[in,out] | path | The absolute path to the shared trusted directory of the application specified with the app_id |
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 | No such application |
APP_MANAGER_ERROR_OUT_OF_MEMORY | Out of memory |
int app_manager_is_running | ( | const char * | app_id, |
bool * | running | ||
) |
Checks whether the application with the given ID of the application is running.
[in] | app_id | The ID of the application |
[out] | running | true if the application is running, otherwise false if not running |
0
on success, otherwise a negative error value APP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
int app_manager_request_terminate_bg_app | ( | app_context_h | app_context | ) |
Terminates the back ground application.
UI applications that are in paused state or some service applications could be required to terminate by this API.
[in] | app_context | The 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_REQUEST_FAILED | Failed to send terminate request |
APP_MANAGER_ERROR_PERMISSION_DENIED | Permission denied |
int app_manager_resume_app | ( | app_context_h | app_context | ) |
Resumes the application.
[in] | app_context | The 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_APP_NO_RUNNING | App is not running |
APP_MANAGER_ERROR_REQUEST_FAILED | Internal resume error |
APP_MANAGER_ERROR_PERMISSION_DENIED | Permission denied |
int app_manager_set_app_context_event_cb | ( | app_manager_app_context_event_cb | callback, |
void * | user_data | ||
) |
Registers a callback function to be invoked when the applications get launched or terminated.
[in] | callback | The callback function to register |
[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_OUT_OF_MEMORY | Out of memory |
APP_MANAGER_ERROR_IO_ERROR | Internal I/O error |
int app_manager_set_app_icon | ( | const char * | app_id, |
const char * | icon_path | ||
) |
Sets the application's icon path into given path.
[in] | app_id | The ID of the application |
[in] | icon_path | The path of icon file |
0
on success, otherwise a negative error valueAPP_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 | Internal error |
APP_MANAGER_ERROR_PERMISSION_DENIED | Permission denied |
int app_manager_set_event_cb | ( | app_manager_event_h | handle, |
app_manager_event_cb | callback, | ||
void * | user_data | ||
) |
Registers a callback function to be invoked when the app is event has occurred.
[in] | handle | The app manager event handle |
[in] | callback | The callback function to be registered |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error valueAPP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
APP_MANAGER_ERROR_REQUEST_FAILED | Internal error |
void app_manager_unset_app_context_event_cb | ( | void | ) |
int app_manager_unset_event_cb | ( | app_manager_event_h | handle | ) |
Unregisters the callback function.
[in] | handle | The app manager event handle |
0
on success, otherwise a negative error valueAPP_MANAGER_ERROR_NONE | Successful |
APP_MANAGER_ERROR_INVALID_PARAMETER | Invalid parameter |
APP_MANAGER_ERROR_REQUEST_FAILED | Internal error |