Chrome Apps 以及HTML5 ?! 新世界


一切從這一篇開始 http://developer.chrome.com/apps/about_apps

Chrome Apps deliver an experience as capable as a native app, but as safe as a web page. Just like web apps, Chrome Apps are written in HTML5, JavaScript, and CSS. But Chrome Apps look and behave like native apps, and they have native-like capabilities that are much more powerful than those available to web apps.


Chrome Apps 就是用網頁語言單是想要做成像原生的App一樣,如果是網頁開發者應該很容易上手,因為語言相同,同樣的一份Code,可以用Chrome Browser直接打開網址,也可以藉由Chrome App的擴充功能(Extension)打開,也可以在Chrome Book(Chrome OS )上打開。



上圖顯示的是用Browser直接打開 localhost的 Hello World 以及載入extension 後開啟的小視窗版Hello World。

Hello World的程式碼 
https://github.com/GoogleChrome/chrome-app-samples/tree/master/hello-world

Chrome Apps 的基本,就是要可以local 處理

Chrome Apps get the following for free:
    • Your app’s files—all of its JavaScript, CSS, and fonts, plus other resources it needs (such as images)—are already downloaded.
    • Your app can save and optionally sync small amounts of data using the Chrome Storage API.
    • Your app can detect changes in connectivity by listening for online and offline events.
一定要確保自己可以local,以下是一些建議:


  • Use local data whenever possible.
When using resources from the internet, use XMLHttpRequest to get it, and then save the data locally. You can use the Chrome Storage API, IndexedDB, or Filesystem API to save data locally.
  • Separate your app’s UI from its data.
Separating the UI and data not only improves your app's design and eases the task of enabling offline usage, but also lets you provide other views of the user's data. An MVC framework can help you keep the UI and data separate.
  • Assume your app can be closed at any time.
Save application state (both locally and remotely, when possible) so that users can pick up wherever they left off.
  • Test your app thoroughly.
Make sure your app works well in both common and tricky scenarios.


相關文章:

留言

搜尋

本月熱門文章

日本旅行 去東京可以在哪邊買羽球相關用品?WEMBLEY/WINDSOR/梭家/Victoria/Alpen TOKYO/

水電行介紹---台北市萬華區環河南路一段216號的光成水電材料行---我在修繕業的叢聚市場

什麼是 OTA ?

新鮮人找工作:職場名詞解釋 AE FAE Pre-sales Post-sales

水電行介紹---台北市南港區研究院路二段30號的志興水電行---是水電行也是水電材料行

水電行介紹---台北市松山區延吉街的廣泰水電行—在地經營水電行,來電預約跨區跑也OK啦~

水電行介紹---臺北市信義區大道路36號的廣福水電行-----在地14年的水電行,廚具、水電、水電材料找我就對了~

網紅控遭NONO「載到暗處伸手摸」!怒受害者不只1人「被拖到廁所侵害」

水電行介紹---臺北市大同區歸綏路197號1樓的新雅水電行---32歲的在地水電行。

廚具水電行—呼叫臺北市內湖區民權東路6段56巷1弄2號的永輝水電衛浴廚具行 –有廚浴, 衛浴展示空間喔!

Agoda

熱門文章

[社會觀察] 一生順遂與命途乖舛

中華民國2024 總統、副總統選舉公告發布 連署參選門檻28萬9667人 可以推薦候選人的政黨包括民進黨、國民黨、民眾黨和時力

關於中國:202X年

[HMD Global] Nokia 2020 新手機發布 首款 5G 手機 Nokia 8.3 預計夏季開賣 !

[FAANG面試] 如何準備Google Technical Program Manager (TPM) 面試

[音樂] 霖霖 新單曲:給你了

[表特][Passion Sisters] 中信兄弟PS女孩 浮誇甜心 凱蒂 炸裂全場~ 小許瑋甯

[棒球] 2023 台灣大賽G5 威能帝13K飆破紀錄 猿3轟搶聽牌優勢