PackageManager pm = context.getPackageManager();
boolean isInstalled = isPackageInstalled("de.stefanpledl.localcast", pm);
if(isInstalled){
openLocalcastPlayer(...);
}else{
try {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=de.stefanpledl.localcast")));
} catch (android.content.ActivityNotFoundException ignored) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=de.stefanpledl.localcast")));
}
}