I am developing an application in which the user should rate the app only once. Alert dialog should raise only once in the application. If the user is not interested in rating, then he should be reminded after a couple of days. After he gives rating to the app, then the dialog should not raise again in future. Is this possible friends?
3 Answers
Maybe you want to read the last part of the top answer here: How to know if a specific user has rated a Android App?.
Basically you don't want to put too much effort in this, because it can backfire.
If You want to ask the user if he would rate the app, for this You could set SharedPreferences. If he voted for it, set a boolean true value to sharedPrefs. Then You could start the dialog again only if this value is false. But the problem here is, first, if the user delete the app cache, the dialog will appear again. Second, to remind a user to vote could be annoying to the user and like SateliliteSD said, it could backfire and maybe he give a bad vote. For doing sharedPreferences, You could do somethingh like
private SharedPreferences mPrefs;
private Editor mEditor;
And to initialize:
mPrefs = PreferenceManager.getDefaultSharedPreferences(this) //this means the context
mEditor = mPrefs.edit();
to set the value:
boolean hasVoted = true //or false if he hasn´t done it
mEditor.putBoolean("YOUR_KEY", hasVoted);
mEditor.commit();
to read the values:
boolean hasVoted = mPrefs.getBoolean("YOUR_KEY",false) //false is default value if value could not reached

- 9,800
- 2
- 36
- 49
-
I have done with shared preferences.. Please refer to shared preferences – aditya Aug 23 '13 at 13:25
I have made available a library to do just this which requires only one line of code to include in your app.

- 4,745
- 6
- 45
- 61
-
I have done with shared preferences.. Please refer to shared preferences – aditya Aug 23 '13 at 13:25