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.


相關文章:

留言

Google Search

推薦內容橫式

本月熱門文章

[FAANG面試] Amazon/AWS 領導力準則 14 Amazon Leadership Principles

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

PM到底在做什麼 ? Project Manager, Product Manager 以及 Program Manager的差別

蔣經國時代 1979年 美麗島事件 回顧

快速上手的ComfyUI與Stable Diffusion生成圖片的cheat sheet

柯文哲弊案:關於橘子

ComfyUI搭配各個Stable Diffusion模型版本的介紹、檔案名稱及相應的目錄結構。

許多深藍人士懷念的兩蔣時代

川普第二次擔任美國總統

Netflix 勁爆女子監獄 Orange is the New Black /OINTB 成立了 Poussey Washington Fund 這個基金將會幫助更生人及移民人權問題 !!

這個網誌中的熱門文章

Android應用開發豆知識:利用 adb 安裝 apk 到裝置上

Android 中文輸入法 官方版 ! Gboard - Google 鍵盤 開始支援注音輸入啦

Google Play 推薦Android app 誠徵App排行榜

北京故宮首訪,一窺清宮秘史 大玉兒 & 甄嬛

[家教][社會觀察] 建中教我的事 沒上建中被父母親折磨? 在建中到底是如何 ...

[FAANG面試] Amazon/AWS 領導力準則 14 Amazon Leadership Principles

Acer ICONIA Smart S300 更新後越來越好 Acer也有出手機?!

[品質控制] 什麼是Sanity test ? 軟體測試常見名詞整理 包含不同部門的測試人員負責範圍

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