Apps-android-commons: Should tutorial be displayed with each reinstallation of the app, or only once?

Created on 14 Apr 2017  路  4Comments  路  Source: commons-app/apps-android-commons

Almost didn't catch this one... but WelcomeActivity bypasses the tutorial completely in the pre-release master branch (API 24, Galaxy S7), it brings you straight to the login screen. I don't think the folks at WMF and Commons are going to be too happy with that, even if it is more convenient from a UX point of view.

Oddly, even reverting https://github.com/misaochan/apps-android-commons/commit/0713ed9e12c3e535a887337164da7b5dc60541b2 does not solve the issue, but I don't see any other commits that could have caused it based on the "Blame" view of the repo. This change has definitely only been introduced recently, as I tried downloading directly from Google Play and it works with that.

@maskaravivek @veyndan any thoughts?

question

Most helpful comment

If you log the result of prefs.getBoolean("firstrun", true)) after uninstalling the application, you will notice that the value is actually false where in fact you'd expect it to be true. This is because as of Marshmallow, a backup of the SharedPreferences occurs unless android:allowBackup is explicitly set to false in the AndroidManifest.xml as the default is true (docs).

If you clear all the data associated with the package name, it should be as if there is no back up, i.e. run adb shell pm clear fr.free.nrw.commons in the terminal. Now you should see the WelcomeActivity on start up.

I wouldn't consider this a bug and I would say that such a result is desired as you probably don't want the onboarding process again after uninstalling and then installing and you probably want to keep other preferences e.g. the theme preferences. However such a discussion would be a separate issue if it warrants a discussion.

All 4 comments

If you log the result of prefs.getBoolean("firstrun", true)) after uninstalling the application, you will notice that the value is actually false where in fact you'd expect it to be true. This is because as of Marshmallow, a backup of the SharedPreferences occurs unless android:allowBackup is explicitly set to false in the AndroidManifest.xml as the default is true (docs).

If you clear all the data associated with the package name, it should be as if there is no back up, i.e. run adb shell pm clear fr.free.nrw.commons in the terminal. Now you should see the WelcomeActivity on start up.

I wouldn't consider this a bug and I would say that such a result is desired as you probably don't want the onboarding process again after uninstalling and then installing and you probably want to keep other preferences e.g. the theme preferences. However such a discussion would be a separate issue if it warrants a discussion.

After doing a bit more digging into this, apparently we can explicitly say which SharedPreferences we want to backup using android:fullBackupContent in <application>. The docs for this can be found here. Via the docs, it is recommended that android:allowBackup is set to true or false explicitly to avoid confusion.

Thanks @veyndan ! I think we definitely want to allow backup for theme preferences etc for convenience. I'm not sure whether we want the tutorial to be re-displayed after each fresh install/update or not... I suppose if they have already read it once then it shouldn't matter too much, but if the tutorial is updated or they come back again after a long hiatus, it might be a good idea to have a refresher?

Regardless, since this is not a byproduct of the recent changes, I'll push this release first, and then we can discuss this at our leisure. :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

neslihanturan picture neslihanturan  路  3Comments

nicolas-raoul picture nicolas-raoul  路  4Comments

jidanni picture jidanni  路  3Comments

maskaravivek picture maskaravivek  路  3Comments

Opsylac picture Opsylac  路  3Comments