Strobe平台初探
什么是Strobe开发平台
We build for the internet's multi-device renaissance.
Strobe成立于2010年6月,创始人之一是前苹果公司负责JavaScript框架的Charles Jolley,正是SproutCore的作者,该框架曾被用于苹果产品MobileMe,iWork.com,.Mac。后有另外两名技术社区界的大牛Yehuda Katz和Carl Lerche加入,Yehuda是Rails,jQuery和众多开源项目的核心成员和创始人,Carl也是Rails的核心开发人员(Mike曾在RubyConf 2010上海有幸听过Yehuda的精彩演讲)。目前公司已经获得A轮250万美金风投。
Strobe平台 利用HTML5,JavaScript,Rails等开发技术和框架,让开发,部署和管理基于浏览器,移动设备,Tablet等用户平台的App应用更为简单和方便。
申请帐号和下载Starter Kit
目前该项目还出于Beta邀请测试阶段,需要申请后才能获得注册帐号。 帐号注册后先下载SDK,目前提供了Windows和Mac两个版本:
- http://strobe-pkg.strobeapp.com/strobe-latest.exe
- http://strobe-pkg.strobeapp.com/strobe-latest.pkg
然后可以从Getting Started获得基于HTML5 Bolierplate的Starter Kit
创建第一个App
目前Strobe提供的开发包里面其实只有一个Strobe.js文件是用于编写代码的,目前这个JavaScript库也不复杂,有以下一些功能和方法的实现:
- Strobe.ajax(url, [settings])
- Strobe.isNativeApp
- Strobe.popup
- Cookies相关处理
- StrobeSocial封装了Twitter和Facebook两个Addon services
SDK中安装的strobe命令提供以下任务:
Zeus:starter-kit mike$ strobe --help Tasks: strobe applications # list all of your applications strobe config [KEY] [VALUE] # configure strobe strobe delete # delete a specific application strobe deploy # deploy your application to Strobe strobe deploys # manage deploys strobe help [TASK] # Describe available tasks or one specific task strobe login # register this computer with an existing Stro... strobe open # opens application in browser strobe preview # preview your application as it would show up... strobe register # registers a local application with an existi... strobe rollback # rollback application to a state from given d... strobe set # update the settings for the application strobe signup # signup for a new Strobe account strobe users # manage users strobe version # Prints the version information
目前先拿Starter Kit做例子,不再做额外的开发和修改,含有以下待部署的文件:
Zeus:starter-kit mike$ ll total 88 -rwxr-xr-x 1 mike staff 1356 Aug 23 18:04 404.html -rwxr-xr-x 1 mike staff 1032 Aug 23 18:04 apple-touch-icon-114x114-precomposed.png -rwxr-xr-x 1 mike staff 640 Aug 23 18:04 apple-touch-icon-57x57-precomposed.png -rwxr-xr-x 1 mike staff 747 Aug 23 18:04 apple-touch-icon-72x72-precomposed.png -rwxr-xr-x 1 mike staff 640 Aug 23 18:04 apple-touch-icon-precomposed.png -rwxr-xr-x 1 mike staff 640 Aug 23 18:04 apple-touch-icon.png -rwxr-xr-x 1 mike staff 799 Aug 23 18:04 crossdomain.xml drwxr-xr-x 3 mike staff 102 Aug 29 20:15 css -rwxr-xr-x 1 mike staff 1150 Aug 23 18:04 favicon.ico -rwxr-xr-x 1 mike staff 1647 Aug 23 18:04 humans.txt -rwxr-xr-x@ 1 mike staff 1541 Aug 25 16:55 index.html drwxr-xr-x 5 mike staff 170 Aug 29 20:16 js -rwxr-xr-x 1 mike staff 107 Aug 23 18:04 robots.txt drwxr-xr-x 3 mike staff 102 Sep 2 19:15 strobe
部署到多个平台(Web,iOS)
在Starter Kit的项目下面执行:
strobe deploy --production
开始部署项目到服务器,输入帐号密码,上传成功后会提示一个二级域名的访问路径,比如:
shutter-fce39fdd.strobeapp.com
这个地址就是最终部署的Web项目的访问地址,由于我们没有对项目部署进行配置,默认只有Web程序的部署。如果要部署成iOS和Android项目(目前只支持这三种),需要先设置项目属性。
访问https://home.strobeapp.com/ 进入您的项目,打开Platforms菜单可以分别设置三个平台的部署参数,iOS和Android的部署利用了PhoneGap项目

其他功能
后台Dashboard,提供项目部署记录和分析,协作情况,用户和权限管理,提供Web服务帮助促销

附加服务,集成Twitter,Facebook等Social接口,还有比较期待的未开放API-auth,push,persistence

总结
在移动App被业界无限看好的年代,HTML5作为后起之秀正在一步步被开发者所接受。一旦HTML5+Native Code的模式能被用于跨平台的开发,并且获得最终用户的青睐,像Strobe以及Sencha这样的开放平台无疑是开发者的福音。让我们期待更多的应用实例出现,挑战传统的时刻到了。