Everything is very simple.
In theory:
You get the programmatically current version of the application code, save it to SharedPrefereneces , and make a condition that if the saved version matches the current version, nothing happens. That is, the user first downloaded the application, the code version of which is 1, or even 32, and this number is saved. And as soon as the saved code number becomes less than the current one, it will mean that the application has been updated, then the condition of opening a dialog box, for example, with a list of changes, is satisfied.
On practice:
// Реализовываем SharedPreferences SharedPreferences mPreferences = PreferenceManager.getDefaultSharedPreferences(this); @SuppressLint("CommitPrefEdits") SharedPreferences.Editor mEditor = mPreferences.edit(); // Получаем текущую версию кода int versionCode = BuildConfig.VERSION_CODE; // Получаем сохраненную версию кода int lastVersionCode = mPreferences.getInt("update_true", versionCode); // Если lastVersionCode меньше чем текущий versionCode выполняется условие if (lastVersionCode < versionCode) { // Вызываем диалоговое окно со списком измненений } // Сохраняем текущую версию кода mEditor.putInt("update_true", versionCode).apply();