When you first start, the application creates certain SharedPreferences. Along with this, the user is given a bonus. If you delete the application data in the settings of the device itself - the application will assume that it has just been installed, and will give out bonuses as for the first visit. How can you protect yourself from this? Is there any way to prevent the user from deleting them? And another question - is it possible to somehow “find out” if the application was installed earlier, so that when installing / uninstalling \ installing - would the application understand that the user had already installed it and would not receive the bonus? )

  • And how do you want to delete these applications? - Micah
  • In the application manager - the button "delete application data" or something like that - 007

2 answers 2

Can do something like free in app purchase? And on Google Play, check whether it was bought at least sometime. I would dig this way.

  • And how would this interact? Those. What classes are used, what is transmitted / received? - 007
  • Here is the link to the documentation: developer.android.com/google/play/billing/index.html I recommend that you pay attention to the option with Subscriptions. If I'm not mistaken, then this purchase is tied to the user account. At the first launch, make a check whether this subscription has already been issued. If not, make this purchase and write to SharedPreferences. Next time, if the client has deleted the application data, then check again, but the subscription will already be completed. - Lucky_spirit
  • In the database of the market there is a complete history of what the user did, what he bought and so on. In this case, you can come up with a certain product (the so-called consumable ), which will be purchased by the user when the application is launched for $ 0 and consumed further by starting from this. Dig in more here - you need in-app billing v. > = 2 - Barmaley
  • @ Yevgeny Vasilenko subscription does not channel ... We need a regular product, but which is managed - Barmaley
  • I understand correctly that the application will already be paid and is in paid categories? - 007

Register the user on your web service. On any launch, the application checks if the user is logged in, if not, then it crashes and gives a bonus. There are no other ways to get around what you say no.

  • And how quickly can you raise from scratch? Are there any free services? For registration, it will be enough to not register the user "officially", can you just request his device? - 007