did cobalt have some function for pre-launch it? - cobalt

in Youtube of QT version, it support suspend function for pre-launch Youtube.
pre-launch mean we will launch cobalt in the background before user launch it, so it can't display anything.
did cobalt have some function for pre-launch it?
if yes, could you help us to enable it?

In order to suspend Cobalt, dispatch kSbEventTypeSuspend event. Note that you can only dispatch suspend event in a certain state, namely the sequence of events should be kSbEventTypeStart -> kSbEventTypePause -> kSbEventTypeSuspend. See https://cobalt.googlesource.com/cobalt/+/master/src/starboard/shared/starboard/application.cc#105

Related

Running settimeout in the background

Why doesn't settimeout/debounceTime work when the app is minimized? Events are still being triggered, but I was wondering if there is a way to make timers work while the app is backgrounded.
As soon user leaves your app, the system will stop it from running to reduce battery usage.
If you like your app to execute in background, you must use the appropriate options in the desired platform (Background Task / Fetch in iOS | Background services in Android).

Android Wear: implementation of standard Timer App

I'm trying to implement the same app as standard Timer app (for learning purposes).
Is it available sources of standard Timer app installed on Android Wear?
How to implement starting and displaying Activity from Sleeping Mode. Like green screen in Timer app, that appears when timer reach zero. (the problem: flags FLAG_TURN_SCREEN_ON, FLAG_KEEP_SCREEN_ON, FLAG_SHOW_WHEN_LOCKED and FLAG_DISMISS_KEYGUARD in onCreate method don't help to cancel Sleep Mode Screen and display target Activity to user).
Cheers!

Windows 7.1 SDK - Timing a call

I currently have a "dumbphone", but I'm trying to make an app that'll time and store the call duration of incoming calls for windows 7.1 ("7.5") phones, for the user scheduling purposes.
However, after extensive searching and googling, with topics like this one:
Windows Phone 7 - How to calculate call duration or termination
it seems that the Windows 7/7.1 SDK does not allow access to recognizing when a call is coming in. I've read about obscure and unobscure, but that this wouldn't be a good idea since it would start the timer anytime the UI hides the program, not just calls.
I've thought that maybe I could just pull the call duration or the start/end time from the call history, but windows 7 SDK doesn't support that either it seems.
So I decided to seek help. Is there a way to make this work? Is there some clever way to recognize when a call is incoming and stopped? Or some clever way to pull call times/durations? Or maybe a way to detect when the user presses that "accept incoming call" button? Or maybe a way to single out when a call is obscuring the UI?
Any help would be greatly appreciated. Thank you
Due to security reasons your application does not have any kind of accsess to call history ect. So you are in a sendbox and you don't know nothing about phone calls.
From the Windows Phone SDK, there is no way to achieve this!
The only thing I can think of is that when a call comes, the current app gets notified that is now Obscured because a new screen is now on top of it (the caller ID screen), and will get notified when it gets back to focus.
But the truth is that this happens even if a SMS message notification pops on the screen and the user taps to read it, or some app gets a notification pushed...

How to run a WP7 silverlight application after some period of time?

I have an application in WP7 silverlight that needs to be launched after a specific period of time, something like an alarm.
But I want to launch the application itself not WP7's alarm.
I use:
this.Visibility = Visibility.Collapsed;
for hiding the application, I know it is not the correct way for making it run in the background.
Any hint please? Thanks.
The platform specifically does not support running apps in the way you describe.
If your functionality can't run in a background agent then your only options are to use an alarm or toast message (sent as a push notification) to prompt the user to start the app.
One of the design decisions behind the platform is that the user should always know what is going on on the phone so having apps stop and start by themselves would be contrary to this.
You can run a background agent and display a toast notification to the user , and launch the application when the user clicks on the toast.
You can also push toast messages to the device, and rely on the user clicking the toast .

Request suspend on Vista but allow other applications to cancel

My application uses the Win32 SetSuspendState() API to trigger system suspend or hibernation when it has finished doing a lengthy task.
The API accepts a parameter "ForceCritical" which determines whether or not the system suspends immediately or whether it broadcasts PBT_APMQUERYSUSPEND first to allow other apps the chance to cancel the suspend. My app uses this to play nicely with other apps like Media Player, so it doesn't suspend if you're listening to music or something.
For some reason, starting with Vista, MS have changed things so this parameter is ignored so SetSuspendState immediately causes a suspend and other applications have no opportunity to stop it.
Does anyone know how I can get the desired "polite" behaviour back again on Vista?
MSDN says
To prevent the system from transitioning to a low-power state in Windows Vista, an application must call SetThreadExecutionState to inform the system that it is in use
I would guess that WMP does this, but older apps don't. You could probably emulate this by sending the WM_POWERBROADCAST:PBT_APMQUERYSUSPEND message to all top level windows and check their return values (Send the message with a timeout so a hung app does not hang your app)

Resources