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.

inside custom component

Java Development

Reply
Developer
Posts: 132
Registered: ‎10-25-2011
My Device: Tour 9630
My Carrier: MTN

blackberry application library question

Hello and good day everybody ,
I have a blackberry application that consist of an application library project(with auto run on start up setup), in the libMain method of the library I have a timer task that fetches data from the server every 10 mins and stores in the embedded database , so when the app is launched I don't need to fetch data from the server all I need to do is read from the db , it works perfectly fine on the simulator but on the device it doesn't is there any thing wrong that I might be missing , or is it that the timertask does not run when the device sleeps , pls any idea will be appreciated , thanks in advance .
Developer
Posts: 16,682
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: blackberry application library question

not sure how it behaves from a background application, but basically timertasks should complete quickly. do you use a separate thread to do the heavy lifting?

do you have any exceptions? anything in the logs? (alt+lglg)
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 132
Registered: ‎10-25-2011
My Device: Tour 9630
My Carrier: MTN

Re: blackberry application library question

No I am doing the fetch on the timer task run() method and I have not yet implemented logging , but it works perfectly fine on the simulator .
Developer
Posts: 16,682
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: blackberry application library question

the simulator may be more forgiving.
i would at least try to move it to a separate thread.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 132
Registered: ‎10-25-2011
My Device: Tour 9630
My Carrier: MTN

Re: blackberry application library question

Ok do u mean a thread inside the timertask run ? Or another thread totally that runs at intervals ? , in that case the app resource monitor might complain and try to shut it down , just a thought .
Developer
Posts: 16,682
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: blackberry application library question

just spawn a thread in the timertask.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter