Reputation: 81
I want to use create-react-app to build a web app and then package it with Tizen to make an app for Samsung Smart-TV. How do I set up such a project? To create a Tizen-project of my React-app, what should i build, package or add? If anyone could write me a step-by-step guide I would be very, very grateful.
I've tried to create a react app inside a Tizen project. It didn't work. I've tried to build my react app and copied the build directory to the Tizen project. It didn't work. I thought that pointing to the index.html in my react app in config.xml would yield some result. But no. Tried to add files from the react app to my Tizen app incrementally. Fail.
This Samsung TV development seems to be kind of hard. Help. I'm flame proof and desperate. Thanks.
Upvotes: 7
Views: 15278
Reputation: 41
You can try https://renative.org/docs/platform-tizen
It generates hello world app based on react native and does the rest for you
you also get: - focus management - generated navigation example - built in support for fonts, vector graphics - hot module reload for quick development
Once you follow installation setup you simply run it in emulator:
rnv run -p tizen
or
rnv run -p tizen -d -t <TIZEN_TV_IP>
once you done it you can look at ./platformBuilds/..
folder to see how it all works together
Upvotes: 4
Reputation: 2674
Tizen Studio seems kind of weird about file placement. Trying to have the config.xml
file at the root, yet pointing to the location of ./build/index.html
seemed to confuse it.
The way I've done it is this:
homepage
key inside of package.json
to ./
so that asset file paths are generated relative to index.html
and not absolute.yarn build
(or npm run build
) to generate a ./build
folder../build
folder of react app. This requires expanding "More Properties" where you enter your project name, and unchecking default location (so that you can browse to your ./build
folder). You should be able to follow the Tizen documentation for everything else Tizen-related.icon.png
, .settings
, .project
, config.xml
, .tproject
) into ./public
folder of react app, so that they get copied over after every build. Note that the Tizen dot files won't show in Tizen Studio and you should copy them from a file explorer that will display them. In Tizen Studio, only this ./build
folder will show as part of your project, and should only be used for running build
/debug
/run
actions. Any changes to Tizen app configs, etc. should be done in ./public
folder of react app or else they'll get overwritten after every build.Tizen Studio/Web/Editor/Javascript Editor
. With this enabled, the builds choked when validating the minified code during the build.On a side note... For navigation with a remote, I used this component library. It was the easiest to implement.
Upvotes: 11
Reputation: 53
It's a little Challenging but you can do it
Follow these instructions:
Prerequisites
Setup:
Create Project
config.xml
<?xml version="1.0" encoding="UTF-8"?>
<content src="index.html"/>
<feature name="http://tizen.org/feature/screen.size.normal.1080.1920"/>
<icon src="icon.png"/>
<name>Testing</name>
<tizen:profile name="tv-samsung"/>
<tizen:privilege name="http://developer.samsung.com/privilege/network.public"/>
<tizen:privilege name="http://tizen.org/privilege/application.launch"/>
<tizen:privilege name="http://tizen.org/privilege/tv.inputdevice"/>
<tizen:privilege name="http://tizen.org/privilege/tv.display"/>
<tizen:privilege name="http://tizen.org/privilege/fullscreen"/>
<tizen:privilege name="http://tizen.org/privilege/internet"/>
<tizen:privilege name="http://tizen.org/privilege/volume.set"/>
<tizen:privilege name="http://developer.samsung.com/privilege/drmplay"/>
<tizen:privilege name="http://developer.samsung.com/privilege/productinfo"/>
<tizen:setting pointing-device-support='disable' />
<tizen:setting screen-orientation="landscape" context-menu="disable" background-support="enable" encryption="disable" install-location="auto" hwkey-event="enable"/>
index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0"
/>
<link rel="stylesheet" href="css/style.css" />
</head>
<body>
<script>
window.open("http://0.0.0.0:3000") <!-- Add your IP address ->
</script>
</body>
</html>
Pair with REAL DEVICE
Upvotes: 2