| ARRIS Enterprises, Inc. Confidential Information |
Integrating Web AppsThe example portal is able to determine if any secondary web apps have been added to the boot image, and if they have been, add them to the main menu and be able to handle application switching. Please note that this is just ONE way of implementing multi-app switching and web app integration, and you are free to alter some of the mechanisms discussed here. Because of this flexibility, it is important to have read and understood the multi-app documentation and especially the web app integration page before diving into the code shown here. Overall goalIt would be nice to write the example portal in such a way that we don't hard-code any details of secondary applications into the actual portal code. A more data-driven approach is to instead represent each web app with an IIP which installs everything necessary to display, launch and manage the web app. We can then very simply add and remove secondary apps from the boot image configuration file just by adding and removing the IIP. An example IIP is provided in the SDK in We will now take a closer look at some of the custom features that have been added to the secondary IIP to help it integrate with the portal. Web App IconThe portal will need to have an icon representing the web app, which will be added to the main menu. A simple 128x128 png file is used by the example portal, you can use whatever suits your menu system. The full contents of the example web app IIP is:
.
├── data
│ └── usr
│ ├── applications
│ │ └── webgldemo
│ │ └── properties_webgldemo.xml
│ └── local
│ └── portal
│ └── icons
│ └── f1.png
├── iip_version
├── info.xml
└── install
└── buildtime
Any files under the Life Cycle ManagementSome web apps (such as the WebGLDemo provided) require large amounts of graphics resources and CPU power to run. It is not advisable to leave these running in the background all of the time. When switching to the app it can be started, and stopped again when the end-user leaves the app. This takes longer (especially the start) since the data for the application needs to be downloaded, but it does free up a lot of system resources for portal activity (such as an EPG). Since the desired behaviour may be different from web app to web app (lightweight apps could be left running) we need a mechanism in the IIP which communicates this to the portal. The example portal creates a few custom properties in the
These properties are custom, in that they can be named arbitrarily and you are free to use them how you like within the portal code. The current secondary generic browser app is TECHNICAL PREVIEW, but when it is finalized it is likely that some (or all) of these lifecycle-related properties will be officially defined (and possibly automatically implemented) and shown on the application property file page. The URL to the icon is specified with the custom The multi-app support page shows how the portal code can read the properties defined in an applications properties XML file. Key handlingPortal handling Back and MenuTwo more custom properties are used to inform the portal about key presses while the secondary is visible. The When the portal starts, and reads the application properties, it subscribes to these keyIdentifiers. When they occur, both the web app and the portal receive them. Custom remote control key mappingA custom keymapping feature is also provided, which allows you to override the DOM event generated from a remote control button, per-application. This is useful for example if you have a web app which was designed with keyboard navigation in mind, and you want to map those keyboard keys to remote control buttons in a more sensible way. The IIP includes a keymap XML file and refers to it with the GfxMemory allocationThe Hello Racer example used in the WebGLDemo app requires a lot of graphics memory to be allocated. So adjust the |