How to detect if Google Play is installed? (Not Market)

前端 未结 5 1238
[愿得一人]
[愿得一人] 2021-01-02 20:43

Whether the app installed is called Google Play or Market, the package name is the same com.android.vending.

I need to be able to detect whether the app

5条回答
  •  感动是毒
    2021-01-02 20:48

    You can also try this much simplified solution:

    public boolean isGooglePlayAvailable() {
            boolean googlePlayStoreInstalled;
            int val= GooglePlayServicesUtil.isGooglePlayServicesAvailable(LocationActivity.this);
            googlePlayStoreInstalled = val == ConnectionResult.SUCCESS;
            return googlePlayStoreInstalled;
        }
    

提交回复
热议问题