Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Tizen Support #104

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Tizen Support #104

wants to merge 16 commits into from

Conversation

raphamorim
Copy link
Owner

with commits from #54

@raphamorim raphamorim changed the title Tizen Tizen Support Dec 29, 2017
@raphamorim raphamorim mentioned this pull request Dec 29, 2017
@raphamorim raphamorim added this to the 0.4.0 milestone Dec 29, 2017
@@ -0,0 +1,7 @@
# Setup Tizen Environment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me comment on this. (May be this speech should be included later as a documentation section)

Tizen TV apps development process is ugly as I can have understood in the last few days. 😫
There're several TV Platforms and at the same time there several version of IDEs. And to start development process you should find the right combination between these ones.

Tizen Platform gets installed on the TVs since 2015 and has several versions according to this table:

  • Tizen 2.3 (for 2015 models)
  • Tizen 2.4 (for 2016 models)
  • Tizen 3.0 (for 2017)
  • Tizen 4.0 (ta-daam 🎉, drumsound 🥁 , for 2018 ones)

Tizen 4.0 TVs have not even been released yet and the list of available models will be ready at February 2018.

So for the time beeing the latest phisical device with installed Tizen Platform you can use for development has 3.0 version.

Now let's consider available IDEs for Tizen app development:

  • Tizen Studio 1.0
  • Tizen Studio 1.1
  • Tizen Studio 1.2
  • Tizen Studio 1.3
  • Tizen Studio 2.0
  • Tizen Studio 2.1
  • And the legacy Tizen SDK IDE (the latest available version is 2.4-rev8)

You can download all of the above from the download archive page.
You do not find these links on official Tizen/Samsung TV development related pages.

Now let's try to download the latest version of Tizen Studio. But there's a note below that says

Note Tizen Studio 2.x supports TV Extension 4.x or higher.

TV Extension is required by IDE to enable TV development. Without it you can create apps only for mobile phones and wearables. Extension version corresponds to Tizen Platform version.

OK. I have, for example, flagmanship Samsung TV device and cannot develop for it with the latest available IDE 🤦‍♂️

If you try to connect to your Samsung TV from Tizen Studio 2.0 with installed TV Extension 4.0 you will get an error indicating that the Platform Unknown.

So the only one workaround is to download the previous version of Tizen Studio that is 1.3.
Also you need to install TV Extension 3.1.2 as suggested here:

You may download the TV Extension 3.1.2, that should contain packages for 2.X & 3.X development.

Additionally, Rather than Tizen Studio 2.X, I would suggest you to download & Install Previous IDE (For example: Tizen SDK 2.4 Rev8 or Tizen Studio 1.2 )

But when you open Tizen Studio 1.3 it tries to update itself to 2.x version.
So you need to disable autoupdate and install TV Extension manually.
You can find instructions here. (See my comment on Andrew Witte's post)

Only after that you can start normal development for Samsung Tizen TVs and upload your app in the device.

Very VERY terrible experience.

P.S. Based on this I'd also suggest you to give up on your intent to support Samsung Orsay platform.
I'm in doubt that supporting older that 2014 year TV models will have any impact on users and will bring any benefits.
Samsung/Tizen doesn't have acceptable development tools for current devices and what happens with the earlier ones only God knows.
I'm afraid that tools/IDEs/SDKs might not be available any more.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But when you open Tizen Studio 1.3 it tries to update itself to 2.x version.
So you need to disable autoupdate and install TV Extension manually.
You can find instructions here. (See my comment on Andrew Witte's post)

Thanks for the advice.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be a chaotic scenario @Blinnikov 😢

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately it is. 😞
Samsung/Tizen forums are full of angry people who are indignant about the unclear development process.
By the way It looks I found a way to run apps from Tizen Studio 2.x on old devices 2.3+.
I'll post on this in a while when I test all the scenarios.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just posted an article on Medium describing the problem and the solution 🎉 :

Developing for “old” Samsung TVs in Tizen Studio 2.x

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't really need Tizen SDK to develop the applications.
We need it to:

  • Pack and Sign
  • Run to Device
  • Emulator

For the first two, we can do it without the Tizen SDK (ref: https://github.com/Samsung/vscode-extension-tizentv)
To Emulator we might be able to use only the contents from the "tv-extensions-X.X".

To Samsung Legacy SDK (Orsay?) we can use the stuff from cordova (https://github.com/Samsung/grunt-cordova-sectv/blob/master/tasks/packager/sectv-orsay.js)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dead It's a great solution for standard apps.

As a Samsung partner we are using web hosted apps. So, in this case, we need to replace a index.html with an url in confit.xml at <content src="" /> node. Unfortunately VSCode extension doesn't support this. 😢

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dead You need the sdb part still for the extension (tizen studio/sdk) and they include it there
but: sdb is "basically" an adb, which is open source so you can go with it ;)
so it could be done (and it's done here)

  • run your adb server with node, use socket and define the protocol
  • implement the device discovery (or just map the devices via hand)
  • implement the basic commands:
  OPEN: (localId, destination = DESTINATIONS.SHELL) => {
    //Buffer("OPEN").readUInt32LE(0); // 0x4e45504f
    return SDB.pack(
      Buffer.from("OPEN").readUInt32LE(0),
      localId,
      0,
      destination
    );
  },
   // and internal command definition:
   SHELL: args => `shell:${args}:`,
   // and and actual command on the device, it will give an OKAY then the results
   const cmd = SDB.COMMANDS.OPEN(0x42, SDB.DESTINATIONS.SHELL("0 vd_applist"));


pack it, then send it thought your server, it will respond, make sure to have the talk going on with the client as it should and voila, in order to support older ones, just de-ref the 1.4 bridge and check the commands

:) 👍
same goes for the emulator,
the packaging is easy as well, signing is in the same samsung like lazy level :)
they mention security all over the place and they still keep using legacy tech on their flagship devices

const chalk = require('chalk');
const execSync = require('child_process').execSync;

function defaultCLIEnv() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid hardcoded paths.
This works only for your environment. There's no user celio.latorraca on my Mac.
Moreover, I would suggest to remove this fallback function at all since we force users to have TIZEN_CLI env variable specified.


function run(root) {
let tizen_CLI_ENV = process.env.TIZEN_CLI || false;
if (!tizen_CLI_ENV) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed I think.
Throw an Error if TIZEN_CLI variable not specified.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to think better about this approach. Because React-TV already tries to predict EnvPath on WebOS scenarios. I don't have assure if this is the best approach.

Another idea is allow to set configuration for binary paths on package.json

console.log('');
console.log(chalk.dim('Setting up Emulator...'));

const vms = execSync(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who's interesting on running apps on emulators?
We need to support real devices.
This may be an additional config option (run on device/emulator).

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that would be an additional.
But not all developer have real devices to test.
BTW: Check #107, I think it will be a better approach.

).toString();

if (vms.indexOf('react-tv-tizen') < 0) {
execSync(`${tizen_CLI_ENV}/../../emulator/bin/em-cli create -n react-tv-tizen -p tv-samsung-4.0-x86`);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about 4.0 version.
Should be configurable.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For while I'm thinking about support >=3 versions, even for renderer. What do you think?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For real devices the minimum supported version should be 2.3 I think.
If you look at the TV Model Groups table you can see that a huge amount of TVs supports only 2.3 version.
Also the standard template created in Tizen Studio suggests to use 2.3 version (see config.xml from this PR required_version="2.3").
Moreover, almost every application from Tizen apps exmples specifies required version as 2.3.
And for the time being there're no phisical device in the wild with Tizen 4.0 Platform on board (only 2.3, 2.4, 3.0), so >=3 is not correct excatly.

Anyway I think we can proceed with >=3 for emulators since 3.0, 4.0 Plaforms can run 2.3 apps.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems a reasonable thought, we can go on with >=2.3

@@ -20,8 +20,15 @@ yarn

To run it:

WebOS:
```shell
yarn start

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to start-webos for consistency

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -13,21 +13,23 @@
},
"scripts": {
"build": "webpack",
"build-prod": "NODE_ENV=production yarn build",
"build-prod": "cross-env NODE_ENV=production yarn build",
"react-tv-cli": "react-tv-cli",
"start": "yarn build-prod && react-tv-cli run-webos",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to start-webos for consistency

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/Template01" version="0.2.1" viewmodes="maximized">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be we need some random id generation here.
Low priority though.

@raphamorim
Copy link
Owner Author

@Blinnikov can you go on with this feature? What do you think?
I can't stop to work with it right now, currently I'm working on #100 and in some renderering improvements, then after I close these tasks I'm planning to come back for it.

@ppsirius
Copy link

ppsirius commented Mar 5, 2018

It's possible to generate the certificate and send to the device by CLI but only for Tizen certificate :|
Check this 1 2 3
Good idea is to create the certificate by SDK and build and deploy app in terminal.
You can check my boilerplate to see how it's working.
Also supporting for Orsay isn't good idea performance on this platform is terrible.

<feature name="http://tizen.org/feature/screen.size.normal.1080.1920"/>
<tizen:metadata key="http://samsung.com/tv/metadata/prelaunch.support" value="true"/>
<tizen:profile name="tv"/>
<tizen:setting background-support="disable" context-menu="enable" encryption="disable" hwkey-event="enable" install-location="auto" screen-orientation="landscape"/>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if we could set the screen orientation dynamically :).

return console.log(chalk.dim('[react-tv]'), 'You should add files');
}

// TODO: option to create/select profiles?
Copy link

@chittolina chittolina Nov 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The user could pass it by a CLI argument or he could be asked interactively here. What do you think? Btw I could help you out.

@rdobda-gaia
Copy link

Is this still being maintained or does it seem like it's an unwieldily uphill climb? It would be great to have a development environment where we can deliver apps on webOS and Tizen at the same time, but it seems like this project hasn't been updated in almost a year, and there's a lot of frustration, uncertainty, and shifting standards about delivering samsung tizen solutions.

@fourscience
Copy link

Is this still being maintained or does it seem like it's an unwieldily uphill climb? It would be great to have a development environment where we can deliver apps on webOS and Tizen at the same time, but it seems like this project hasn't been updated in almost a year, and there's a lot of frustration, uncertainty, and shifting standards about delivering samsung tizen solutions.

@rdobda-gaia I would suggest that you take a look on a different approach (just what we did)
Here is our setup:

  • React native
  • Webpack (configured for multi platform builds including: tizen (partial orsay), webos, android, ios, tvos, android-tv, playstation, xbox/uwp, electron apps)
  • React native for uwp and for web. (You can take a look on the react-native-web package, but i would not suggest it for webos and tizen, there is a lot of classes and it's not feature complete)
  • Customised react reconciler (for specific platforms).

Just pop your questions if need any ;)

@rdobda-gaia
Copy link

rdobda-gaia commented Feb 1, 2019

@fourscience that sounds wonderful, especially to cover so many platforms with one react-based solution. Do you have any starter projects or 'hello world' type apps with this setup to share with the community? I see this as a possible alternative: https://github.com/pavjacko/react-native-vanilla

@fourscience
Copy link

fourscience commented Feb 1, 2019

@fourscience that sounds wonderful, especially to cover so many platforms with one react-based solution. Do you have any starter projects or 'hello world' type apps with this setup to share with the community?

@rdobda-gaia
No sorry, we have only a POC, and going open source is not on developers at the moment :) that would require a huge commitment. But for the start you can take off with react native:

  • just make sure that you setup a proper webpack config before (eg, we have a platforms folder, with all platform, ios contains the pods etc, regarding ios build, android grudle same, tvos just like ios, android tv just like android :) with some tweaks ofc, webos and tizen can be the same, put the webpack configs there (have a basic one, and extend that) with custom resolvers (eg imports will load index.js, but if we build tizen, and we have an index.tizen.js we will use that) so this will make sure that we are building from the correct platform

just for example:

index.tizen.js in the root folder.

import React from 'react'
import ReactDOM from 'react-dom'
import App from './src/app'
import registerServiceWorker from './src/registerServiceWorker'

ReactDOM.render(React.createElement(App), document.getElementById('root'))
registerServiceWorker()

index.webos.js is the same :)
then you get import App from './src/app' (the common source)

in the src/app/ dir we can have compontents/button/index.js and index.tizen.js and index.webos.js
so it will always load the platform that we want, or the default as a fallback (note: the resolved index.tizen.js can import the index.js or it can overwrite it)

and like an example for the build structure:

~/index.js
~/index.tizen.js
..
~/webpack.common.js
~/platforms/tizen (has all the stuff what we need for tizen eg: .sign folder, config.xml a basic wgt sample and the webpack.config.js
~/platforms/webos (has all the stuff for webos eg: appinfo.json etc)

so from here, you can add any platforms, even react native tizen, react native uwp etc...
you will have a common imported source :) a build process which can be customised for platforms

I hope this helps to start, later on of course you can go deeper, for low end devices i would suggest a custom reconciler. you can event push that one with the build process and tailor it for the platforms.

a side note: keeping this much of platforms in the same codebase with sanity can be tricky, so before you really do an app with a setup like this, consider how to approach it (like magic remote on lg, touch on smartphones, keyboard on web, remotes for devices, analog controllers for ps4 etc) and how do you wanna separate it etc :)

just pop me a message if you have any specific questions. I'll try to answer it

@ali-sao
Copy link

ali-sao commented Feb 7, 2019

React native web seems to be a handy as I am experimenting with react-native-vanilla , the sad thing is when you try to make a useful app , where navigation for instance is required.

I tried react-navigation >3.x to support web navigation , and neither webOS nor Tizen TVs is working now.

I believe a single source for native and web TV apps are terrible idea , keep React-TV the way it is will keep it appealing as is

@gautamkrishnar
Copy link

gautamkrishnar commented May 14, 2019

Anyone still working on this?. Do reacttv supports tizen tv platform now.
cc: @raphamorim @rabeeshm

@rdobda-gaia
Copy link

rdobda-gaia commented May 14, 2019

We ended up going with a pure react with webpack solution. Tizen supports html5/javascript solutions out of the box, and webpack "compiles" down to that solution. It's not native, but works fine and is cross-platform because other tv platforms also support html5/javascript

@ironprogrammer
Copy link

We ended up going with a pure react with webpack solution. Tizen supports html5/javascript solutions out of the box, and webpack "compiles" down to that solution. It's not native, but works fine and is cross-platform because other tv platforms also support html5/javascript

@rdobda-gaia I'm also working on a React+Webpack solution, but when I package and sign the yarn build output, the CSS loads, but not the JS. I'm not a certified solution partner, so don't have the ability to debug directly on the TV, so was hoping you might have some tips. Thanks!

@fourscience
Copy link

@ironprogrammer you don't need to be a partner to debug on the device, feel fre to create a cert with your info and debug, on the other hand some priviliges might not be allowed.

otherwise you can use sdb to push the wgt to the device

@ironprogrammer
Copy link

ironprogrammer commented Aug 16, 2019

@fourscience I have a Samsung dev cert set up, but I get a mysterious closed error when trying to use sdb from the command line, or through the device manager. Tizen forums indicated this error was due to partner status, but is there something else I'm missing then?

FYI, I'm connecting to a Samsung PMF-BC, and using https://github.com/ppsirius/tizen-boilerplate to package the app, since the Tizen Studio hangs when packaging the React app. Thanks for the help!

@fourscience
Copy link

@ironprogrammer

closed can indicate a lot of things, most of the time there is a specific code in the logs.

probably its either a version mismatch or something along the setup, otherwise studio uses sdb to install the app, dont forget to set the cert, enable dev mode on the device and permit it to install apps if needed, feel free to write me a mail about this ;)

@ironprogrammer
Copy link

@fourscience I couldn't find your email, so I opened a gist to move the convo out of this thread. Really appreciate your help!

@iepsen
Copy link

iepsen commented Aug 22, 2019

@ironprogrammer have you uploaded your cert to device?

@ironprogrammer
Copy link

@iepsen Via Device Manager, yes. I can connect to the TV, select "Permit to install applications", and receive a "Succeeded to upload a certificate" response.

@fourscience
Copy link

@iepsen Via Device Manager, yes. I can connect to the TV, select "Permit to install applications", and receive a "Succeeded to upload a certificate" response.

mail me at: eisenmaxx@gmail.com

@iepsen
Copy link

iepsen commented Aug 22, 2019

Can you share the device model, tizen version, Tizen Studio? And do you know the tv extension version?

Please paste your config.xml here if you can.

@iepsen
Copy link

iepsen commented Aug 30, 2019

@ironprogrammer have you fixed it?

@ahmadfreijeh
Copy link

ahmadfreijeh commented Jul 1, 2021

Any updates is Tizen will be supported soon?

@devnullpointer
Copy link

This seems moot as samsung have their own react-native library now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet