Hosted Web App

webOS TV app has two types. Packaged app is launched using the installed app resources on your webOS TV.

 

 

Hosted app is executed by URL redirection with a local dummy app and remote app resources server.

 

 

Hosted (server hosted) web apps reside on a remote web server. Users access them through an Internet browser. You can build hosted web apps for webOS TV, using standard web technologies like HTML, CSS, and JavaScript. These apps need connectivity to the web server to run successfully. As these apps reside on a remote web server, you can update them at anytime without having to worry about pushing updates to the TV.

 

Creating hosted webOS TV web apps essentially involves the following:

  1. Creating a basic webOS TV web app that includes files such as index.html, appinfo.json, and the required key app assets. See Basic HTML AppCreating a Web App and Key App Assets for more details.
  2. Redirecting the default web page of the hosted webOS TV web app to the default web page of the web app on the remote server.

 

The following example shows how to redirect the hosted webOS TV web app's index.html to the index.html of the web app  the remote server.

<html>
    <head>
        <meta http-equiv="refresh" content="0;url=http://www.example.com/index.html">
    </head>
</html>

 

The following example shows how to redirect index.html in JavaScript:

<html>
    <script>location.href='http://www.example.com/index.html';</script>
</html>

 

The default web page of the hosted webOS TV web app can be changed from index.html to any other HTML file. In order to change the default web page of the hosted webOS TV web app, modify the main property in the appinfo.json file of the hosted webOS TV web app. For more information, see appinfo.json.

 

You can deploy the hosted webOS TV web app on webOS TV emulator or LG Smart+ TV. See Deploying a Web App with CLI for more information.

Download

This sample app shows URL redirection to the Google search website using the JavaScript and HTML5 meta tag. The dummy app consists of Index.html, icon.png, largeicon.png, appinfo.json, backgroundImage.png, and splashBackgroundImage.png.

For your understanding on the hosted app, you can download the sample code and its IPK file at the below link for free.

Result in the webOS TV Emulator

You can install the sample app and see the sample app result in the webOS TV emulator as below image.

 

Do's and Don'ts

  • Do change the URL for your application
  • Do check network connection again before testing
Navigation