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
精彩评论