You could also use RateMeMaybe: https://github.com/Kopfgeldjaeger/RateMeMaybe
It gives you quite some options to configure (minimum of days/launches until first prompt, minimum of days/launches until each next prompt if user chooses "not now", dialog title, message etc.). It is also easy to use.
Example usage from README:
RateMeMaybe rmm = new RateMeMaybe(this);
rmm.setPromptMinimums(10, 14, 10, 30);
rmm.setDialogMessage("You really seem to like this app, "
+"since you have already used it %totalLaunchCount% times! "
+"It would be great if you took a moment to rate it.");
rmm.setDialogTitle("Rate this app");
rmm.setPositiveBtn("Yeeha!");
rmm.run();
Edit: If you want to only show the prompt manually, you can also just use the RateMeMaybeFragment
if (mActivity.getSupportFragmentManager().findFragmentByTag(
"rmmFragment") != null) {
// the dialog is already shown to the user
return;
}
RateMeMaybeFragment frag = new RateMeMaybeFragment();
frag.setData(getIcon(), getDialogTitle(), getDialogMessage(),
getPositiveBtn(), getNeutralBtn(), getNegativeBtn(), this);
frag.show(mActivity.getSupportFragmentManager(), "rmmFragment");
getIcon() can be replaced with 0 if you don't want to use one; the rest of the getX calls can be replaced with Strings
Changing the code to open the Amazon Marketplace should be easy