Posts

Check if an app is installed, and get it's version in Sketchware

We can check if an app is installed or not by using it's package name in simple codes in Sketchware. Check if an app is installed or not We can get information about any installed app from it's package name, by using PackageManager and PackageInfo methods. PackageInfo provides Overall information about the contents of a package. This corresponds to all the information collected from AndroidManifest.xml. In onCreate event in LOGIC of your app, use an add source directly block and add following code: boolean isAppInstalled = appInstalledOrNot(" com.besome.sketch "); if(isAppInstalled) { showMessage(" Sketchware app is installed "); } else { showMessage(" Sketchware is not installed ");} } private boolean appInstalledOrNot(String uri) { android.content.pm.PackageManager pm = getPackageManager(); try { pm.getPackageInfo(uri, android.content.pm.PackageManager.GET_ACT