Get Your 100% Free IQ Test Android App
How to locally store data in Android App?

How to locally store data in Android App?

Android Studio Tutorial

Here's a simple way to locally store data in Android App:

SharedPreferences sharedPreferences = this.getSharedPreferences("com.example.appname", Context.MODE_PRIVATE);
sharedPreferences.edit().putString("key1", "value1").apply();
sharedPreferences.edit().putString("key2", "value2").apply();

Context.MODE_PRIVATE means that only this app can access data. 

And to retrieve data we just saved, use the following code:

String keyOne = sharedPreferences.getString("key1", ""); //key name, default value
String keyTwo = sharedPreferences.getString("key2", ""); //key name, default value

 with getString() method you're also required to assign a default value in case it isn't set.