Java tutorial
//package com.java2s; import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; public class Main { public static int checkGooglePlusApp(Context paramContext) { return b(paramContext, 330000000); } private static int b(Context paramContext, int paramInt) { PackageManager localPackageManager = paramContext.getPackageManager(); int i; try { PackageInfo localPackageInfo = localPackageManager.getPackageInfo("com.google.android.apps.plus", 0); ApplicationInfo localApplicationInfo = localPackageManager .getApplicationInfo("com.google.android.apps.plus", 0); if (localPackageInfo.versionCode < paramInt) return 2; boolean bool = localApplicationInfo.enabled; i = 0; if (!bool) return 3; } catch (PackageManager.NameNotFoundException localNameNotFoundException) { i = 1; } return i; } }