Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Contributor
ayuens
Posts: 28
Registered: ‎06-15-2010
My Carrier: Smartone Vodafone

thread checking expiry date

hi all,

i've write a class which implement the phonelistener, but i would like to make a expiry date for my class. is it possible to write a thread which runs in the background and automatically check whether my application expired everyday without get in the apps?

thanks!

 

Please use plain text.
Developer
peter_strange
Posts: 17,701
Registered: ‎07-14-2008

Re: thread checking expiry date

Every running Thread has an owning Application.  If the owning Application extends Application, and not UiApplication, and is also marked as a System Module, the user will have no easy way to find any indication that it is present. 

 

Alternatively, you could check when the user actually uses the Application.  You can initiate your Background processing to check at that time (assuming you have not already checked for that day). 

Please use plain text.
Contributor
ayuens
Posts: 28
Registered: ‎06-15-2010
My Carrier: Smartone Vodafone

Re: thread checking expiry date

Thanks for your advice.

i've try to use Date to compare the expiry date

when the user first run, i set the date to installDate

installDate = new Date()

i'd like to compare the time everytime when the user end the call,

so i have to get the date and time when user end a call.

 

but the problem is that:

how can I compare the time? after I get the long of the date object, but I don't know what will be the format look like...thanks.

Please use plain text.
Developer
peter_strange
Posts: 17,701
Registered: ‎07-14-2008

Re: thread checking expiry date

Sorry I don't understand the question.

 

"what will be the format look like"

 

The API says:

"Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object."

 

If you wish to format this, you might like to look at SimpleDateFormat, Calendar and DateTimeUtilities.

 

 

Please use plain text.
Contributor
ayuens
Posts: 28
Registered: ‎06-15-2010
My Carrier: Smartone Vodafone

Re: thread checking expiry date

in fact, i've used the long, but it seems meaningless to me and hard to count the date.

and i've used calendar and dataformat, it works! THANKS!!

Please use plain text.
Developer
peter_strange
Posts: 17,701
Registered: ‎07-14-2008

Re: thread checking expiry date

Glad you have this working.

 

Can you mark this as solved?

Please use plain text.