Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Sencha Touch

From Wikipedia, the free encyclopedia
JavaScript framework
Sencha Touch
A Sencha Touch app with an iOS6 theme
DeveloperSencha
Final release
2.4.2 / June 15, 2015; 10 years ago (2015-06-15)
Written inJavaScript
Operating systemAndroid,iOS,BlackBerry,Kindle,Windows Phone,Tizen
Available inEnglish
TypeJavaScript library
LicenseGPLv3 orCommercial
Websitewww.sencha.com/products/touch

Sencha Touch is auser interface (UI)JavaScript library, orweb framework, specifically built for theMobile Web. It can be used byWeb developers to develop user interfaces for mobileweb applications that look and feel likenative applications on supported mobile devices. It is based onweb standards such asHTML5,CSS3 andJavaScript. The goal of Sencha Touch is to facilitate quick and easy development of HTML5 based mobile apps which run onAndroid,iOS,Windows,Tizen andBlackBerry devices, simultaneously allowing a native look and feel to the apps.

Version history and support

[edit]

Sencha Touch is a product of Sencha, which was formed after popular JavaScript library projectsExt JS,jQTouch andRaphaël were combined. The first release of Sencha Touch, version 0.90 beta, was made available on July 17, 2010. This beta release supported devices running Android, and iOS (oniPhone,iPod Touch,iPad).

Subsequently, the first stable version, 1.0, was released in November 2010. Version 1.1.0 added support for devices runningBlackBerry OS 6.0.

The latest release, Sencha Touch 2.4.2, was released in June 2015[1] and is designed to run on the following browsers and platforms:

There are no announced plans to supportFirefox Mobile.

Features

[edit]

MVC Architecture

[edit]

Sencha Touch follows theMVC pattern which separates the application data, the control code and view. This separation allows large scale applications to be flexible and easy to maintain.

Widget components and customisable themes

[edit]

Sencha Touch has an inbuiltDOM manipulation interface which negates the dependency on otherUI frameworks like jQuery. It includes a set ofgraphical user interface GUI-basedcontrols (or components) for use within mobile web applications. These components are optimized for touch input. The components are:[2]

  • Buttons with device specific themes and effects
  • Form elements such as text fields for email
  • Date picker and address
  • Sliders, selectors, and combo-boxes
  • A list component with momentum-scrolling and an index bar
  • A minimal icon set
  • Toolbars and menus
  • Movable tabs, bottom toolbars
  • A map component with support formulti-touch gestures such aspinch and zoom
  • Carousels

All the components can be themed according to the target device. This is done usingSass, a stylesheet language built over CSS. Some of the native-lookalike themes are Cupertino Classic (for iOS6.x and below), Cupertino (for iOS 7) and Mountain View (for Android).[3]

Transitions, animations and adaptive UI

[edit]

Sencha Touch has eight in-built transition effects including slide over or under the current element, pop, flip, and cube. It supports common touch gestures built fromtouch events, which areWeb standards but supported only byAndroid,iOS, and some touch enabled devices. These are tap, double tap, swipe, scroll, and pinch.

Since Sencha touch is HTML5 based, the layouts it offers are extremely adaptive in nature.

Charting

[edit]

Sencha Touch also supports charting components including pie charts, bar graphs, line series, etc. with explanatory legends. These components support interactivity like pinch and zoom. Just like the Grid components inExtJS, Sencha Touch offers TouchGrid functionality.[4]

Profiles

[edit]

Profiling in Sencha Touch allows you to create different profiles catering to different screen sizes. When the application is loaded, the framework determines the type of device, and its corresponding profile determines which components and functionality need to be swapped out, and the specific views and controllers that need to be invoked, saving the developer the task of creating a different application for each type of device.[5]

Basic application directory structure

[edit]

Sencha Touch applications have a basic file and directory structure as follows:[2][6]

Directory/FileDescription
appThe main directory that holds the app's models, views, controllers, stores and profiles
app.jsFile that holds the application's overall settings. References to all models, views, controllers, stores and profiles can be found here. Once these references are loaded, the main app launch function is called. This function loads the first view and hence can be considered as the first point of the application
index.htmlMainHTML file for the app. It may span many pages/screens for the mobile app
resourcesDirectory that holds all the images, CSS and any other external file that the app needs
app.jsonApp's configuration file
packager.jsonFile used to create native packages
ext-touch.jsThis is Sencha's JavaScript library (ext-touchdebug.js recommended during development phase)
ext-touch.cssThis is Sencha's CSS library

Developer tools and plugins

[edit]

Sencha Touch providesIDE plugins for ease of development. Benefits of these plugins includecode generation andauto-completion,code refactoring and ease of navigation to framework codebase and custom classes. Sencha Touch has plugins for popular IDEs likeJetBrains,Visual Studio andEclipse.

There is a visual app builder, Sencha Architect, for building cross platform HTML5 apps. It provides addiction features like theming andcommand line integration.[7]

Sample usage

[edit]

Sencha Touch makes it convenient to use a map in your application using the Ext.Map component.[8] The inclusion of "Google Maps API" JavaScript file is essential for theGoogleMapsAPI to work.[9]

<!DOCTYPE HTML><html><head><title>Touch Test</title><!-- Sencha Touch CSS --><linkrel="stylesheet"type="text/css"href="sencha-touch/resources/css/sencha-touch-debug.css"/><!-- Google Maps API --><scripttype="text/javascript"src="//maps.google.com/maps/api/js?sensor=true"></script><!-- Sencha Touch JavaScript code --><scripttype="text/javascript"src="sencha-touch/sencha-touch-debug.js"></script><!-- Application script --><scripttype="text/javascript">Ext.setup({onReady:function(){// create the root panelnewExt.Panel({fullscreen:true,items:[{xtype:"map"}]});}});</script></head><body></body></html>

Ext.setup() is the starting point to initialise the application, setting up the viewport and the event system.[10]

Comparison to native applications

[edit]

Sencha Touch supports PhoneGap[11] andApache Cordova APIs forAccelerometer, Camera, Compass,Geolocation, Capture,[12] InAppBrowser, Media, Notification,Splash Screen,Storage (SQLite), etc. which were previously accessible only to native applications. Sencha Touch leverages JavaScript to create most of the UI components and change CSS ofDOM elements on the fly. WithJavaScript Engines being more efficient and faster than before, web apps run almost as smooth as native apps.

See also

[edit]

References

[edit]
  1. ^"Announcing Sencha Touch 2.4.2 with Improved BlackBerry 10.3 Experience".sencha.com. 15 June 2015.
  2. ^abAllen, Sarah; Graupera, Vidal; Lundrigan, Lee (2010).Pro Smartphone Cross-Platform Development. United States of America: APress. p. 226.ISBN 978-1-4302-2869-1.
  3. ^"Sencha Touch 2 Release Notes".cdn.sencha.com.
  4. ^"Announcing Sencha Touch 2.3 – Touch Grid, Cordova Support, and New Themes".sencha.com. 1 October 2013.
  5. ^Clark, John Earl; Johnson, Bryan P. (April 2013).Creating Mobile Apps with Sencha Touch 2. Birmingham UK: Packt Publishing. pp. 233, 234.ISBN 978-1-84951-890-1.
  6. ^"Touch Guides - Getting Started with Sencha Touch".docs.sencha.com.
  7. ^"Sencha Architect".sencha.com. 25 March 2015.
  8. ^"Touch - Sencha Docs".docs.sencha.com.
  9. ^"IBM Developer Works- Build mobile web applications with Sencha Touch".IBM.
  10. ^"Touch Guides - Events".docs.sencha.com.
  11. ^"Leveraging PhoneGap within Sencha Touch".phonegap.com.
  12. ^"Touch Guides - Using Native APIs".docs.sencha.com.

Bibliography

[edit]

External links

[edit]
.NET
C++
ColdFusion
Common Lisp
Haskell
Java
JavaScript
Back end
Server-side
Full-stack
Front end
Client-side
Perl
PHP
Python
Ruby
Rust
Scala
Smalltalk
Other languages
Retrieved from "https://en.wikipedia.org/w/index.php?title=Sencha_Touch&oldid=1265937793"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp