Come on.onSavedIntanceState :
This saves additional screen information, such as variables that are not associated with View, for when recreating Activity, the data is populated!It saves (temporarily) the screen information when destroyed through the method https://developer.android.com/reference/android/app/Activity.html?hl=pt-br#onSaveInstanceState(android.os.Bundle) and makes available through the method https://developer.android.com/reference/android/app/Activity.html?hl=pt-br#onRestoreInstanceState(android.os.Bundle) .Transportation of this information is done through a https://developer.android.com/reference/android/os/Bundle.html?hl=pt-br . https://developer.android.com/training/basics/activity-lifecycle/recreating.html?hl=pt-br SharedPreferences: Usually used to save preferences!You can use https://developer.android.com/reference/android/content/SharedPreferences.html to save primitive data: booleans, floats, ints, longs and strings. This data will persist in user sessions (even if the application is deleted). https://developer.android.com/guide/topics/data/data-storage.html#pref Database: By default Android supports the http://www.sqlite.org/ , being used to store more robust and complex data. All created databases can be accessed by the name in any class of the application, but not out of it.The recommended method for creating a new SQLite database is to create a subclass of https://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper.html and modify the method https://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper.html#onCreate(android.database.sqlite.SQLiteDatabase) , where you can run an SQLite command to create tables in the database.You can run SQLite queries using methods of https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html#query(boolean,%20java.lang.String,%20java.lang.String[],%20java.lang.String,%20java.lang.String[],%20java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String) of https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html , which accept several query parameters, such as table to query, projection, selection, columns and grouping, among others. For complex queries, such as those requiring column aliases, use https://developer.android.com/reference/android/database/sqlite/SQLiteQueryBuilder.html , which provides several convenient methods for creating queries.Internal/External Storage: Through this it is possible to save/read files. Server: This is a service responsible for saving and providing the data. DURIDES: When should I use every guy?It depends on the situation and what your App proposes to do! Simple data, such as user preferences, can be stored in SharedPreferences. Registers, more complex information, such as Friends List, can be stored with SQLite. In these cases, this information remains on the user's Smartphone, in case of loss or theft, the information will be lost too! Then you can save this information on a Server (through a service) for when the user performs Login on a new device, this information is updated!Then it depends on what you will propose with your App!I can replace a SharedPreferences with an onSavedIntanceState or
Vice versa?You can instead of using Bundle this method, save the information in SharedPreferences and redeem when recreate the screen! But this (personally) smells like Gambiarra! The two have different purposes! O onSavedIntanceState is used to save the data on screen and then display (when the user changes from Portrait to landscape, for example!), in how much the SharedPreferences saves the information even after finishing the app.Databases do not work the same way as a server or
like internal storage?The database (in case SQlite) stores the information on the Smartphone. The server besides the database, has a service (an application) responsible for entering and providing the data!Why should I use these other two "the same function"?As I said, this will depend on whether you use it or not!If your App has data that doesn't often change, then searching every time the user enters the App would be a waste in the use of the internet. Instead of searching from the server every time, you can bring and store this information through the Internal Database (SQlite).Can I share these preferences with you?If I understand, you're talking about SharedPreferences, as said above, this is only available in your App, it's up to you to share or not!Does Web service fit into a server type?Yes! As said, Web Service is responsible for providing and storing information on the Server.