PackageManager packageManager = getPackageManager();
List<ApplicationInfo> list = packageManager.getInstalledApplications(PackageManager.GET_META_DATA)
Returns a list of installed applications. You can also get the uninstalled applications list by using GET_UNINSTALLED_PACKAGES
flag.
You can create a class that has a method which checks if the given application is installed. Then you can register that class to the webView using addJavascriptInterface
method. And in the page you loaded in to the webview, you can call that method to check if the given application is available in the phone. Check this answer for further info about addJavascriptInterface
https://stackoverflow.com/a/9982135/3133545