Closed DanielPollithy closed 6 years ago
@DanielPollithy Yeah, that makes sense. I can put an output message that the balance may not be up to date.
@tobywoerthle Thanks! The thing is that I want to check the balance of the user before starting a hotspot...
@DanielPollithy Use below function to retrieve shared pref for balance + balance update date time
ex.
String balance = getSharedPrefKey("balance");
String balanceUpdateDateTime = getSharedPrefKey("balanceDateUpdate");
private String getSharedPrefKey(String key) {
SharedPreferences sharedPref = context.getSharedPreferences(prefFile, Context.MODE_PRIVATE);
String defaultValue = "0";
String storedBalance = sharedPref.getString(key,defaultValue);
return storedBalance;
}
I'll update this as soon as the app starts.
The balance will be updated when app starts and gets past seed login screen: 3e96e2fba6850cfc7c2fa65ef47c88fb80a0faef
If a device is not connected to the internet we can't show the current account balance. I guess we should store this (together with the last index) in the EncryptedSharedPreferences
What do you think, Toby?