开发者

Android application serial number and how to store it?

Scenario:

I intend to make a donate version of my ad supported application, via paypal library. The process should be simple but effective: if the user makes the transaction, and the result is Ok, I will generate a serial number for the application and activate it.

Questions

  • the serial number needs to be generated based on something unique on the device. What shoul开发者_如何转开发d this be, the IMEI number ? Or maybe I should consider the current google account logged on the phone? In this way if the user changes the phone, he can still use the application.

  • I need to store this serial number in my application. What would be the easiest way to do this ? I wouldn't like to make a sqlite database only for this purpose, as I don't need it for something else. On each activity start I will check if the serial number is correct.

Any response is gladly taken. Thank you for your time.


  1. You can use android unique id. See here.

  2. The storing is really simple. Just use shared preferences.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜