Community Questions & Answers

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...

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...

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...

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...

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 =...

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.

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...

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...

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...

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...

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 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