1.2. HTML5 Overview Homework
1.2. HTML5 Overview Homework
By Akshay Prabhu
[email protected]
Building Applications on mobile
To build applications on
different mobile platforms we
would require knowledge of
objective c for ios, android sdk
for android platform or j2me.
http://www.sencha.com/products/touch/
Sencha Touch.js
SenchaTouch.css
In this HTML file, we would now link the necessary files from the Sencha Touch
library
<!DOCTYPE
. html>
<html>
<head>
<!-- <meta http-equiv="Content-Type" content="text/html; charset=us-
ascii" />-->
<title>Overlay</title>
</head>
</body>
</html>
Create the application JavaScript File:-
myapp.js the file where the actual code of the application would reside.
Ext.setup({
tabletStartupScreen:'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
icon: 'icon.png',
glossOnIcon: true,
onReady: function() {
// write your Sencha Code here
}
});
BUILDING MOBILE USER INTERFACES WITH SENCHA
TOUCH
Sencha Touch consists many ready to use components like
It also contains several ready to use icons which are stored in the form
There are several default themes that can be used in the web
Application and even the CSS is highly customizable
There are several extensions called as UX which can be included in
the Sencha library. For eg:-UX Touch Grid Panel.
Sencha Touch Components
Panels
It can contain an
array of different
Sencha
components
Ext.setup({
tabletStartupScreen: 'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
icon: 'icon.png',
glossOnIcon: true,
onReady: function() {
new Ext.Panel ({
fullscreen : true ,
items : [ ] ,
dockedItems : [ ]
});
}
});
Docked Items Example
• htmlEncode: If the variable contains ampersands, less than, greater than symbols or
quotes HTML escape them.
• date[(format)]: Transform the variable to a date format, if the format argument is omitted
uses the mask 'm/d/Y' .
Data Stores
Ext.regModel('Task',
{
For data-driven controls - such as fields: [
Lists and Trees, Sencha Touch {name: 'name', type: 'string'},
requires that you use their data model {name: 'description', type: 'string'}
abstraction. ]
})
]
)};
Step 2 Step 3
listPanel = new Ext.List({ wrapperpanel=new Ext.Panel({
id: 'disclosurelist',
store: storex, id:'wrapperpan',
grouped:'true', items:listPanel,
}); });
Other useful Sencha Components
var datePicker = new
Ext.DatePicker({
useTitles: true,
});
xtype:'button',
text:'Test',
handler:function(){
Ext.Msg.prompt('Welcome','Enter
First Name', Ext.emptyFn);
}
Prompt Box
Maps in Sencha Touch
Sencha Touch also provides the
Map class.
This class requires the Google
Map API, below is the example
to illustrate the same
new Ext.Panel({
fullscreen:true,
items:[
{
xtype: ’map’ ,
title: ’ Maps ’
}
]
});
Sencha Touch UX Extensions
In addition to the
existing Sencha
Components, there
are many extensions
available to the
existing library.
]
});
Touch Grid Panel(Continued)
var colModel = [{
header: "<span style='font-size:13px'>AppName</span>",
mapping: "AppName",
style: "text-align: center;"
}, { new Ext.ux.TouchGridPanel({
header: "<span style='font-size:13px'>Description</span>", store: store,
mapping: "Description", colModel: colModel,
style: "text-align: center;"
}, {
header: "<span style='font-size:13px'>Type</span>", });
mapping: "Type",
style: "text-align: center;"
}, {
header: "<span style='font-size:13px'>Download</span>",
mapping: "Download",
cls: "centered-cell",
}
];
Animations
Sencha Touch provides many animation schemes like:-
Slide
Pop
Fade
Cube
Flip
panel.
Sencha Touch Events
EventPanel.addListener({
In the example,
body:{ touch events
swipe:
are added to
function(){Ext.Msg.alert( "Title" , "swiped");},
tap: the body or
function(){Ext.Msg.alert( "Title" , "Tapped");} element
} section if the
panel.
});
Access to camera
Access to contacts
Access to accelerometer
native applications.
Components.
as far as possible
com/deploy/touch/
examples/kitchens
ink/
http://touchsolitair
e.mobi/app/
Learning Resources For Sencha
http://dev.sencha.com/deploy/touch/examples/kitchensink/
http://www.sencha.com/learn/Sencha_Touch
http://miamicoder.com/2010/creating-sencha-touch-toolbar-buttons/
http://www.sencha.com/learn/Tutorial:Sencha_Touch_Hello_World
Video Tutorials:-
http://vimeo.com/channels/sencha