-1

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?

aditya
  • 9
  • 2
  • 1
    If you want anything more than "Yes" for an answer, you're going to have to ask something more specific here, including showing what you've tried and where *exactly* you're stuck. – lc. Jul 30 '13 at 07:34

3 Answers3

1

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.

Community
  • 1
  • 1
sschrass
  • 7,014
  • 6
  • 43
  • 62
0

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
Opiatefuchs
  • 9,800
  • 2
  • 36
  • 49
0

I have made available a library to do just this which requires only one line of code to include in your app.

https://github.com/codechimp-org/AppRater

CodeChimp
  • 4,745
  • 6
  • 45
  • 61