I had to deal with this recently. I could never understand how to integrate our licensing agreement with the Google Play Store, so I decided to solve the problem of using EULA when I first used it. I had an additional limitation in that I had to re-show the license agreement with each application update.
This was a basic overview of my approach:
- Use SharedPreferences to save the current version of the EULA license that has been accepted.
- Compare the current version of the application at startup with the one in SharedPreferences
- If they do not match, display the DialogFragment user dialog with the web view so that I display EULA (since mine was an html file). I configured DialogFragment as modal. that is, have an Accept button and not deviate if they touch out.
- Update the current version of the application in the previously announced variants of SharedPreferences.
source share