In Windows 8.1, does Consolidated mean Terminated? - windows-runtime

There is a new API in the Windows 8.1 ApplicationView namespace. The ApplicationView.Consolidated | consolidated event. MSDN
Description: Occurs when the window is removed from the list of recently used apps or if the user executes a close gesture on it.
MSDN docs are a little vague. Is this an API developers can use to detect when their application has been terminated by the user or by the system? What is a scenario to handle this event?

The consolidated event is only fired by secondary views created through MSApp.createNewView, and thus does not apply to the main view of the app--that is, it's not fired when the main app window is closed. It's only there to let the app as a whole know that one of its secondary views has been closed.
It's demonstrated in the Multiple Views sample and there's some lengthy commentary in the code on the matter.
The short of it is that there isn't an event other than suspending that occurs when an app is closed. You use the suspending event to do whatever you need.

Related

Prevent WinRT App from entering suspend state in a Line-of-Business app

I'm developing a line of business app for Windows 8.1, that is, I am not deploying through the Windows Store and will be able to control all of the features of both the OS and hardware this app is being deployed on.
Because this app is working as the UI in a real-time situation I would prefer if I could ignore the life-cycle events and not have the app suspend or terminate at the whim of Windows 8. Does anyone know of a way to do this?
I have seen some older answers, such as this one and this other one indicating otherwise, but I haven't yet found anything more recently and specifically dealing with the case of a line of business app. I have found the Embedded Lockdown Manager which would prevent the app losing focus and addresses some of the needs I have, but I still would like a way to simple disable Lifecycle events.
Have you tried Assigned Access Mode? Basically use PC Settings -> Accounts to lock an account to a single app. You have to reboot the device and log-in again in order to run anything else.

How to select keyboard in Tizen/HTML5 for Wearables

I have two system wide keyboards pre-installed on my Tizen Wearable device, the first one is a stock Samsumg's keyboard, the second one - Custom. The first one is a user's default selected in Settings.
I don't want to change the system's default, but I want my application to use the Custom keyboard.
In native API I've seen Tizen::Ui::InputConnection object that can be used as a property in Edit or TextArea controls, but I didn't see anything like this in HTML5 API. Searching Tizen's forum didn't help.
I've also seen in Tizen's SDK IME's WebHelperClient example a number of undocumented commands used to talk to a Tizen's service through a websocket. Probably there is a command to select an active keyboard, but I didn't find it.
Any leads are appreciated.
IMO that is not possible for either web apps or native apps.
Reason:
1. In gear, simultaneously two Keyboard can't be active at the same time.
Also, suppose there is an API available which you can use to change to custom keyboard while your app is running, but what if you close your application not using the normal hardware exit(i.e. Swiping down), rather you close it from "Recent Applications" then the custom keyboard that you activated for your app will be set for other applications as well.
Also the documentation available here doesn't explain anything which you are asking
https://developer.tizen.org/documentation/guides/web-application/tizen-features/ime-application

Realtime API for model synchronization

I am looking to extend an existing JavaScript/CoffeeScript application using the realtime API. What I want to do is synchronize a map used by the Model of my application, part of an MVC framework spinejs. This would require that all the operations of the API will be done on the Model of my application (which is pure client-side), and have no direct interaction with the View.
All the open-source examples of realtime-api I have found had the JS code within the HTML being displayed, or much of the operations for authorization/loading etc (quickstart,realtime-cube,realtime-playground).
Is it possible to use realtime-api, without having direct
interaction with the displayed content?
Furthermore, if any examples are available it would be greatly appreciated.
Once the auth is done, all the operations can be performed, without any user operation being necessary (i.e. they don't have to be triggered by a user event).
I can show you our RT code here, although it's non-trivial, the listeners are listening to our own model, which cause RT functions to be invoked.
In terms of the auth, it works fine, except if you want to support multiple accounts. For single accounts you can use the immediate mode to enable signing in without causing a popup.
If there are multiple accounts logged in, you will need a user event to start the auth without having a popup, immediate mode messes up multiple account handling. Note there is a bug in the multiple account selection screen anyway, which causes a poor user experience.

How can I pre-start my RAP application to trigger warmup right after startup

I have a RAP application which we deploy into a Tomcat instance. The application does some additional stuff during it's first startup.
Currently when the first user opens the webpage in a Browser, it takes quite a while until the application is ready because of this one-time initialization work.
This is bad for usability as the first user needs to wait a long time until this startup-work is done.
Is there a way to trigger or simulate a first session after the Tomcat is started so we can warmup the application and the first user receives feedback quickly?
I tried to do some simple URL-requests via URLConnection to simulate a browser, but it seems the protocol to trigger a new session is non-trivial.
I also tried to use HtmlUnit to request the page with JavaScript enabled, this works to some degree, but HtmlUnit is quite heavy for this simple step.
So is there an official API or at least some sort of workaround that allows me to pre-start and initialize the application?
Unless this initialization requires a UI session (i.e. a user), the configure method of your ApplicationConfiguration could be a suitable place. However, at this point, the ApplicationContext has not been completely set up, so it could be too early. Also, if your application is based on the workbench and extension points, you won't have an ApplicationConfiguration of your own.
Would you mind opening a bug report (http://eclipse.org/rap/bugs) and describe your use case? I think we should provide some kind of hook for applications to setup and clean up, e.g. an ApplicationContextListener?

Flex - Run Air Application In Background

I am trying to provide my users with the option to have my application launch automatically and complete a task at a certain time every week.
I can make my application launch at log in using NativeApplication.nativeApplication.startAtLogin=true but I then want to detect if the time is the time they selected and if it isn't then run the application in the background until the time does match or the user shuts down their computer.
Does anyone know of a way to do this? On Adobe's webpage comparing Flex web apps and desktop apps it implied to me that applications could be run in the background but I'm struggling to find anything.
You can close the initial native window without killing the process
NativeApplication.nativeApplication.autoExit = false;
NativeWindow(this.stage.nativeWindow).close();
OR
You can close the initial native window and create a new window that acts as a desktop widget without appearing in the taskbar with either the UTILITY or LIGHTWEIGHT window type.
http://help.adobe.com/en_US/air/reference/html/flash/display/NativeWindowInitOptions.html#type
Either you keep the process running which times when the next 'job' should be ran, or you can set a system cron job (or something similar) which is specific to the OS. You'll want to use the NativeWindow option of 'LIGHTWEIGHT' so that your application doesn't show up to the user.
Personally, for these kinds of processes, I don't even try to use Air since it isn't really made for this kind of stuff. It's meant to be used for UI based apps and not process based. Use Java or C# instead.