Reputation:
I want to to list some play store app links in my app. and i want that user click on the link and go to the play store and download the app. Now i want to track that if user clicked on the link and has he downloaded or not the app or not cancelled the download. so how can i implement this kind if feature in android studio.
Upvotes: 0
Views: 302
Reputation: 390
using package manager you can check whether app installed or not
if(appInstalledOrNot(com.demo.package)){
Toast.makeText(this,"App Installed",Toast.LENGTH_LONG).show();
} else {
Toast.makeText(this,"App NOt Installed",Toast.LENGTH_LONG).show();
}
private boolean appInstalledOrNot(String packageName) {
PackageManager pm = this.getPackageManager();
try {
pm.getPackageInfo(packageName, PackageManager.GET_ACTIVITIES);
return true;
} catch (Exception e) {
Log.e("::MG::",""+e);
return false;
}
}
Upvotes: 1