2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3 * PROPRIETARY/CONFIDENTIAL
4 * This software is the confidential and proprietary information of
5 * SAMSUNG ELECTRONICS ("Confidential Information"). You agree and acknowledge that
6 * this software is owned by Samsung and you
7 * shall not disclose such Confidential Information and shall
8 * use it only in accordance with the terms of the license agreement
9 * you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no
10 * representations or warranties about the suitability
11 * of the software, either express or implied, including but not
12 * limited to the implied warranties of merchantability, fitness for
13 * a particular purpose, or non-infringement.
14 * SAMSUNG shall not be liable for any damages suffered by licensee arising out of or
15 * related to this software.
23 #include <sys/types.h>
26 #include <app_manager.h>
28 static void _print_help(const char *cmd)
30 fprintf(stderr, "Usage:\n");
31 fprintf(stderr, "\n");
32 fprintf(stderr, "[Get appinfo value]\n");
33 fprintf(stderr, " %s <app_id>\n", cmd);
34 fprintf(stderr, "\n");
35 fprintf(stderr, "Ex) %s com.samsung.memo\n", cmd);
36 fprintf(stderr, "\n");
39 static int _get_appinfo(const char *app_id)
49 ret = app_manager_get_app_info(app_id, &app_info);
50 if (ret != APP_MANAGER_ERROR_NONE) {
51 fprintf(stderr, "No corresponding app_id for [%s]\n", app_id);
55 ret = app_info_get_app_id(app_info, &appid);
56 if (ret != APP_MANAGER_ERROR_NONE) {
57 fprintf(stderr, "Failed to get app_id. error(%d)\n", ret);
61 ret = app_info_get_label(app_info, &label);
62 if (ret != APP_MANAGER_ERROR_NONE) {
63 fprintf(stderr, "Failed to get label. error(%d)\n", ret);
67 ret = app_info_get_icon(app_info, &icon);
68 if (ret != APP_MANAGER_ERROR_NONE) {
69 fprintf(stderr, "Failed to get icon. error(%d)\n", ret);
73 ret = app_info_get_package(app_info, &package);
74 if (ret != APP_MANAGER_ERROR_NONE) {
75 fprintf(stderr, "Failed to get package. error(%d)\n", ret);
79 ret = app_info_get_type(app_info, &type);
80 if (ret != APP_MANAGER_ERROR_NONE) {
81 fprintf(stderr, "Failed to get type. error(%d)\n", ret);
85 fprintf(stderr, "appid = [%s]\n", appid);
86 fprintf(stderr, "label = [%s]\n", label);
87 fprintf(stderr, "icon = [%s]\n", icon);
88 fprintf(stderr, "package = [%s]\n", package);
89 fprintf(stderr, "type = [%s]\n", type);
98 app_info_destroy(app_info);
103 int main(int argc, char **argv)
105 int ret = APP_MANAGER_ERROR_NONE;
108 ret = _get_appinfo(argv[1]);
110 _print_help(argv[0]);
114 if (ret != APP_MANAGER_ERROR_NONE)
115 fprintf(stderr, "There are some problems\n");