How do you create a stub application that only dir

2020-07-20 05:41发布

问题:

Just looking to create a stub application that does nothing but direct the user to download the full version on Google Play once the application is launched.

I'm assuming the stub apk will obviously need the same package name, signed with the same certificate but have a lower version code. All while only pointing to the Google Play product page. Is that all that's needed?

Can you have the apk update upon launch from Google Play without directing the user to initiate clicking the update button?

Thanks!

回答1:

Try this one:

final String appName = "com.example";
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id="+appName)));

Remember that user can have no GooglePlay Installed, in that case you want to catch ActivityNotFoundException (or something like that), and give link to browser.

Your app stub has to have same package name, and must be signed with same certificate as one in GooglePlay.