[英]How do I build a create-react-app in Tizen?
我想使用 create-react-app 構建一個 Web 應用程序,然后將其與 Tizen 打包以制作一個適用於三星智能電視的應用程序。 我如何建立這樣的項目? 要創建我的 React 應用程序的 Tizen 項目,我應該構建、打包或添加什么? 如果有人能給我寫一個分步指南,我將非常非常感激。
我試圖在 Tizen 項目中創建一個反應應用程序。 它沒有用。 我嘗試構建我的 React 應用程序並將構建目錄復制到 Tizen 項目。 它沒有用。 我認為在 config.xml 中指向我的 react 應用程序中的 index.html 會產生一些結果。 但不是。 嘗試將文件從 react 應用程序增量添加到我的 Tizen 應用程序。 失敗。
這個三星電視的開發似乎有點困難。 幫助。 我是防火和絕望的。 謝謝。
Tizen Studio 在文件放置方面似乎有點奇怪。 試圖將config.xml
文件放在根目錄下,但指向./build/index.html
的位置似乎會混淆它。
我這樣做的方式是這樣的:
package.json
homepage
鍵設置為./
以便資產文件路徑是相對於index.html
而不是絕對生成的。yarn build
(或npm run build
)以生成./build
文件夾。./build
文件夾。 這需要在您輸入項目名稱的位置展開“更多屬性”,並取消選中默認位置(以便您可以瀏覽到./build
文件夾)。 對於與 Tizen 相關的所有其他內容,您應該能夠遵循 Tizen 文檔。icon.png
、 .settings
、 .project
、 config.xml
、 .tproject
)復制到 react 應用程序的./public
文件夾中,以便在每次構建后復制它們。 請注意,Tizen 點文件不會顯示在 Tizen Studio 中,您應該從將顯示它們的文件資源管理器中復制它們。 在 Tizen Studio 中,只有這個./build
文件夾會顯示為您項目的一部分,並且應該只用於運行build
/ debug
/ run
操作。 對 Tizen 應用程序配置等的任何更改都應在 react 應用程序的./public
文件夾中完成,否則它們將在每次構建后被覆蓋。Tizen Studio/Web/Editor/Javascript Editor
禁用驗證Tizen Studio/Web/Editor/Javascript Editor
。 啟用此功能后,在構建過程中驗證縮小代碼時構建會阻塞。附帶說明...對於使用遙控器進行導航,我使用了這個組件庫。 這是最容易實施的。
你可以試試https://renative.org/docs/platform-tizen
它基於 react native 生成 hello world 應用程序,其余的為您完成
您還將獲得: - 焦點管理 - 生成的導航示例 - 內置對字體、矢量圖形的支持 - 用於快速開發的熱模塊重新加載
按照安裝設置后,您只需在模擬器中運行它:
rnv run -p tizen
或者
rnv run -p tizen -d -t <TIZEN_TV_IP>
完成后,您可以查看./platformBuilds/..
文件夾以了解它們是如何協同工作的
這有點挑戰性,但你可以做到
請按照以下說明操作:
先決條件
設置:
創建項目
配置文件
<?xml version="1.0" encoding="UTF-8"?>
<content src="index.html"/>
<feature name="http://tizen.org/feature/screen.size.normal.1080.1920"/>
<icon src="icon.png"/>
<name>Testing</name>
<tizen:profile name="tv-samsung"/>
<tizen:privilege name="http://developer.samsung.com/privilege/network.public"/>
<tizen:privilege name="http://tizen.org/privilege/application.launch"/>
<tizen:privilege name="http://tizen.org/privilege/tv.inputdevice"/>
<tizen:privilege name="http://tizen.org/privilege/tv.display"/>
<tizen:privilege name="http://tizen.org/privilege/fullscreen"/>
<tizen:privilege name="http://tizen.org/privilege/internet"/>
<tizen:privilege name="http://tizen.org/privilege/volume.set"/>
<tizen:privilege name="http://developer.samsung.com/privilege/drmplay"/>
<tizen:privilege name="http://developer.samsung.com/privilege/productinfo"/>
<tizen:setting pointing-device-support='disable' />
<tizen:setting screen-orientation="landscape" context-menu="disable" background-support="enable" encryption="disable" install-location="auto" hwkey-event="enable"/>
索引.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0"
/>
<link rel="stylesheet" href="css/style.css" />
</head>
<body>
<script>
window.open("http://0.0.0.0:3000") <!-- Add your IP address ->
</script>
</body>
</html>
與真實設備配對
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.