@@ -0,0 +1,1283 @@
+%0Apackage com.battlelancer.seriesguide.settings;%0A%0Aimport android.content.Context;%0Aimport android.content.SharedPreferences;%0Aimport android.content.pm.PackageManager;%0Aimport android.content.pm.PackageManager.NameNotFoundException;%0Aimport android.preference.PreferenceManager;%0A%0Apublic class AppSettings %7B%0A%0A    public static final String KEY_VERSION = %22oldversioncode%22;%0A%0A    /**%0A     * Retruns the version code of the previously installed version. Is the%0A     * current version on fresh installs.%0A     */%0A    public static int getLastVersionCode(Context context) %7B%0A        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);%0A%0A        int lastVersionCode = prefs.getInt(KEY_VERSION, -1);%0A        if (lastVersionCode == -1) %7B%0A            try %7B%0A                // set current version as default value%0A                lastVersionCode = context.getPackageManager().getPackageInfo(%0A                        context.getPackageName(),%0A                        PackageManager.GET_META_DATA).versionCode;%0A                prefs.edit().putInt(KEY_VERSION, lastVersionCode).commit();%0A            %7D catch (NameNotFoundException e) %7B%0A                // should not happen, it's this package we are looking for%0A            %7D%0A        %7D%0A%0A        return lastVersionCode;%0A    %7D%0A%7D%0A

Add AppSettings, returns last version code before update.