This article describes how Android simply determines whether an APK has been installed. Share it for your reference, as follows:
privateboolean isAppInstalled(String uri){ PackageManager pm = getPackageManager(); boolean installed =false; try{ (uri,PackageManager.GET_ACTIVITIES); installed =true; }catch( e){ installed =false; } return installed; }
Just use this method to check the application package name you need to judge:
if(isAppInstalled("")){ //app installed } else{ //app not installed }
For more information about Android related content, please check out the topic of this site:Android View View Tips Summary》、《Android programming activity operation skills summary》、《Summary of Android's SQLite database skills》、《Summary of Android operating json format data skills》、《Android database operation skills summary》、《Android file operation skills summary》、《A summary of SD card operation methods for Android programming and development》、《Android development introduction and advanced tutorial》、《Android resource operation skills summary"and"Android control usage summary》
I hope this article will be helpful to everyone's Android programming design.