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开 ...
随机推荐
- 算法笔记_128:完美洗牌算法(Java)
目录 1 问题描述 2 解决方案 2.1位置置换算法 2.2 走环算法 1 问题描述 有一个长度为2n的数组{a1,a2,a3,...,an,b1,b2,b3,...,bn},希望排序后变成{a1 ...
- 学习使用Jmeter做压力測试(一)--压力測试基本概念
一.性能測试的概念 性能測试是通过自己主动化的測试工具模拟多种正常峰值及异常负载条件来对系统的各项性能指标进行測试.负载測试和压力測试都属于性能測试,两者能够结合进行. 通过负载測试, ...
- 执行次数最多的sql语句
执行次数最多的sql语句 * FROM ( creation_time N'语句编译时间' ,DB_NAME(st.dbid) AS dbname ,OBJECT_NAME(st.objectid) ...
- [Swift A] - A Swift Tour
首先说下自己对Swift语言的一点点看法,对于一个写过javascript和常年写java代码的人来说,学习Swift是一件很简单的事情.就像某某人说过,每个人都有弱点和优点,我到目前为止,只是初步的 ...
- knockoutjs -- all built-in buildings
所有可用的binding值 文字和显示:visible, text, html, css, style, attr 流程控制:foreach, if, ifnot, with form字段:click ...
- 【linux】Linux查看各类日志
Log位置: /var/log/message 系统启动后的信息和错误日志,是Red Hat Linux中最常用的日志之一 /var/log/secure 与安全相关的日志信息 /var/log/ma ...
- openvpn mac客户端tunnelblick连接后自动添加路由
在openvpn 的服务器配置文件添加配置设置客户端连接后自动添加一条路由 示例: vim /etc/openvpn/server.conf # Push routes to the client t ...
- C#指南,重温基础,展望远方!(13)C#泛型
一.什么是泛型? 泛型是 2.0 版 C# 语言和公共语言运行库 (CLR) 中的一个非常重要的新功能. 我们在编程程序时,经常会遇到功能非常相似的模块,只是它们处理的数据不一样.但我们没有办法,只能 ...
- python 多线程 示例
import threading import Queue q = Queue.Queue() from test import * def worker1(x, y): #假设耗时 执行完毕 大于三 ...
- CentOS 6.4 yum安装chrome
CentOS 6.4安装chrome浏览器 vim /etc/yum.repos.d/CentOS-Base.repo 根据你的系统增加一个节点 32-bit [google] name=Google ...