webOS Nation Forums >  Homebrew >  webOS homebrew apps > Timer On A Stick, a countdown timer. [v0.1.0][NRR]
Timer On A Stick, a countdown timer. [v0.1.0][NRR]

  Reply
 
LinkBack Thread Tools Display Modes
Old 07/09/2009, 12:57 AM   #41 (permalink)
Member
 
frankos72's Avatar
 
Join Date: May 2009
Location: Oklahoma
Posts: 530
Likes Received: 13
Thanks: 68
Thanked 102 Times in 56 Posts
Default

I was poking around over at wiki dev and I found the following code:

Code:
[KeepAlive]
Applications=com.palm.app.phone

[KeepAliveUntilMemPressure]
Applications=com.palm.app.browser
I realize it might require a hack, but I bet if you put your app in there it might keep it from stopping occasionally.

That stuff is on this page:
pre dev wiki: Tidbits
__________________
frankos72
Simple Bible - Simple Bible Pro - Bits of God Website
My Day Job: www.pigstands.com
frankos72 is offline   Reply With Quote
Old 07/09/2009, 09:03 AM   #42 (permalink)
Member
 
Join Date: Jun 2009
Posts: 259
Likes Received: 0
Thanks: 3
Thanked 88 Times in 13 Posts
Default

sorry to hijack this thread, but i wanted to let people know about

http://forums.precentral.net/web-os-...timer-app.html

i am in no way affliated with timer on a stick

i dont seem to have a problem with the timer or stopwatch stopping when the card is switched away or the screen turned off. as a matter of fact, i have the timer running in a minimized card and it's still going. so for anyone that thinks webos isn't multitasking, it really is. FYI, the reason other apps stop working (i.e. youtube) when minimized is because it's coded to behave that way to save on power. its a palm suggested best practice to reduce processing when not in context. i haven't done it with my app yet, and it may depend on user feedback. i actually like see the app update even when minimized.

i just quickly glanced at your source code, and one suggestion. try something like this:

this.interval = this.controller.window.setInterval(
function(){
DO WHATEVER YOU DO TO UPDATE YOUR DISPLAY
}.bind(this), 1000);

see if that gets your timer to keep working

Last edited by sambao21; 07/09/2009 at 09:13 AM.
sambao21 is offline   Reply With Quote
Old 07/13/2009, 07:02 PM   #43 (permalink)
Member
 
Join Date: Apr 2009
Posts: 96
Likes Received: 7
Thanks: 11
Thanked 18 Times in 13 Posts
Default

nice app
phillipah is offline   Reply With Quote
Old 07/16/2009, 06:39 PM   #44 (permalink)
Member
 
Join Date: Jun 2009
Posts: 211
Likes Received: 0
Thanks: 28
Thanked 147 Times in 41 Posts
Default

Quote:
Originally Posted by sambao21 View Post
this.interval = this.controller.window.setInterval(
function(){
DO WHATEVER YOU DO TO UPDATE YOUR DISPLAY
}.bind(this), 1000);

see if that gets your timer to keep working
This minor alteration to my existing window.setInterval call doesn't solve my problem, but thanks.

Now that the SDK is out, I can install apps on my Pre again without wanting to rip my eyes out, and I'm gonna cook with gas!
dsevil is offline   Reply With Quote
Old 07/16/2009, 07:13 PM   #45 (permalink)
Member
 
Join Date: Jun 2009
Posts: 211
Likes Received: 0
Thanks: 28
Thanked 147 Times in 41 Posts
Default

Quote:
Originally Posted by sambao21 View Post
i dont seem to have a problem with the timer or stopwatch stopping when the card is switched away or the screen turned off.
You're relying on JavaScript "new Date()" calls; I'm decrementing a counter each time the function passed to setInterval is called. That's why your app works.

My only issue is that in the admittedly rare circumstance that the phone resyncs its time after having been out of sync for quite a while, the results will be a few seconds off (or how out of sync the clock got).

I think I actually *like* your app better than mine.
dsevil is offline   Reply With Quote
Old 07/17/2009, 01:55 AM   #46 (permalink)
Member
 
Join Date: Mar 2008
Posts: 17
Likes Received: 0
Thanks: 2
Thanked 3 Times in 2 Posts
Default

Possible to add a day column?
coojoe1000 is offline   Reply With Quote
Old 07/17/2009, 10:41 PM   #47 (permalink)
Member
 
Join Date: Aug 2007
Posts: 57
Likes Received: 0
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Decrementing a counter each time the timer fires will make your clock run slow. You need to check the system clock every time. Timer events are never guaranteed to fire immediately.
readams is offline   Reply With Quote
Old 07/18/2009, 08:20 AM   #48 (permalink)
Member
 
Join Date: Jun 2009
Posts: 259
Likes Received: 0
Thanks: 3
Thanked 88 Times in 13 Posts
Default

Quote:
Originally Posted by dsevil View Post
...I think I actually *like* your app better than mine.
Thanks man. Made my day.
sambao21 is offline   Reply With Quote
Old 07/18/2009, 05:36 PM   #49 (permalink)
Member
 
Join Date: Jun 2009
Posts: 15
Likes Received: 0
Thanks: 9
Thanked 1 Time in 1 Post
Default

need this thanks
Chewbacca23 is offline   Reply With Quote
Old 07/22/2009, 01:27 PM   #50 (permalink)
Member
 
borsend's Avatar
 
Join Date: Jun 2009
Location: KS
Posts: 130
Likes Received: 0
Thanks: 78
Thanked 1 Time in 1 Post
Default

Awsome app. Thank you very much.
borsend is offline   Reply With Quote
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0