This article shows how to build a sample application using command line tools. The sample application uses Tizen Sockets Extension APIs and is based on the url2file cURL demo.
url2file cURL demo
Before you can build the sample application:
Install the Samsung Emscripten SDK as described in the WebAssembly overview.
Install either Tizen Studio or Tizen Studio with CLI (command line interface). See the Quick-start Guide for more information.
To build the sample application:
Download url2file.c.
Note You can also clone the whole repository from github.com.
You can also clone the whole repository from github.com.
Download CA certificates extracted from Mozilla:
curl -O https://curl.haxx.se/ca/cacert.pem
Compile the url2file.c demo:
emcc -o url2file.html -Os -s ENVIRONMENT_MAY_BE_TIZEN -s USE_CURL=1 --proxy-to-worker --preload-file cacert.pem url2file.c
-Os
-o url2file.html
-s ENVIRONMENT_MAY_BE_TIZEN
-s USE_CURL=1
--proxy-to-worker
main()
--preload-file cacert.pem
fopen(./cacert.pem)
-s USE_SSL=1
-s USE_CRYPTO=1
-s USE_ZLIB=1
Further information regarding the Samsung Emscripten SDK build options can be found in the Emscripten Compiler Frontend (emcc) documentation.
Download config.xml to the same directory where the demo was compiled.
Note This application needs the http://tizen.org/privilege/internet privilege. The content src attribute points to "url2file.html" instead of standard index.html, as this is what was generated by emcc.
http://tizen.org/privilege/internet
src
index.html
For more information regarding the config.xml file format, see Tizen Developers.
Sign and pack the application using the Tizen CLI interface:
tizen package -t wgt -s <YOUR_CERTIFICATE_PROFILE_NAME> -- .
For instructions on creating a certificate profile, see Creating Certificates.
For more information regarding the Tizen CLI interface, see Command Line Interface Commands.
Set your device into developer mode as described in Target Device.
Connect to the device using SDB:
sdb connect <TV_IP>
For the SDB command and its options, see Connecting Devices over Smart Development Bridge.
List the connected devices to determine the device number:
sdb devices
Sample output (the device number is 0):
List of devices attached 192.168.13.2:26101 device 0
Install the application on the device:
tizen install -n url2file.wgt -t 0
Note In the parameter-t 0, the value 0 is the device number from the sdb devices command output.
In the parameter-t 0, the value 0 is the device number from the sdb devices command output.
-t 0
0
Run the application on the device:
tizen run -p url2file00.curl -t 0