开发者

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

开发者 https://www.devze.com 2023-01-05 13:12 出处:网络
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.

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

精彩评论

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