语言

Menu
Sites
Language
Kindly help me to know if an app is already installed or not (given package id)

bool IsAppInstalled(char * appID){

----

--- 

return true/false 

}

 

I am quite new to c/c++ 

Assist me in completing above function where I just know the app package id (for example com.domain.test) and I want to know if any app with the package ID is already installed or not.

Also, tell what libraries need to include. Also, tell if some permission is required etc.

Thank you very much for kind consideration.

regards,

查看选择的答案

响应

2 回复
Mark as answer
Yasin Ali

Hi,

You may use package_manager_get_package_info(...)

package_info_h package_info = NULL;
package_manager_get_package_info("PACKAGE-ID", &package_info);
Returns:
0 on success, otherwise a negative error value
Add Privilege:
http://tizen.org/privilege/packagemanager.info

For more details see below links:
1. https://developer.tizen.org/ko/development/guides/web-application/application-management/package-information?langredirect=1
2. https://developer.tizen.org/dev-guide/2.4/org.tizen.tutorials/html/native/app_framework/package_tutorial_n.htm
3. https://developer.tizen.org/ko/development/api-references/native-application?redirect=/dev-guide/2.4/org.tizen.native.mobile.apireference/group__CAPI__PACKAGE__MANAGER__MODULE.html#ga054b2166d613b17480560e179b25d577

Hope it will help you.
If you find my post is helpful for you, please mark it as the Best Answer to promote this post to others.

Athar Nouman

int
ReturnInstalledApps(char * appID){

    package_info_h package_info = NULL;
    int result = package_manager_get_package_info(appID, &package_info);
    return result;

}

 

Above one is functional.

thank you,