Question
I have developed a web application that is not a native Tizen app. Currently, I'm loading the web application URL using window.location.href = "url".
When running this on the emulator and TV device, the application loads in a browser instead of running as a normal TV app. On mobile platforms, we can achieve this using WebView. Is there a similar approach for TV applications to avoid the browser and run as a normal Tizen application?
Answer
Problem Understanding
The user wants to run a web application on Tizen TV devices without it opening in a browser, similar to how WebView works on mobile platforms. Currently, using window.location.href causes the app to load in the browser.
Solution Methods
-
Using iframe:
- You can embed your web application within an iframe in your Tizen web app.
- This approach keeps the application running within the app container rather than opening in a browser.
-
Creating a Web Application Project:
- Instead of loading a remote URL, create a proper Tizen web application project.
- Package your web assets within the project and run them locally.
-
Using Tizen Web Runtime:
- Configure your application as a Web Runtime (WRT) application.
- This allows your web app to run as a standalone application without browser chrome.
Code Examples
// Using iframe approach
document.body.innerHTML = '<iframe src="your-web-app-url" style="width:100%; height:100%; border:none;"></iframe>';
Additional Tips
- When using iframe, ensure your web application is designed to work within the iframe constraints.
- For better performance, consider creating a proper Tizen web application project instead of loading a remote URL.
- Check the Tizen documentation for Web Application development guidelines.