- Tip & Tech
- Code Snippet
- Tizen Projects
- Tip & Tech
- Code Snippet
- Tizen Projects
‘Visual Studio Code Extension for Tizen’ enables to develop Tizen .NET application using VS Code. This documentation discusses step by step guide to prepare development environment for Tizen .NET application using VS code and deploy a sample application.
Install Visual Studio Code on your system. System requirements:
Windows version: 7/10 (64 bit) Windows Installation Guide Link
Linux version: Ubuntu 14.04/16.04 (64 bit) Linux Installation Guide Link
MAC version: macOS 10.12 (Sierra) or later MAC Installation Guide Link
.NET Core SDK 2
.NET Core is a cross-platform .NET implementation for websites, servers, and console apps on Linux, Windows, and macOS. Download .NET Core SDK
Oracle Java 8 or Higher
Tizen Baseline SDK / Tizen Studio
Tizen Baseline SDK refers to a reduced collection of SDK Tools to develop Tizen application. This SDK includes C# CLI, Certificate Manager, Emulator Manager, Device Manager (Connection Explorer and Log Viewer). If Tizen-Studio IDE/Tizen Baseline SDK is not already installed on your system, no worries! VS Code Extension for Tizen will automatically install the baseline SDK.
Launch Visual Studio Code and tap on extension icon. Please make sure you have stable Internet Connectivity. In the Search bar type ‘Tizen’, then You would find Tizen.NET: Visual Studio Code Extension for Tizen, Click Install.
Figure 1: VS Code Extension for Tizen in Marketplace
The Extension will install required packages and dependencies. It would search your system for tizen-studio IDE or Tizen baseline SDK, If it finds one you would be asked “Do you want to use that SDK/IDE or not”. If you won’t have one, the extension pack would download Tizen Baseline SDK. Once all the necessary packages and plugins are installed and up-to-date, Visual Studio Code would notify confirmation message.
Create a workspace directory on your system and then create an Empty Project folder, Then right click on the Project Directory and Open with > Visual Studio Code.
You can also use Command Terminal to perform these tasks for you. Example Ubuntu Commands:
$ mkdir dotnet-workspace && cd dotnet-workspace /dotnet-workspace$ mkdir sampleApp /dotnet-workspace$ code ~/dotnet-workspaces/sampleApp
To run Tizen Commands on VS Code launch Command Palette from: (Ubuntu)
VS Code > ‘View’ Tab > Command Palette Or Using Hotkey (Shift + Ctrl + P)
Type Create to Search Tizen Create Project command and Press Enter.
Figure 2: Create Tizen Project Command
Choose your required Project Template:
- ElmSharp: ElmSharp is a simple C# wrapper of native EFL elementary which provides all the widget you need to build a full application.
- NUI: Natural User Interface (NUI) is a C# toolkit on top of the DALi (Dynamic Animation Library) graphics library, which is written in C++.
- .NET Standard Class Library: Create .NET Standard 2.0 Class Library.
Figure 3: Tizen .NET Project Template
Figure 4: ElmSharp Project Folder Structure Figure 5: NUI Project Folder Structure
Further reading: https://www.enlightenment.org/docs/start
NUI Project Template:
Further reading: https://developer.tizen.org/development/guides/.net-application/natural-user-interface
Class Library Structure:
Figure 6: Class Library Project Folder Structure
Launch Command Palette > Type Build to Search ‘Build a Tizen Project command’ and Press Enter.
According to your Project template type, Build output will be generated. For Tizen Natural UI project, ‘bin’ folder will be created and you would find a ‘.tpk’ file (Tizen Package) there. Same goes for ElmSharp Project template.
Figure 7: Build Output ElmSharp Figure 8: Build Output NUI
When Building a Class library, a ‘.dll’ file (Dynamic Link Library) will be generated. This Library becomes an asset which can be used in other projects to reduce rework.
Figure 9: Build Output Class Library
To Install and run Tizen .NET project you can use Tizen Emulators which comes with Baseline SDK. But Emulators are needed to be installed first via Tizen Package manager.
To Launch Tizen Package Manager:
Launch Command Palette > Type Package to Search ‘Launch Tizen Package Manager’ and Press Enter.
Figure 10: Tizen Package Manager
Install required packages according to your need.
To Launch Tizen Emulator Manager:
Launch Command Palette > Type Emulator to Search ‘Launch Tizen Emulator Manager’ and Press Enter.
Create and Launch your required Emulator. (Note: Tizen supports .NET Since 4.0)
Figure 11: Tizen Emulator Manager
Once the Emulator is launched or any real device is connected:
Launch Command Palette > Install a Tizen.NET Application on the Tizen Device.
Once Installation is Successful:
Launch Command Palette > Run a Tizen.NET Application on the Tizen Device.
Or you can also launch using the Emulator.
Figure 12: Tizen ElmSharp Sample Application
Figure 13: Tizen NUI Sample Application