Pentium10
Pentium10

Reputation: 208042

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

I would like to release 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?

Upvotes: 4

Views: 287

Answers (2)

3rgo
3rgo

Reputation: 3153

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

Upvotes: 1

ognian
ognian

Reputation: 11541

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().

Upvotes: 5

Related Questions