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>
30 static void _print_help(const char *cmd)
32 fprintf(stderr, "Usage:\n");
33 fprintf(stderr, "\n");
34 fprintf(stderr, "[Get appinfo value]\n");
35 fprintf(stderr, " %s <app_id>\n", cmd);
36 fprintf(stderr, "\n");
37 fprintf(stderr, "Ex) %s com.samsung.memo\n", cmd);
38 fprintf(stderr, "\n");
43 static int _get_appinfo(const char *app_id)
53 ret = app_manager_get_app_info(app_id, &app_info);
54 if (ret != APP_MANAGER_ERROR_NONE) {
55 fprintf(stderr, "No corresponding app_id for [%s]\n", app_id);
56 return APP_MANAGER_ERROR_NO_SUCH_APP;
59 app_info_get_app_id(app_info, &appid);
60 app_info_get_label(app_info, &label);
61 app_info_get_icon(app_info, &icon);
62 app_info_get_package(app_info, &package);
63 app_info_get_type(app_info, &type);
65 fprintf(stderr, "appid = [%s]\n", appid);
66 fprintf(stderr, "label = [%s]\n", label);
67 fprintf(stderr, "icon = [%s]\n", icon);
68 fprintf(stderr, "package = [%s]\n", package);
69 fprintf(stderr, "type = [%s]\n", type);
71 ret = app_info_destroy(app_info);
72 if (ret != APP_MANAGER_ERROR_NONE) {
73 return APP_MANAGER_ERROR_IO_ERROR;
82 return APP_MANAGER_ERROR_NONE;
85 int main(int argc, char** argv)
87 int ret = APP_MANAGER_ERROR_NONE;
90 ret = _get_appinfo(argv[1]);
97 if (ret != APP_MANAGER_ERROR_NONE) {
98 fprintf(stderr, "There are some problems\n");