-2

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
Ravi Bhandari
  • 4,682
  • 8
  • 40
  • 68

2 Answers2

0

This is not possible. Not sure what else to say.

r2DoesInc
  • 3,759
  • 3
  • 29
  • 60
0

You can't download an app from the play store.

You can show the user the play store app with the correct app page, so they can download, see How to open the Google Play Store directly from my Android application?

Community
  • 1
  • 1
deive
  • 862
  • 7
  • 19
  • Thanks for you reply,can i get downloading status of app.if user click install button then when it install completely can i get a alert or notification. – Ravi Bhandari Dec 19 '14 at 08:15
  • I haven't used it myself, but https://developer.android.com/reference/com/google/android/gms/tagmanager/InstallReferrerReceiver.html is what you are looking for. – deive Dec 19 '14 at 10:21
  • i have try this receiver but my broadcast receiver not called. – Ravi Bhandari Dec 19 '14 at 12:35