开发者

What's the easiest way to set a date limit until an application can be used?

I would like to releas开发者_Go百科e a beta version of my app, but I would like to set and end date hardcoded in the code.

How can I do that easily? Is there an entry point that is fired before any of the activities?


The "entry point" of an Android app, before all activities is Application.onCreate(). I would go for what Sebi commented - check the date in launcher Activity's onCreate().


You can test the system date like Sebi said, and see if the user allows Network date/time update. This way, the date is correct and you can see if your period expired :

http://developer.android.com/reference/android/provider/Settings.System.html#AUTO_TIME

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜