Community Questions & Answers
Question about the countdown timer
Hello everyone, I am trying to test the following code of creating a countdown timer (referring to this web site: http://cssgallery.info/create-a-countdown-timer-with-titanium-appcelerator/) I just would like to ask a question about the code: ~~~ var...
how long app is paused
Hi, is it possible to determine how long app was paused for on resume? I have 'paused' event listenter and 'resumed' listener, and what I want to find out is number of seconds between 'paused' and 'resumed'. I know I can check the time on device on...
Creating a timer / stopwatch counting upwards (0.00)
I'm having some difficulty getting a timer to count upwards beginning with 0.00. The idea is, when my app is opened it will display the time spent on the app on a label. I found this timer counting down...
setInterval slows down some devices in standby mode
Hey there, I've just discovered that my app (Which sends coordinates every 5 seconds) doesn't do so on time. I've made a counter in my app which loops through the same setInterval but keeps counting(And shows it on the screen). Than i asked my colleagues...
Android AlarmManager ???
Hello, is there anyway to use the Android AlarmManager service in Titanium? If not, does anyone know if there are plans to implement this? Has someone developed a module for this? I would, but I fear it is beyond my abilities!
setInterval returns null?
Hi All. I can't figure out why I get the error `invalid method '(null)' at app.js (line 84)`, when I test this function in iPhone Simulator. I am using Titanium 3.0 and iPhone 6.0. Basically my code doesn't have much more than the code below, a window (of...
Real Time countdown from Static time variables
Thanks to various pieces of code from the Internet, I was able to come up with an idea for the solution that I want, but not exactly. I have about 10 static times of the day that never change. I want to take those times and using the current time stamp...
A small tutorial on how to make a countdown timer
http://cssgallery.info/create-a-countdown-timer-with-titanium-appcelerator/ The countdown timer is OOP and can be used with or without an interface. Everything is licensed MIT. Enjoy :)
Lap time
I am having difficulty to lap/split time in my Stopwatch. I have given it a try and it doesn't work. I am trying to get the event listener to fire for my Lap button. Can anyone help me out? If you need more code let me know because I am just providing a...
Reseting timer when timer is on 0: 00 in Android
Hey everybody, I have a function called "countDown" which simply creates a timer counting down, on button press Id like the timer to start (the timer lasts for 60 seconds) and then after 61 seconds I would like it to reset by itself....
Resume Time on Stopwatch App
Hello again, **I have actually attempted at trying to make my Stopwatch resume time** after it has been stopped/paused. I am trying to make the "Stop" button to perform another action, which is to resume the time. I am using JavaScript and...
Dynamically updating Labels?
Hello, I have a (hopefully) simple problem to solve: I want to change the text of a label every time I click a button. Now the tricky part is, I want to be able to rotate through 5 different labels and change their text value to a variable that is...
Stopwatch Android
Stopwatch App is for Android. I am using Titanium Studio and JavaScript. I am trying to make my "Stop" button to perform another action. I want it to resume the time. I am also trying to make my "Lap" button work. Why doesn't my event...
Android Stopwatch - Titanium Studio [JavaScript]
This STOPWATCH APP is a mobile app, specifically targeted for Android users. I am using Titanium Studio SDK code to create this Stopwatch. It is partially working. The main problems I have is that the "Start" button performs multiple functions...
Show timer on button press Android
Hey everbody, Developing an application for the game League of Legends, I have managed to do a script with 12 timers (for each group of mobs) and 12 buttons with icon of the groups and the buttons activate the timers.. How do I show the timers on button...
Simple Counter/Timer with setInterval
Hi! im trying to make a simple counter with the function setInterval. I can't get to figure it out how the seconds and the minutes could work together. The first 60 seconds the minute counter skips, it just stays on 0 until the next round 60+58 seconds it...
does setInterval require a lot of resources?
How are timers implemented? If I have 4-5 timers running in parallel doing various things in my app is it a concern? are they resource intensive?
Function to check idle time of user
Hey People, Simple question, is there a function to check the idle time of the user? I want to redirect the user to the login page if he's idle for over 5 minutes. Kind Regards, Niels PS: If there is no function for it, does anyone have an idea on how...
getIdleTime function only returns an object?
Hey People, I'm trying to make a check in my app, when someone has been idle for longer then 5 minutes I want to show the login screen again. I thought I could do this by setting an Interval and checking the idletime in this interval. I tried checking the...
Trying to implement Circular scroll
Hi, I have an interesting issue. I have to show a automatic scroll screen. The problem is as soon as the scroll reaches to the last element, it comes back to the first showing a quick transition backwards. I want it to be smooth. Eg the observed...
Event for iPhone Lock and Unlock?
Hello, Having a great time with 1.0, but I haven't been able to find a window event for when the iPhone is locked or unlocked. I hoped blur and focus would fire, but they don't seem to be. Is there another event I'm missing? I ask because I have a timer...
Automatically Scrolling ScrollableView
Getting to the point, I have a scrollable view. The code is below. I know I can set the scrollview to not take touch events, that much is easy, but what I need to find is how to make it swap views on a timer, say, 5 seconds. Thanks ~~~ var scrollView =...
Amdroid: Countdown timer on android supporting sleep.
I have been digging for days accelerator forums and hope to get a clear response for both me and future developers. Goal: have a timer that counts down , notify the user and auto restart. Requirements: 1. notify even if phone is sleeping and update...
Ask password after 5mn (session)
Hi, I'd like do a session for 5mn with a timer. During 5mn, user is logged. After, user log out automaticly and he must retype his password. I've more files.js . How can I do it ? thanks
refresh remote images
I created a ScrollableView that holds 4 images that i pull in from the internet. However those images refresh every 5 minutes. So every 5 minutes i want to refresh the images that are stored in the ScrollableView. How do i do this? i thought of adding a...
Any Stopwatch or Countup Timer function available?
I've tried searching around but have been unable to find a guide or sample code on how to create a stopwatch function or countup timer. I want to enable user to time the duration of a particular activity with start-stop buttons. Any help will be greatly...
Problem with timer and pause event
Hi! I have a timer in tab. This timer run every 10 seconds. ~~~ /* * Start the scanning of device */ function startScanningForDevice() { if(timer == null) { timer = setInterval(function() { verifyNeighborhood(); },...
Make a timer that does something on an increment?
I am trying to create a timer that will call a method every 50 milliseconds or so, but I can't seem to find any way to do it. Does anyone have any ideas?
Best practice to update a TableView by Timer
I have a tableView object with data read from an Array which I build after reading a remote JSON object. Everything works fine. The problem is that I want to keep a timer hitting that JSON, ensuring that all rows display fresh content. What's the best...
how to periodicaly read a Json from a url? (timer implementation)
I want to read every second a Json from a URL (for a simple chat implementation). How can I do this with tintanium? (in Xcode I used to implement this with threats that used to call itself when it was over and wait 1 second) can I just use settimeout...
Can't reset timer with clearInterval();
I am trying to start a timer with a click event and be able to reset the timer back from zero if the same button is pressed but every time I press the button that initiates the setInterval it seems to be creating a new interval and not reseting the one...
Timer in days hours minutes seconds
~~~ self.time = { d:Math.floor(self.total_sec/86400),h:Math.floor(self.total_sec%86400/3600),m : Math.floor(self.total_sec%86400/3600/60), s: (self.total_sec%60) }; ~~~ What's wrong with this calculation?
Timer problem
What am I doing wrong in the code beneath? I get the correct hours, but when the timer starts the minutes also become seconds and both are counting down as seconds. I use 1h5m30s and it counts down like 1h29m29s 1h28m28s ~~~ this.timer = setInterval(...
Timers
Hi all, again a question from me :D. Anyone has an idea how I can put a countdown timer in my api. So an example I have a date 23/01/2012 at 9pm, then the timer should show 10h40min and still be counting down. Thanks in advance.
Any good canvas, image sprite + clock samples or guides? (Android)
After getting all setup and running (it took a bit of sweat and help via twitter). I started writing my first game. It's very simple and I'm just porting code I had already written. I'm trying to find how to use the Titanium API for generating Canvas,...
Background Operations
So I've read quite a bit (of what's out there) about the app running when in the background/sleep. I have a countdown timer that I'd like to send the user an alert when it finished if the app is in the background/sleep. From my limited understanding I...
Background service stops after five minutes
Hi, I have a background service which makes periodical http calls to load statistics and update app badge. The problem that it works only 5 mins. When I set 5 sec interval to timer It makes near 120 cals to server. When I set interval=4 sec it makes 150...
Android Background Service
I've been trying to get my head around this and struggling for days! I have a countdown timer running in my app that shows an alert when the time is up. The problem is when the app goes to sleep or the device is shut down. My timer code is situated in...
setInterval on Android?
I have a countdown timer that works on a setInterval timer. Despite everything working fine in the Android simulator, the timer stops virtually instantly when the app sleeps on a device. I tried to replicate this on the simualtor by holding the power...
What's wrong with setInterval?
Right so if there's one single thing that is most important out of everything else for a programming language/framework it's the ability to have accurate reliable timers. So.....who wants a go at solving this puzzle: setInterval (seems) to work fine when...
How to do same task in background and foreground?
Hi, I have an app in which I want a beep sound every 10 seconds, no matter whether my app is in the foreground or background. I have used timers to play the beep sound every 10 seconds when my app is in the foreground. What is the best way to keep the...
Quick Help: clearing setInterval - Alarm Clock
Im trying to create an alarm clock, but have run into a little problem. How do I clear the timer (setInterval) when it can't be accessed from within the 'if statement'? And how do I start it again when the Close button is hit? (see comments in...
Display a simple "self-dismissing" message?
I'd like to display a message that displays for 2 seconds and either hides or fades out. I created a view and a label in the view. And a function to show and hide it: ~~~~ function showConfirm() { currentWin.add(vAdded); // wait 2 seconds then...
commonJS persistance
I'm adopting a commonJS approach for a multi-tabbed application. One tab has a countdown timer associated with it, which I'd like to run in the background permanently when set. My problem is that the commonJs approach means that when the user has navigated...
HTTPClient on Timer Crashing
I've been fighting with a problem for a few weeks. I'm using the suds.js framework to call a SOAP service and the individual calls work perfectly. The effect I'm looking for is for the httpclient to be called every 3 seconds to refresh a tableview, but...
setTimeout/setInterval from a Worker
Is it possible to use timer functions from a Worker -- I can't seem to get them working with Titanium Desktop. I know setTimeout/clearTimeout/setInterval/clearInterval come from the window object (which isn't accessable from a Worker), but the mozilla...
Show throbber while tableview is loading
How can i display an image like a throbber while the tableview is loading. I have an rss feed that loads into a tableview. Because it has to pull the information from an .xml source on the internet it can take a second. So it looks like the app is...
Having a hard time with timers
Hello I'm having a big problem here, I'm unable to make a timer and the worst of it all is that the examples given here http://developer.appcelerator.com/question/8031/recurring-timer aren't working for me D: And both of them return with a Runtime Error...
How to handle local push notification with titanium?
I would like to make simple timer app. I could not find the way to handle local push notification in API guide page. Please advise me how to use this LPN with titanium?
How to deal with inconsistant timers?
How have you found to deal with the inconsistencies of the Titanium timers? For example, I am saving an image rendered from an imageView and have to wait for the image to show (and no, changing the image in an existing imageView will not fire the image...
Showing 1-50 of 58 1 2