I want to install app from play store on button click event,and after user click button manage status of downloading. Suppose i want to download facebook from my app on a button click then, on a button click it should install on my device and i can get status of app is downloading/installing/pause/cancelled downloading.
Is this possible? Please provide your idea for this. Thanks in advance.
EDITED
i found below code to check download event broadcast -
<receiver android:name="com.test.MyReceiver" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
and i have broadcast receiver -
public class MyReceiver extends BroadcastReceiver{
@Override
public void onReceive(Context context, Intent intent) {
Bundle data = intent.getExtras();
String referrerString = data.getString("referrer");
Toast.makeText(context, "downloading....."+referrerString,Toast.LENGTH_SHORT).show();
}
}
but my broadcast receiver is never got called.
for downloading app on button click if using below link -
http://market.android.com/details?id=your.application.package.name&referrer=my_referrer_finally_works_fine