• Quick Start
  • Booting
  • Platform
  • Portals
  • References
    • API Reference TOI3
    • IIP Reference
  • Resources
ARRIS Enterprises, Inc. Confidential Information

Integrating Web Apps

This tutorial shows how to integrate with a third-party, web-based application using the generic secondary browser. Please have a look at the multiple application support documentation first, so you are familiar with the basic architecture.

Introduction

This tutorial covers a number of tasks:

  • Adding a secondary browser to the boot image
  • Loading web based applications by URL
  • Building a secondary app IIP
  • Switching between the portal and the web app
  • How to perform additional customization and integration

Adding a secondary browser to the boot image

If you have not already done so, build the example.config boot image using the SDK.

One of the secondary applications distributed by ARRIS is a generic web browser. Add this browser to the boot image configuration as follows:


# Add secondary browser, start it automatically
kreatv-app-webkit-browser

With this installed, a very simple multi-application implementation can be achieved just by calling the ToiSecondaryApplication::start() function and passing the web application URL, followed by show() (we will look at the exact steps in more detail a bit later). However, there are several drawbacks to this method, so we will continue and develop a dedicated IIP for our secondary application. Having the web application represented by an IIP allows for a lot more fine control.

Building a secondary application IIP

We will create an IIP for each web application we want to integrate. There is no need to duplicate the browser executable in these new IIPs. Instead, each new IIP points to the generic browser executable file, and provides its own URL (and some additional parameters). The KreaTV platform will then run multiple instances of the secondary browser, each in its own LXC sandbox environment and running with the specified properties and arguments. This greatly simplifies the management of multiple applications from within the main portal.

The SDK contains an example integration with the URL http://helloracer.com/webgl. As this is a WebGL application, the kreatv-option-opengl IIP must be present in the boot image. The example integration IIP can be found in <sdk_root>/examples/webgldemo/. An IIP is a tarred, gzipped file, so you can run tar zxfv webgldemo.iip to unpack it and examine the contents. The essential elements look like this:


.
├── data
│   └── usr
│       └── applications
│           └── webgldemo
│               └── properties_webgldemo.xml
├── iip_version
├── info.xml
└── install
    └── buildtime

You can find more information about IIP structure in the Platform section of this manual. Here we are most interested in the properties_webgldemo.xml file, which defines our application properties. It looks a little like this (not all properties are shown here):


<?xml version="1.0"?>
<ApplicationProperties>
  <Name>WebGLDemo</Name>
  <Run>/usr/applications/ekiohbrowser/webkit_browser.sh</Run>
  <IsPlatformApplication>true</IsPlatformApplication>
  <ApplicationType>secondary</ApplicationType>
  <GfxMemory>131072</GfxMemory>
  <Property name="UserAgent">Mozilla/5.0 (Linux) AppleWebKit/#WEBKIT_VERSION (KHTML, like Gecko) Ekioh/#EKIOH_VERSION Safari/#WEBKIT_VERSION</Property>
  <Property name="StartUrl">http://helloracer.com/webgl</Property>
  <Property name="VolumeKeysEnabled">false</Property>
</ApplicationProperties>

Full information about the properties file may be found here. This tutorial is only interested in three of the properties, run, which is the executable to use when launching this secondary application, the name property, which the portal will use to refer to this secondary application, and the StartUrl property, which is the URL the secondary browser will be given on startup.

Change directory to the example, and tar it into an IIP as follows:


$ cd $sdk_root/examples/webgldemo
[webgldemo ]$ tar zcfv ../../products/kreatv-app-webgldemo_%BSG_BUILD_VERSION_bcm15.iip *

Then add kreatv-app-webgl to your boot image configuration and rebuild the boot image.

5.1.p5

Copyright (c) 2017 ARRIS Enterprises, LLC. All Rights Reserved. ARRIS Enterprises, LLC. Confidential Information.