I want to implement gcm into my app and show the user once a dialog on startup with the question if he wants to receive notifications.
The procedure I am thinking to do:
AlertDialog question -> yes or no
Store answer in SharedPreferences
if(true) { register procedure etc }
rest of code
Is this the way to do it?
You should add a preference item to allow users to change their mind whenever they want. Moreover showing a dialog at startup will get your app startup bloated and boring. It should start and be usable ASAP.