Sencha Touch快速入门(译)
翻译自:http://www.sencha.com/learn/sencha-touch-quick-start/
1、下载Sencha Touch SDK——下载链接
2、安装Safari或Chrome——IE不适合测试Sencha touch application,Sencha只在WebKit-based的浏览器或设备上运行。
3、安装测试服务器——虽然Sencha可以在客户端直接运行,但服务器端的功能更加齐全。
IIS或XAMPP等软件均可使用
4、解压Sencha Touch SDK
解压或拷贝Sencha到C:\xampp\htdocs目录下,并重命名为touch
现在可以进行测试了: http://localhost/touch
5. 安装Android SDK(可选)
如果想创建直接的AVD(Android Virtual Device),可以在本地机器上安装Android SDK
6. 在真实设备上测试代码(可选)
- 确保你的计算机没有运行任何防火墙软件,阻塞远程客户(remote client)访问你的web server.
- 运行DOS命令(cmd)ipconfig查询你的IP地址,用该IP地址代替localhost
这样你就能使用你的真实设备(手机)访问服务器了。
你可能会遇到如下安全问题:
解决方法:
打开C:\xampp\apache\conf\extra中的httpd-xampp.conf文件,在末尾找到
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
Order deny,allow
Deny from all
Allow from 127.0.0.0/8
ErrorDocument 403 /error/HTTP_XAMPP_FORBIDDEN.html.var
</LocationMatch>
修改为
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
Order deny,allow
Deny from all
Allow from all
ErrorDocument 403 /error/HTTP_XAMPP_FORBIDDEN.html.var
</LocationMatch>
停止并重启Apache,这时候就可以看到
7. 开始开发Sencha程序
你可以在 /touch/examples找到官方示例代码,
在GitHub上也有附有完整说明文档的示例,如:
- Teagrams: Joe McCann's 'first app', demonstrating how to pull simple data from Instagram in a tablet app. Try it now, and read the tutorial.
- CityBars: using Yelp data for cities' business listings. Try it now.
- Roookies: A simple, themable app that pulls images and data from the Dribbble service. Try it now, and read the tutorial.
- Mondrian: demonstrating how a single application can work on both phone and tablet devices.Try it now, and read the tutorial.
- World Data: using Touch Charts to display world economic data. Try it now.
- Offline apps: An app that demonstrates how to take resource and third-party data offline for the when the device is disconnected. Read the tutorial.
- PhoneGap Contacts: using device APIs to get access to device contact information. Read the tutorial.
8. 第一个Sencha Touch程序
- 在你的服务器文件夹中创建新文件夹myapp和子目录lib,拷贝SDK文件(即touch文件夹)到lib中
- 创建index.html
<!DOCTYPE html>
<html>
<head>
<title>Hello World</title>
<script src="lib/touch/sencha-touch.js" type="text/javascript"></script>
<script src="app/app.js" type="text/javascript"></script>
<link href="lib/touch/resources/css/sencha-touch.css" rel="stylesheet" type="text/css" />
</head>
<body></body>
</html> - 创建app文件夹,在该文件夹中创建app.js文件
new Ext.Application({
launch: function() {
new Ext.Panel({
fullscreen: true,
dockedItems: [{xtype:'toolbar', title:'My First App'}],
layout: 'fit',
styleHtmlContent: true,
html: '<h2>Hello World!</h2>I did it!'
});
}
});整个项目结构如下图
在浏览器或emulator中运行
帮助:
- Tutorials and FAQs in the sencha.com Learn Section.
- Online API Documentation, also available in the
/docs
URL of your local SDK.(你本地的SDK帮助文档) - Sencha Touch Forums - populated by our huge & helpful community.
Sencha Touch快速入门(译)的更多相关文章
- 【翻译】Sencha Touch 2入门:创建一个实用的天气应用程序之三
原文:Getting Started with Sencha Touch 2: Build a Weather Utility App (Part 3) 作者:Lee BoonstraLee is a ...
- Sencha touch 2 入门 -------- DataView 显示服务器端JSON文件数据
今天学习了下DataView如何显示JSON文件数据,废话不多说,直接贴代码: 首先看下文件目录: 然后看下我们要处理的JSON文件,bookInfo.json. { "success&qu ...
- 【翻译】使用Sencha Touch创建基于Tizen应用程序
原文:Building a Tizen App With Sencha Touch 作者:Gautam Agrawal Gautam Agrawal is Sencha's Sr. Product M ...
- sencha touch 入门学习资料大全(2015-12-30)
现在sencha touch已经更新到2.4.2版本了 重新整理一下资料 官方网站:http://www.sencha.com/products/touch/ 在线文档:http://docs.sen ...
- 【Win2D】【译】Win2D 快速入门
原文链接:http://microsoft.github.io/Win2D/html/QuickStart.htm 快速入门 这是 Win2D 的快速入门教程,将会介绍 Win2D 中的基本功能.你将 ...
- sencha touch 入门系列 扩展篇之sencha touch 项目打包压缩
经常有新手同学抱怨说sencha touch的项目加载速度为什么这么慢,经常要10秒左右的时间甚至更多, 大家都知道,sencha touch开发的项目中引用了大量的js文件,当我们打开项目时,st的 ...
- sencha touch 入门学习资料大全
现在sencha touch已经更新到2.3.1版本了 重新整理一下资料 官方网站:http://www.sencha.com/products/touch/ 在线文档:http://docs.sen ...
- AngularJS 30分钟快速入门【译】
引用自:http://www.revillweb.com/tutorials/angularjs-in-30-minutes-angularjs-tutorial/,翻译如下: 简介 我三年前开始使用 ...
- sencha touch 入门系列 (二)sencha touch 开发准备
这是本人第一次写博客教程,没什么经验,文笔也不是很好,写这教程一方面为了巩固自己这段时间的学习成果,一方面帮助大家解决问题,欢迎大家多提建议,指出问题.接下来我们就开始我们的sencha touch开 ...
随机推荐
- ssh登陆不上
用ssh key登陆不上某台机A的某个账号xy1,查看A的/var/log/messages,看到有这么句: User xy1 not allowed because account is locke ...
- 机器学习数学基础- gradient descent算法(上)
为什么要了解点数学基础 学习大数据分布式计算时多少会涉及到机器学习的算法,所以理解一些机器学习基础,有助于理解大数据分布式计算系统(比如spark)的设计.机器学习中一个常见的就是gradient d ...
- linux 下处理大文件
.head tail more .先把大文件进行分割 split split 参数: -a, --suffix-length=N 指定输出文件名的后缀,默认为2个 -b, --bytes=SIZE 指 ...
- javascript 创建对象的几种方式
1. //基于已有对象扩充其属性和方法var object = new Object(); object.name = "zhangsan"; object.sayName = f ...
- Cookie的介绍
Cookie是某些站点为了辨别用户身份而存在用户本地终端上的数据.Cookie总是保存在client中,可分为内存 Cookie和硬盘Cookie,而依照时间划分.又能够分为非持久Cookie和持久C ...
- 笔记本装ubuntu发热量大该如何缓解?
win7下的双卡技术是optimus, 驱动完善,不会让两个显卡同时满负荷工作, linux下由于驱动软件闭源, xorg的开源驱动没有做这个显卡电源管理, 目前的N卡较好解决方案就是bumblebe ...
- Redis总结(一)Redis安装(转载)
最近项目中需要使用Redis,刚好这两天有时间,便总结记录一下Redis的安装,以及如何在.NET中使用Redis. Redis是一个用的比较广泛的Key/Value的内存数据库.目前新浪微博.Git ...
- SectionIndexer中的getSectionForPosition()与getPositionForSection()解惑
大家在做字母索引的时候常常会用到SectionIndexer这个类,里面有2个重要的方法 1. getSectionForPosition()通过该项的位置,获得所在分类组的索引号 2. ge ...
- SQL Prompt几个快捷键
推荐一个小插件,SQL Prompt,配合Microsoft SQL Server Management Studio,使用起来非常方便,同时再加上以下几个快捷键: (1)ctrl+5或F5,运行代码 ...
- 修改host简化远程访问
问题描述: 使用本机登陆服务器时,需要经常输入IP地址,在局域网下和非局域网下输入的IP又不一样,十分麻烦,如果可以给IP命名一个简单的名字,岂不是很方便? 解决方法: 修改host文件: vim / ...