Check for Update

 private void checkForUpdate() {
    int latestAppVersion = (int) mFirebaseRemoteConfig.getDouble(VERSION_CODE_KEY);
    if (latestAppVersion > getCurrentVersionCode()) {
      new AlertDialog.Builder(this).setTitle("Please Update the App")
          .setMessage("A new version of this app is available. Please update it").setPositiveButton(
          "OK", new OnClickListener() {
            public void onClick(DialogInterface dialog, int which) {
                  .makeText(MainActivity.this, "Take user to Google Play Store", Toast.LENGTH_SHORT)
    } else {
      Toast.makeText(this,"This app is already upto date", Toast.LENGTH_SHORT).show();