when my blackberry App starts, it wants to get the current Backlight timeout value which setted by user, for example, 30 seconds, 1 minutes.
I've found the Backlight class in API documents. But it only has getTimeoutDefault() method, which will always return 30 seconds.
Please tell me how to do.
Thanks a lot!
Related
I've made a Chromecast app that displays multiple quotes and the whole idea is to basically connect it to a spare tv/monitor you have lying around and use it to have inspirational quotes change on the screen.
But the problem is, Chromecast automatically times out and goes back to the home screen after every few minutes of inactivity. I'd like to find out how it detects inactivity so I can prevent this behavior and allow my app to keep running on the Chromecast indefinitely, as a sort of replacement for the original photo screensaver.
I figured out how to keep my app running. There is a property of CastReceiverOptions called disableIdleTimeout that can be set.
const options = new cast.framework.CastReceiverOptions();
options.disableIdleTimeout = true;
const instance = cast.framework.CastReceiverContext.getInstance();
instance.start(options);
With this set to true, the receiver no longer times out after 5 minutes.
You may check the setInactivityTimeout method then use the maxInactivity parameter which is interval in seconds before closing an unresponsive connection.
The setInactivityTimeout(maxInactivity) sets the receiver inactivity timeout. It is recommended to set the maximum inactivity value when calling Start and not changing it. This API is just provided for development/debugging purposes.
You may also refer with this SO answer which stated that:
Timeout value cannot be adjusted by application. It would help us to understand what is causing the timeout in your case. Timeout happens when either the sender does not reply to the receiver's ping requests in a timely manner, or when the sender has not received a ping from the receiver for a certain length of time. It might be the case that the media you are trying to load is tying up the CPU on the receiver so that it can't send its ping request to the sender.
Hope this helps!
I want to do something like this. When my view load I am showing the server time on my view. and what I want to do is when my device clock minute changes I want to call to the service again and get the server time. Is there any event fire when the device clock's minutes change? Or how can I capture that? Please help me.
Thanks
You could fire an NSTimer every 10 seconds and check the minutes in NSDateComponents.
I'll show my question by example.
So, f.e., it's 12:00 (set automatically) now, but user decided to change the current time to 12:10 (it won't be really exact time, but user wants so).
Is there any way to get this 10 minutes in code?
One method is to connect to a time server on your own. Or, if you app is running when it changes, you could keep a timer running and look for discontinuities in time.
Possible duplicate of: How can I locally detect iPhone clock advancement by a user between app runs?
When you set the lifetime attribute of
<sessionTokenRequirement lifetime="00:10" />
Does that mean the token will expire in 10 minutes if there is no activity (no POST OR GET,etc) I am wondering if the user makes a post or get does it reset it back to 10 minutes. What I want is for the user to be logged in as long as they are actively using the app which should hit the server every minute or so. If they they stop using the app, I automatically log them out, but what I don't want is if they use the app for 11 minutes their claims have been removed. Could someone point me in the right direction?
Is it like the session timeout which times out if the user remains idle? If not is there something like that? Or am I using it in the wrong way?
I've read plenty of times that we only can run background tasks for location, voip and audio.
Well, I just noticed that in Windows Phone there is a possibility to set up a background agent that starts every 30 minutes and runs for X seconds, then it's killed.
Is there any kind of agent in iOS?
I need to upload location every 30 mins. However, if I use significant location changes, if I'm at home for the weekend and my app is closed, it won't upload any location until I go out.
So, how would you do this?
Thank you!
There is nothing of this kind. But what is wrong with not uploading the location when it didn't change?