Skip to content

Instantly share code, notes, and snippets.

@aliab
Created March 13, 2015 11:33
Show Gist options
  • Save aliab/ff540fc1080c87fe6f9c to your computer and use it in GitHub Desktop.
Save aliab/ff540fc1080c87fe6f9c to your computer and use it in GitHub Desktop.
simple android trial checking!
private void trial() {
Calendar expirationDate = Calendar.getInstance();
expirationDate.set(2015, 3, 15); // hardcoded expiration date
Calendar t = Calendar.getInstance(); // Calendar with current time/date
if (t.compareTo(expirationDate) == 1) {
finish();
Toast.makeText(getApplicationContext(),"Your Trial have been EXPIRED!", Toast.LENGTH_SHORT).show();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment