So I have to create a simple highscore system, that will save the highscore somewhere in the system memory so that it won't reset every time I open the application.
For this, I guess the correct answer is to use the "Room" database. I've watched a lot of tutorials but I still didn't understand anything.
Here is what I want to do:
//my ints:
public class MainActivity extends AppCompatActivity {
int score = 0;
int highscore;
//and so on...
}
//load on app launch:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//load from database
//save new highscore
private void save_highscore () {
if (highscore > score) {
//save to database module
}
}