December 2017
Intermediate to advanced
260 pages
7h 34m
English
Shared Preferences in Android is very much crucial. It's a great persistent storage type. It's very easy to use, but not simple. We all know the pain we have to take while initializing them, but also while saving data into it we need to take care of the editor's object, and above all, we cannot forget about the apply method to use. This is popularly known as ceremonies of API. We have to call multiple methods every time to get any task done.
Now, while opening the app we want to check whether the user has connected to any of the accounts. We can read the value from the SharedPreferences with the following mentioned single line code:
private var isConnectedToAnySocialMedia: Boolean by PreferenceExtension( ...
Read now
Unlock full access