# TenTime TV Project documentation :
## Prerequisites:
1. [Install Git for Mac command-line interface](http://git-scm.com/download/mac)
2. [Installing node and npm](https://docs.npmjs.com/getting-started/installing-node) (install node.js, which comes with npm)
3. Android Studio
4. LG webOS CLI tools
5. Samsung Studio
`Recommended Node.js v14.17.1 & npm v6.14.13`
## Run Project:
1. clone project `git clone [repoUrl]`
2. inastall packages `npm install` (if there is any error in command try remove node_modules folder and package-lock.js file then try command agian)
3. Run `npm start`
4. Open your browser and go to [http://locahost:3000](http://localhost:3000)
```
$ npm start
...
[run:dev:server ] info: ==> 💻 Open http://localhost:3000 in a browser to view the app.
```
## Build Project :
The next command will generate a server + client application for production environment. It will be inside the `build` directory.
```
$ npm run build
```
The next command will generate a server + client application for Development environment. It will be inside the `build` directory.
```
$ npm run build:dev
```
## Run Project In LG Emulator:
### Prerequisites:
Installer download:
Please go to [this link (click here)](https://webostv.developer.lge.com/sdk/installation/download-installer/) and download Full Package Installer.
### Install Installer download:
[inastall steps](https://webostv.developer.lge.com/sdk/installation/download-installer/)
> don't inastall Oracle VM VirtualBox version 5.2.22 from installer download skip this step it will make error when try run the emulator on it, download this version 6.1.24 [from here](https://www.virtualbox.org/wiki/Downloads) and download VM VirtualBox Extension Pack from [same url](https://www.virtualbox.org/wiki/Downloads)
1. Screen 1: Accept the license agreement
2. Screen 2: Select the installation directory, view the components that will be installed, and click INSTALL.
### Setting Up the Virtual Machine in VirtualBox:
do same steps under this title `Setting Up the Virtual Machine in VirtualBox` in [this like](https://www.webosose.org/docs/tools/sdk/emulator/virtualbox-emulator/emulator-user-guide/#setting-up-the-virtual-machine-in-virtualbox)
### Packaging a Web App for Deploying:
1. open webOS TV CLI
2. go to project root directory
3. run this command `ares-package .\platforms\webos\tentime`
```
Create com.tentime.app_1.0.5_all.ipk to D:\projects\accedo_smarttv
Success
```
4. in the root folder new file created with `.ipk` extension
### Run Project In Emulator:
1. open webOS TV Emulator v6.0.0
2. from remote control click menu then app manager

3. click inastall and chosse file with `.ipk` extension from project root (wait few secoends to install app)
4. chosse app from installed apps and click LAUNCH and app will go from installed apps to running apps

---
## Run Project In Android Emulator:
### Prerequisites:
- install Android Studio [from here](https://developer.android.com/studio?gclid=CjwKCAjw9aiIBhA1EiwAJ_GTSumbi1fRaIAbYZw_0JpqFcHbXLAifD6icZW2Ed7nxV8IjSZ5GGXHWxoC7VsQAvD_BwE&gclsrc=aw.ds)
### Open Project In Android Studio:
* open project choose folder from project root .\platforms\android\tentime
### Build Generate Signed APK:
1. build menu >Generate Signed Bundle APK ... (panel open)
2. choose APK then next
3. put key store path, put key store password, key alias, and key password then next
4. choose release for build variants then signature versions check V1 and V2 then finish
5. apk will be created
6. add TV emulator for android studio and run the project on it

---
## Run Project In Tizen Emulator:
### Prerequisites:
- Tizen Studio with IDE installer from [here](https://developer.tizen.org/ko/development/tizen-studio/download?langredirect=1)
### Package Requierd:
install this packages from Package Manager


### Creating Certificates:
follow same steps from [here](https://developer.samsung.com/smarttv/develop/getting-started/setting-up-sdk/creating-certificates.html)
> when you reach the 8.2 step to get DUID (Unique Device ID) from emulator just open Emulator Manager and create TV emulator the DUID will auto complete and added in strp 8.2 if not open Device Manager then will show you there is decice connected right click and choose DUID cope it and put it in step 8.2
> when you reach the 8.2 step don't choose public level privilege change it to Partner level
### Building the Project:
run this two command :
```
tizen build-web -- .\platforms\tizen\widgets\tentime\
tizen package -t wgt -s [-s, --sign <security profile>] -- .\platforms\tizen\widgets\tentime\.buildResult\
```
### Run project:
- open file created from building project with extension `.wgt` Tizen Studio
- right click in project in project explorer > Run As > Tizen Web Application
