├── resources
├── tv.png
├── Tizen_Arch.jpg
├── lifecycle.jpeg
├── App_lifecycle.jpg
├── Install_on_TV.pdf
└── CertificateGuide.pdf
├── .gitignore
├── tizen-cli
└── cli.sh
└── README.md
/resources/tv.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/blimJS/Samsung-development-guide/HEAD/resources/tv.png
--------------------------------------------------------------------------------
/resources/Tizen_Arch.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/blimJS/Samsung-development-guide/HEAD/resources/Tizen_Arch.jpg
--------------------------------------------------------------------------------
/resources/lifecycle.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/blimJS/Samsung-development-guide/HEAD/resources/lifecycle.jpeg
--------------------------------------------------------------------------------
/resources/App_lifecycle.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/blimJS/Samsung-development-guide/HEAD/resources/App_lifecycle.jpg
--------------------------------------------------------------------------------
/resources/Install_on_TV.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/blimJS/Samsung-development-guide/HEAD/resources/Install_on_TV.pdf
--------------------------------------------------------------------------------
/resources/CertificateGuide.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/blimJS/Samsung-development-guide/HEAD/resources/CertificateGuide.pdf
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Application
2 | cache.properties
3 | /module/Core
4 |
5 | # IDE
6 | /nbproject/
7 | /.buildpath
8 | /.project
9 | /.settings/
10 | /.idea/
11 | /.buildpath
12 | /tags
13 | /tags.vendor
14 |
15 | # Thumbnail cache files
16 | ._*
17 | Thumbs.db
18 |
19 | # Folder configuration files
20 | .DS_Store
21 | Desktop.ini
22 |
23 | # Files that might appear on external disks
24 | .Spotlight-V100
25 | .Trashes
26 |
27 | # Other files
28 | .~lock.*
29 |
--------------------------------------------------------------------------------
/tizen-cli/cli.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | VERSION="0.1"
4 |
5 | #Change output color to green.
6 | setSuccessColor ()
7 | {
8 | tput setaf 2
9 | }
10 |
11 | #Change output color to default.
12 | resetColor ()
13 | {
14 | tput sgr0
15 | }
16 |
17 | #Print with colors, $1 color (green, yellow, red), $2 text to print.
18 | printText ()
19 | {
20 | case "$1" in
21 | green)
22 | tput setaf 2
23 | printf "$2"
24 | setSuccessColor
25 | ;;
26 |
27 | yellow)
28 | tput setaf 3
29 | printf "$2"
30 | setSuccessColor
31 | ;;
32 |
33 | red)
34 | tput setaf 1
35 | printf "$2"
36 | setSuccessColor
37 | ;;
38 | *)
39 | echo $"Usage: $1 {green|yellow|red} $2 {text to print}}"
40 | exit 1
41 | esac
42 | }
43 |
44 | case "$1" in
45 | clean)
46 | setSuccessColor
47 | tizen clean
48 | resetColor
49 | exit 0
50 | ;;
51 | help)
52 | tput setaf 3
53 | printText yellow "\n\nTIZEN BUILD SCRIPT v$VERSION\n\n
54 | Options:
55 | help => Show this help message
56 | clean => Cleans Tizen Project
57 |
58 | Requirements:
59 | 1- Install Tizen SDK with Tizen IDE
60 | 2- Create the project from one of the templates
61 | 3- Create a security profile (on IDE, option Certificate Profiles)
62 | 4- Register your devices (emulator, tv) on the distributor certificate\n
63 | Folders node_modules and src will be exluded from build by default.\n"
64 | resetColor
65 | exit 0
66 | ;;
67 | esac
68 |
69 |
70 | printText yellow "\n\nTIZEN BUILD SCRIPT v$VERSION\n\n"
71 | printf "Started at: `date`.\n"
72 |
73 | currentUsername=$(whoami)
74 | profileFile=~/workspace/.metadata/.plugins/org.tizen.common.sign/profiles.xml
75 |
76 | printText yellow "Setting up Tizen SDK path.\n"
77 | export PATH=$PATH:/Users/${currentUsername}/tizen-sdk/tools/ide/bin
78 | tizen version
79 |
80 | #Export CLI profile.
81 | if [ ! -f ${profileFile} ]; then
82 | printText red "Profile file was not found on ${profileFile}\nMake sure you installed the SDK and your workspace folder is located at \"/Users/{USERNAME}/workspace\".\n"
83 | printText red "Terminating\n"
84 | exit 2;
85 | else
86 | printText yellow "Setting global profile file found on: ${profileFile}\n"
87 | tizen cli-config -g default.profiles.path=${profileFile}
88 | printText yellow "Current global CLI values.\n"
89 | tizen cli-config -l
90 | fi
91 |
92 | #Build project
93 | if [ ! -d $(pwd)/node_modules ]; then
94 | printText yellow "Building project without node_modules folder.\n"
95 | #Build, add files to exclude here.
96 | tizen build-web -e .DS_Store package.json ${0##*/}
97 | else
98 | printText yellow "Building project with node_modules folder.\n"
99 | #Move node_modules and src folders to tmp, not no include it on package.
100 | mv $(pwd)/node_modules /tmp
101 | mv $(pwd)/src /tmp
102 |
103 | #Build, add files to exclude here.
104 | tizen build-web -e .DS_Store package.json ${0##*/}
105 |
106 | #Move node_modules and src folders back.
107 | mv /tmp/node_modules $(pwd)/node_modules
108 | mv /tmp/src $(pwd)/src
109 | fi
110 |
111 | #Attempt to get already created security-profile
112 | availableProfiles=$(tizen security-profiles list)
113 | lineNumber=0
114 | profileName=""
115 | currentProject="${PWD##*/}"
116 |
117 | while read -r line; do
118 | ((lineNumber++))
119 | if [ "$lineNumber" = "9" ]
120 | then
121 | profileName="$line"
122 | fi
123 | done <<< "$availableProfiles"
124 |
125 | if [ -z "$profileName" ]; then
126 | printText red "Could not get profile name needed to sign the application.\n"
127 | printText red "Terminating\n"
128 | exit 2
129 | else
130 | printText yellow "Using profile \"$profileName\" to sign the application.\n"
131 | fi
132 |
133 | printText yellow "Building application package.\n"
134 | tizen package --type wgt --sign "$profileName" -- $(pwd)/.buildResult
135 |
136 | printText yellow "Moving package to project folder ($(pwd)/${currentProject}.wgt).\n"
137 | mv .buildResult/${currentProject}.wgt $(pwd)
138 |
139 | printText yellow "\nFinished at: `date`.\n"
140 | resetColor
141 | exit 0
142 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Samsung Development Guide for Web Apps
2 |
3 | TV Apps are created as standard HTML5 apps. You can create your TV app using the TizenTV IDE ([Tizen SDK](https://developer.tizen.org/development/tools/download)), or any editor that you choose.
4 |
5 | Apps are usually created as SPA. You can use most frameworks and libraries used in web based application development including jQuery, Backbone, Angular, React, and others.
6 |
7 | TV apps are displayed on the TV fullscreen, without any browser controls. The window size will vary depending on the resolution of the TV. But typically this means you will only have to deal with 2 different sizes: [1920x1080 or 1280x720](https://www.samsungdforum.com/Tizen/Spec#GeneralFeatures).
8 |
9 | ###Essentials of Developing Tizen Web Application
10 |
11 | ####SDK
12 | To develop Tizen TV web apps, you need to install a SDK. You can download a SDK from Samsung Developer Forum site:
13 | [Tizen SDK Download](https://developer.tizen.org/development/tools/download)
14 |
15 | To use a GPU accelerator you should install Intel HAXM(Hardware Accelerated Execution), otherwise an emulator will not work properly. During installing a SDK, Intel HAXM should be installed automatically. In case of any errors you can install manually the following file: [HAXM](https://www.samsungdforum.com/guide_static/tizenoverviewguide/_downloads/IntelHaxmTizen_mac.zip).
16 |
17 | > The HAXM driver is automatically installed with the IDE, only install it if the emulator does not work.
18 |
19 | Emulator runs on a virtual machine (QEMU), none of these are supported (and the Emulator will complain/not work if they are running on the host computer):
20 | * Virtual Box
21 | * VMWare
22 | * Parallels(Mac PC)
23 | ####Generating Author Certificate
24 |
25 | All apps must be signed with an author certificate. It is used to identify an app developer and protect apps from mixing and misusing. It is registered by a SDK installed on each PC. The following is the guide of registering.
26 |
27 | _Follow this guide to generate the certificate:_
28 | [https://www.samsungdforum.com/TizenGuide/tizen3531/index.html](https://www.samsungdforum.com/TizenGuide/tizen3531/index.html)
29 |
30 | [Certificate Guide(PDF)](resources/CertificateGuide.pdf)
31 |
32 | After creating the author certificate, be careful not to lose it. This is the unique proof for certifying app developer. If you lose it, you can’t version up your app.
33 |
34 | ####UI/UX Requirements
35 | Samsung Smart TV provides a user experience that differs completely from that of other familiar devices, such as mobile devices and desktop computers.
36 |
37 | #####General Considerations:
38 | ![alt text][tv]
39 | [tv]: resources/tv.png "TV Use"
40 |
41 | * The average distance between a TV and its viewers is 3 meters (10ft).
42 | * The standard remote control is the main input method.
43 | * TV is used by more than one person.
44 | * Simplicity, Clarity, User Control, ConsistencyFeedback, Feedback and Aesthetic Considerations should be taken into consideration when developing the app.
45 |
46 | > [More on UI/UX Guidelines. ](https://www.samsungdforum.com/TizenUxGuide/)
47 |
48 | ####App Resolution
49 | On Samsung UHD TV, the standard of app resolution is 1920x1080px and the aspect ratio is 16:9. (In case of Samsung FHD TV, it is 1280x720px.) Even if the resolution is different from the standard, the aspect ratio should be kept. Only if you keep the ratio, whitespace and scrollbars will not appear on a screen when the app is scaled up or down.
50 |
51 | ####APIs
52 | Information about the APIs available [here](https://www.samsungdforum.com/TizenApiGuide/).
53 |
54 | ####Browser User-Agent String Format
55 |
56 | | Year | UA String |
57 | | :--: | :------- |
58 | | 2015 | Mozilla/5.0 (SMART-TV; Linux; Tizen 2.3) AppleWebkit/538.1 (KHTML, like Gecko) SamsungBrowser/1.0 TV Safari/538.1 |
59 | | 2014 | Mozilla/5.0 (SMART-TV; X11; Linux armv7l) AppleWebkit/537.42 (KHTML, like Gecko) Safari/537.42 |
60 | | 2013 | Mozilla/5.0 (SMART-TV;X11; Linux i686) AppleWebkit/535.20+ (KHTML, like Gecko) Version/5.0 Safari/535.20+ |
61 | | 2012 | Mozilla/5.0 (SMART-TV; X11; Linux i686) AppleWebKit/534.7 (KHTML, like Gecko) Version/5.0 Safari/534.7 |
62 | | 2011 | Mozilla/5.0 (SmartHub; SMART-TV; U; Linux/SmartTV) AppleWebKit/531.2 (KHTML, like Gecko) Web Browser/1.0 SmartTV Safari/531.2+ |
63 |
64 | @source: [https://github.com/ruiposse/smart-tv-app-dev-guidelines](https://github.com/ruiposse/smart-tv-app-dev-guidelines)
65 |
66 | @source: [http://developer.samsung.com/technical-doc/view.do?v=T000000203](http://developer.samsung.com/technical-doc/view.do?v=T000000203)
67 |
68 | ###App Development
69 |
70 | ####Registering Remote Controller Key
71 | An app should controlled by the _KeyCode_ of a remote controller. Only if you register the key to use, an app can receive the KeyCode.
72 |
73 | Key codes can be registered with the Tizen API as follows:
74 | ```javascript
75 | tizen.tvinputdevice.registerKey(KeyName);
76 | ```
77 |
78 | Getting supported keys:
79 | ```javascript
80 |
81 | var value = tizen.tvinputdevice.getSupportedKeys();
82 | console.log(value);
83 | ```
84 |
85 | Using key codes requires the following privilege on the config.xml file.
86 | ```xml
87 |
88 | ```
89 |
90 | > [More on TVInputDevice API.](https://www.samsungdforum.com/tizenapiguide/tizen3331/index.html)
91 |
92 | > [More on _privileges_.](https://www.samsungdforum.com/TizenGuide/tizen3431/index.html)
93 |
94 | ####APIs for VOD Service App
95 | 1. There are two ways to play VODs on an app. One way is using the video tag, which is an HTML5 standard element. And the other way is by using __webapis.avplay__ which is an API supported by Samsung Tizen TV. More details bellow:
96 |
97 | 1.1. __Video Tag__: Video tag makes VODs playing easy by a HTML5 standard element. If you can enough develop by using only it, we recommend using it rather than webapis.avplay
98 |
99 | 1.2. __webapis.avplay__: The following is the list to be difficult or not supported by video tag. When you use these technologies, you can use webapi.avplay.
100 |
101 | * DRM(Digital Rights Management)
102 | * HLS(HTTP Live Streaming)
103 | * DASH(Dynamic Adaptive Streaming over HTTP)
104 | * Smooth Streaming
105 | * Adaptive Streaming
106 | * 3D Contents, Closed Caption etc…
107 |
108 | > [AVPlay API Reference](https://www.samsungdforum.com/tizenapiguide/tizen3001/index.html)
109 |
110 | > [Sample Code](https://github.com/SamsungDForum/PlayerAVPlayDRM)
111 |
112 | > [Official Guide Overview PDF](https://www.samsungdforum.com/guide_static/tizenoverviewguide/_downloads/Essentials_of_Developing_Tizen_Web_Application_EN_1_4(1).pdf)
113 |
114 | ###AVPlay API
115 |
116 | ####AVPlay Object Lifecycle
117 |
118 | ![alt text][cycle]
119 | [cycle]: resources/lifecycle.jpeg "AVPlay Object Lifecycle"
120 |
121 | ####Adaptive Streaming
122 | AVPlay module of Samsung Tizen TV supports adaptive streaming playing. DASH, HLS, Smooth Streaming are supported in Samsung Tizen TV. It enables user to change bitrate during playback.
123 |
124 | The adaptive streaming engine needs to be specified when __open()__ API is called. Based on media file extension name, adaptive streaming engine is adjusted.
125 |
126 | __Smooth Streaming__
127 | .ism/Manifest
128 |
129 | __DASH__
130 | .xml
131 | .mpd
132 |
133 | __HLS__
134 | .m3u8
135 |
136 | __Widevine__
137 | .wvm
138 | .vob
139 |
140 | ####Example of object initialization (Call order is very important.)
141 |
142 | ```javascript
143 | videoPlay: function (url) {
144 | var listener = {
145 | onbufferingstart: function () {
146 | console.log("Buffering start.");
147 | },
148 | onbufferingprogress: function (percent) {
149 | console.log("Buffering progress data : " + percent);
150 | },
151 | onbufferingcomplete: function () {
152 | console.log("Buffering complete.");
153 | },
154 | oncurrentplaytime: function (currentTime) {
155 | console.log("Current playtime: " + currentTime);
156 | },
157 | onevent: function (eventType, eventData) {
158 | console.log("event type: " + eventType + ", data: " + eventData);
159 | },
160 | ondrmevent: function (drmEvent, drmData) {
161 | console.log("DRM callback: " + drmEvent + ", data: " + drmData);
162 | },
163 | onstreamcompleted: function () {
164 | console.log("Stream Completed");
165 | webapis.avplay.stop();
166 | },
167 | onerror: function (eventType) {
168 | console.log("event type error : " + eventType);
169 | }
170 | };
171 |
172 | webapis.avplay.open(url);
173 | webapis.avplay.setDisplayRect(0, 0, 1920, 1080);
174 | webapis.avplay.setListener(listener);
175 |
176 | var drmParam = {
177 | DeleteLicenseAfterUse : true
178 | };
179 |
180 | //drmParam.LicenseServer = "license server url to play content";
181 | //drmParam.CustomData = "Custom Data to play content";
182 | webapis.avplay.setDrm("PLAYREADY", "SetProperties", JSON.stringify(drmParam));
183 |
184 | webapis.avplay.prepare();
185 | webapis.avplay.play();
186 | }
187 | ```
188 |
189 | To adjust the properties of the streaming you can use __webapis.avplay.setStreamingProperty()__.
190 |
191 | ```javascript
192 | webapis.avplay.setStreamingProperty("ADAPTIVE_INFO", params);
193 | ```
194 |
195 | This method should be called only on "IDLE" state.
196 |
197 | To configure DRM playback, the method __webapis.avplay.setDrm()__ can be used.
198 |
199 | This method updates DRM information, such as SetProperties etc. It changes the DRM mode, and runs the Control Feature. Every DRM has difference between AVPlayDrmOperation and jsonParam.
200 |
201 | ```javascript
202 | var params = {
203 | LicenseServer: 'URL TO LICENSE SERVER',
204 | DeleteLicenseAfterUse: true
205 | };
206 |
207 | try {
208 | webapis.avplay.setDrm("PLAYREADY", "SetProperties", JSON.stringify(params));
209 | } catch (e) {
210 | //Error
211 | }
212 | ```
213 |
214 | This method should be called on these states - "IDLE" and "PAUSED".
215 |
216 |
217 | >[setStreamingProperty()](https://www.samsungdforum.com/TizenApiGuide/tizen3001/index.html#AVPlay-AVPlayManager-setStreamingProperty)
218 |
219 | >[AVPlay Official Guide](https://www.samsungdforum.com/TizenGuide/tizen3451/index.html)
220 |
221 | ###CLI Tizen SDK
222 |
223 | __Export SDK path__
224 | ```bash
225 | export PATH=$PATH:/Users/keiverh/tizen-sdk/tools/ide/bin
226 | ```
227 |
228 | __Setup global profile__
229 | ```bash
230 | tizen cli-config -g default.profiles.path=/Users/keiverh/workspace/.metadata/.plugins/org.tizen.common.sign/profiles.xml
231 | ```
232 |
233 | > This profile is created using the Tizen IDE. It identifies the developer and distributor certificate.
234 |
235 | __List platforms and templates__
236 | ```bash
237 | tizen list web-project
238 | ```
239 |
240 | __Create project__
241 | ```bash
242 | tizen create web-project -p tv-2.4 -t WebBasicapplication -n blimcli -- /Users/keiverh/workspace
243 | ```
244 |
245 | __Build package__
246 | ```bash
247 | tizen build-web -- ~/workspace/blimcli
248 | ```
249 |
250 | __Package app__
251 | ```bash
252 | tizen package --type wgt --sign dev -- /Users/keiverh/workspace/blimcli/.buildResult
253 | ```
254 |
255 | __Install package__
256 | ```bash
257 | tizen install --target emulator-26101 --name blimcli.wgt -- /Users/keiverh/workspace/blimcli/.buildResult
258 | ```
259 |
260 | > According to Samsung Development Forums, there is no SHELL access to the Emulator or regular TVs.
261 | >
262 | > [Samsung Forum Post](https://www.samsungdforum.com/SamsungDForum/ForumView/180241c0163b926c?forumID=761e4dd8743457be)
263 | >
264 | > [Stackoverflow Question](http://stackoverflow.com/questions/38308306/how-to-install-apps-on-samsung-tizen-tv-from-command-line)
265 |
266 | ___
267 | > ###Online Resources
268 | >- [App Structure](https://www.samsungdforum.com/TizenOverview#contents)
269 | >- [Platform Features](https://www.samsungdforum.com/Tizen/Spec#GeneralFeatures)
270 | >- [W3C/HTML5 API Reference](https://www.samsungdforum.com/TizenApiGuide/tizen851/index.html)
271 | >- [Setting Project Properties ](https://developer.tizen.org/ko/development/getting-started/web-application/application-development-process/setting-project-properties?langredirect=1#set_widget)
272 | >- [Examples on GitHub from Samsung](https://github.com/Samsung/TizenTVApps)
273 | >- [Examples on GitHub from SamsungDForum](https://github.com/SamsungDForum/)
274 | >- [APIs Reference](https://developer.tizen.org/development/api-references/web-application)
275 | >- [AVPlay Reference](https://www.samsungdforum.com/tizenapiguide/tizen3001/index.html)
276 | >- [Caph - Focus handling for Angular and jQuery](https://www.samsungdforum.com/AddLibrary/CaphSdkDownload)
277 | >- [App Distribution Guide](http://www.samsungdforum.com/Support/Distribution)
278 | >- [CLI Dev Tools](https://developer.tizen.org/development/tools/web-tools/command-line-interface)
279 | >- [Tizen Key Codes](https://www.samsungdforum.com/TizenGuide/tizen3551/index.html)
280 | >- [Developing for Tizen TV - Article](http://clearbridgemobile.com/lessons-learned-developing-for-tizen-tv/)
281 |
282 |
283 | ###Caph
284 |
285 | CAPH is a Web UI framework for TVs, it has these modules:
286 |
287 | - Key Navigation
288 | - Scrollable List and Grid
289 | - UI Components : Button, Radio Button, Toggle Button, Checkbox, Input, Dialog, Context Menu, Dropdown Menu
290 | - Touch feature : Pan, Tap and Double Tap. (from CAPH 3.1)
291 |
292 | Helps developers handle user input from four directional keys on the remote and maximizes the usage of the GPU, since TV devices generally have a far more powerful GPU than CPU.
293 |
294 | > Problems: It is not open source and only has versions for jQuery and Angular 1.x.
295 |
296 | [Caph Documentation](https://www.samsungdforum.com/caphdocs/)
297 |
298 | ###Privileges
299 |
300 | Privilege level defines access level for the APIs, based on their influence.
301 |
302 | There are 3 levels of privilege.
303 |
304 | 1. __public__ - Everyone can use public privilege, but be careful to use APIs, because these are security-sensitive.
305 |
306 | 2. __partner__ - Only authorized partners can use APIs.
307 |
308 | 3. __platform__ - Very security-sensitive. not permitted to Samsung Smart TV
309 |
310 | These privileges will be used when configuring the app on the config.xml file.
311 |
312 | #####Tizen Device API Privileges
313 |
314 | > Privileges which are not in this table are not used in Samsung Tizen Smart TV.
315 |
316 | |Privilege|Level|Description|
317 | |----------|:-------------:|------|
318 | |http://tizen.org/privilege/alarm | public |The application can set alarms and wake up the device at scheduled times.|
319 | |http://tizen.org/privilege/application.info | public |The application can retrieve information related to other applications.|
320 | |http://tizen.org/privilege/application.launch | public |The application can open other applications using the application ID or application control. |
321 | |http://tizen.org/privilege/appmanager.certificate | partner |The application can retrieve specified application certificates. |
322 | |http://tizen.org/privilege/appmanager.kill | partner |The application can close other applications. |
323 | |http://tizen.org/privilege/content.read | public |The application can read media content information. |
324 | |http://tizen.org/privilege/content.write | public |The application can create, update, and delete media content information. |
325 | |http://tizen.org/privilege/download | public |The application can manage HTTP downloads. |
326 | |http://tizen.org/privilege/filesystem.read | public |The application can read file systems. |
327 | |http://tizen.org/privilege/filesystem.write | public |The application can write to file systems. |
328 | |http://tizen.org/privilege/package.info | public |The application can retrieve information about installed packages. |
329 | |http://tizen.org/privilege/packagemanager.install | platform | The application can install or uninstall application packages. |
330 | |http://tizen.org/privilege/system | public |The application can read system information. |
331 | |http://tizen.org/privilege/systemmanager | partner |The application can read secure system information. |
332 | |http://tizen.org/privilege/tv.audio | public | The application can control TV audio. |
333 | |http://tizen.org/privilege/tv.channel | public |The application can control TV channel. |
334 | |http://tizen.org/privilege/tv.display | public |The application can control TV 3D mode. |
335 | |http://tizen.org/privilege/tv.inputdevice | public |The application can generate a key event from TV remote control. |
336 | |http://tizen.org/privilege/tv.window | public |The application can control TV window. (e.g. main windwos, PIP window) |
337 | |http://tizen.org/privilege/websetting | public |The application can change its Web application settings, including deleting cookies. |
338 | |http://tizen.org/privilege/datacontrol.consumer | public |Allows the application to access specific data exported by other applications. It is a privilege for a Web application sharing data with other applications. |
339 | |http://tizen.org/privilege/telephony | public |Allows the application to retrieve telephony information, such as the used network and SIM card, the IMEI, and the call statuses. This privilege is for a native application. |
340 | |http://tizen.org/privilege/led | public |Allows the application to switch LEDs on and off, such as the LED on the front of the device and the camera flash. This privilege is for a native application. |
341 | |http://tizen.org/privilege/keymanager | public |Allows the application to save keys, certificates, and data to, and retrieve and delete them from, a password-protected storage. This privilege is for a native application. |
342 |
343 |
344 | #####Samsung Product API Privileges
345 |
346 | > Privileges which are not in this table are not used in Samsung Tizen Smart TV.
347 |
348 | |Privilege|Level|Description|
349 | |----------|:-------------:|------|
350 | |http://developer.samsung.com/privilege/adstreamingfw | public |The application can use the Adstreaming framework feature. |
351 | |http://developer.samsung.com/privilege/allshare | public |The application can use the allshare feature. |
352 | |http://developer.samsung.com/privilege/avplay | public |The application can play multimedia. |
353 | |http://developer.samsung.com/privilege/drminfo | partner |The application can play DRM encrypted multimedia |
354 | |http://developer.samsung.com/privilege/network.public | public |The application can read network status and informations. |
355 | |http://developer.samsung.com/privilege/productinfo | public |The application can read device product related informations (e.g. DUID, model code) |
356 | |http://developer.samsung.com/privilege/widgetdata | public |The application can read/write widget's secured storage. |
357 | |http://developer.samsung.com/privilege/microphone | public |The application can use Microphone. |
358 | |http://developer.samsung.com/privilege/sso.partner | partner |The application can read SSO related informations. |
359 | |http://developer.samsung.com/privilege/drmplay | public |Allows the application to play the DRM contents. This privilege is for a Web application. |
360 | |http://developer.samsung.com/privilege/billing | public |Allows the application to use in-app purchase provided by Samsung Checkout on TV. |
361 |
362 | #####W3C/HTML5 API Privileges
363 |
364 | |Privilege|Level|Description|
365 | |----------|:-------------:|------|
366 | |http://tizen.org/privilege/internet | public |The application can access the Internet using the WebSocket,XMLHttpRequest Level 2, Server-Sent Events, HTML5 Application caches, and Cross-Origin Resource Sharing APIs. |
367 | |http://tizen.org/privilege/mediacapture | public | The application can manipulate streams from cameras and microphones using the getUserMedia API. |
368 | |http://tizen.org/privilege/unlimitedstorage | public |In the local domain, if this privilege is defined, permission is granted. Otherwise, pop-up user prompt is used. In the remote domain, pop-up user prompt is used. |
369 | |http://tizen.org/privilege/notification | public |The application can display simple notifications using the Web Notifications API. |
370 | |http://tizen.org/privilege/location | public |The application can access geographic locations using the GeolocationAPI. |
371 |
372 | #####Web Supplementary API Privileges
373 |
374 | |Privilege|Level|Description|
375 | |----------|:-------------:|------|
376 | |http://tizen.org/privilege/fullscreen | public |Allows the application to display in full-screen mode using the FullScreen API (Mozilla). |
377 |
378 | > [Privilege Reference](https://www.samsungdforum.com/TizenGuide/tizen3431/index.html)
379 |
380 | ###Application Configuration File
381 | Each application developed for Tizen will require a configuration file (config.xml) on the root path of the app.
382 |
383 | Example:
384 |
385 | ```xml
386 |
387 |
388 | *
389 |
390 |
391 | *
392 |
393 |
394 |
395 |
396 | blim
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 | ```
412 |
413 | This file will hold the basic information about the application, what privileges it needs and what features will have.
414 |
415 | Failing to add a required privilege will cause the app not to work or behave the way it is not suppose to.
416 |
417 | ###Architecture & Application Life Cycle
418 | ####Tizen Architecture
419 | ![alt text][arch]
420 | [arch]: resources/Tizen_Arch.jpg
421 | "Tizen Architecture"
422 |
423 | Samsung has created a customized wrapper over Tizen platform to facilitate development of Tizen TV apps. Tizen apps have a defined lifecycle which is handled by the Core component of Tizen Platform as shown in the Tizen Architecture above. Application Lifecycle can be visualized as shown below:
424 |
425 | ####Application Life Cycle
426 | ![alt text][alc]
427 | [alc]: resources/App_lifecycle.jpg "Application Life Cycle"
428 |
429 | When any app is launched then application main loop is created, which is responsible for all the app states.
430 |
431 | 1. __Ready__ means app has been launched by the user and main loop is created.
432 | 2. __Create__ means app has been initialized and an instance is created for use.
433 | 3. __Reset__ means app has re-launch request.
434 | 4. __Running__ means app is active on device and responding to all the events received.
435 | 5. __Pause__ means app has been suspended by hiding the application window. Upon resume app comes back in running state, and the previous scene is recovered. With the help of this feature Tizen provides multitasking in the devices.
436 | 6. __Resume__ means the suspended app has been resumed and the application window becomes visible.
437 | 7. __Terminated__ means after the execution of the main loop terminate the application.
438 |
439 | For more details refer to the [ App Lifecycle](https://developer.tizen.org/documentation/articles/application-fundamentals-developer-guide?langswitch=en#appLifeCycle) reference page.
440 | ##Development Notes
441 |
442 | ###The Emulator
443 | The Emulator is a virtual machine running Tizen TV OS. It is a bit slower than an actual TV. Create a new emulator image using the Emulator Manager which comes with the Tizen SDK.
444 |
445 | ###The Simulator
446 | The Simulator is a node app much faster than the Emulator, but with less supported functionalities. (Video playback, some key binding...)
447 |
448 | ###Debugging on the Emulator
449 | In order to debug an app running on the Emulator or an actual TV, the project needs to be launched form the official SDK, in case you want to debug an app from the TV, the TV needs to be on Developer Mode and configured to use your computer IP address.
450 |
451 | ###Tizen IDE and Minified Code
452 | When minifying your code and building the application package (.wgt => Which is just a zip file) the IDE takes a lot of time "validating" your code (with a simple app in React built with Webpack it takes like 12 minutes!), I have found no way to prevent this, so you'll have to endure the first build and after that every time you modify your build, just Run/Debug your app without rebuilding the package.
453 |
454 | [Developer Mode and App Install on TV (PDF)](resources/Install_on_TV.pdf)
455 |
--------------------------------------------------------------------------------