Skip to content

Instantly share code, notes, and snippets.

@harshabhadra
Created October 13, 2019 14:30
Show Gist options
  • Save harshabhadra/7eeca1533f13421ed5095a7993034961 to your computer and use it in GitHub Desktop.
Save harshabhadra/7eeca1533f13421ed5095a7993034961 to your computer and use it in GitHub Desktop.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mWelcomeTextView = findViewById(R.id.textView);
versionNameTextView = findViewById(R.id.version_name);
// Get Remote Config instance.
mFirebaseRemoteConfig = FirebaseRemoteConfig.getInstance();
//Create A remote config setting
FirebaseRemoteConfigSettings configSettings = new FirebaseRemoteConfigSettings.Builder()
.setMinimumFetchIntervalInSeconds(60)
.build();
mFirebaseRemoteConfig.setConfigSettingsAsync(configSettings);
// Set default Remote Config parameter values. An app uses the in-app default values, and
// when you need to adjust those defaults, you set an updated value for only the values you
// want to change in the Firebase console.
mFirebaseRemoteConfig.setDefaultsAsync(R.xml.config_defaults);
version = getVersionName(this);
versionNameTextView.setText(version);
//Fetch Information from firebase
fetchWelcome();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment