jQuery Mobile part 2
Gary
2014/1/8
Outline
• jQuery Mobile and JavaScript
• Document Event
• Configuration
• Method and Utility
• Theme
• App Package
Document Event
• Unlike other jQuery projects, such as jQuery and jQuery UI, jQuery
Mobile automatically applies many markup enhancements as soon as
it loads
• The sequence of document event
• mobileinit
• ready
• load
<script src="jquery.js"></script>
<script>
$(document).bind('mobileinit', function(){
$.mobile.ajaxEnabled=false;
});
</script>
<script src="jquery-mobile.js"></script>
Configuration
• Global
• UI
• AJAX
• Regionalization
• Touch overflow
• Page
• Page loading
• Widget
Configuration - UI
• activeBtnClass string, default: "ui-btn-active"
• The CSS class used for "active" button state.
• activePageClass string, default: "ui-page-active"
• The CSS class used for the page currently in view or in a transition.
• minScrollBack integer, default: 250
• Minimum scroll distance that will be remembered when returning to a page.
• defaultDialogTransition string, default: 'pop'
• Set the default transition for dialog changes that use Ajax. Set to 'none' for no
transitions.
Configuration - AJAX
• When jQuery Mobile attempts to load an external page, the request
runs through $.mobile.loadPage(). This will only allow cross-domain
requests if $.mobile.allowCrossDomainPages is set to true.
• jQuery Mobile framework tracks what page is being viewed within the
browser's location hash, it is possible for a cross-site scripting (XSS)
attack to occur if the XSS code in question can manipulate the hash
and set it to a cross-domain URL of its choice. This is the main reason
that the default setting for $.mobile.allowCrossDomainPages is set to
false.
Configuration - Regionalization
• Hard-coded
//Global String
$.mobile.loadingMessage = “loading”;
$.mobile.pageLoadErrorMessage = “Error Loading Page”
//Widget String
$.mobile.page.prototype.options.backBtnText = “Back”;
$.mobile.dialog.prototype.options.closeBtnText = “Close”;
//Global String
$.mobile.loadingMessage = “cargando”;
$.mobile.pageLoadErrorMessage = “Error Cargando Página”
//Widget String
$.mobile.page.prototype.options.backBtnText = “Atrás”;
$.mobile.dialog.prototype.options.closeBtnText = “Cerrar”;
Deprecated
$( document ).bind( 'mobileinit', function(){
$.mobile.loader.prototype.options.text = "loading";
$.mobile.loader.prototype.options.textVisible = false;
$.mobile.loader.prototype.options.theme = "a";
$.mobile.loader.prototype.options.html = "";
});
Configuration– Touch Overflow
• A feature called touchOverflowEnabled
is designed to leverage the upcoming
wave of browsers that support overflow
scrolling in CSS.
Page
Header
Footer
Content
<head>
<body>
<script>
$(document).bind("mobileinit", function(){
$.mobile.touchOverflowEnabled = true;
});
</script>
Deprecated
Scrolling area
Configuration - Page
• Configuration of page
• Configuration of loading page
• Whenever loading external pages using AJAX, some default attributes are
applied
• Change loading page attributes once, not every time
$(document).bind(‘mobileinit’, function(){
$.mobile.page.prototype.options.addbackbtn = true;
$.mobile.page.prototype.options.backBtnTheme = “e”;
$.mobile.page.prototype.options.headerTheme = “b”;
$.mobile.page.prototype.options.footerTheme = “d”;
});
$.mobile.loadPage.defaults
$.mobile.changePage
Configuration - Widgets
• Every widget in jQuery Mobile has its own default configuration
• We can modify the option objects of widget’s prototype
• Every widget supports theme default attributes
$(document).bind(‘mobileinit’, function(){
$.mobile.listview.prototype.filter = true;
$.mobile.selectmenu.prototype.nativeMenu = false;
});
Method and Utility
• Data-*
• Page
• Platform
• Path
• UI
Method and Utility – Data-*
• $.fn.jqmData(), $.fn.jqmRemoveData()
• When working with jQuery Mobile, jqmData and jqmRemoveData
should be used in place of jQuery core's data and removeData
methods , as they automatically incorporate getting and setting of
namespaced data attributes (even if no namespace is currently in use).
• In jQuery
• In jQuery Mobile
$("div[data-role='page']")
$("div:jqmData(role='page')") $("div[data-"+ $.mobile.ns +"role='page']")
Method and Utility – Page
• $.mobile.activePage()
• Reference to the page currently in view.
• $.mobile.changePage()
• Programmatically change from one page to another. This method is used
internally for the page loading and transitioning that occurs as a result of
clicking a link or submitting a form, when those features are enabled.
$.mobile.changePage(“external.html”);
$mobile.changePage($(“#pageId”));
Method and Utility – Page
• The second non-essential argument
$.mobile.changePage($(“#page2”), {
transition: “slide”,
reverse: true
});
<script>
function viewProduct(idProduct){
$.mobile.changePage(“productdetail.php”, {
method: “post”,
data: {
action: ‘getproduct’,
id: idProduct
},
transition: “fade”
});
}
</script>
Method and Utility – Platform
• The framework provides some platform utilities to web development
function clickbtn2(){
$gradeA2 = $.mobile.gradeA();
$getScreenHeight2 = $.mobile.getScreenHeight();
$getGradeA = $("#show").val("id");
$getGradeA.html($getScreenHeight2);
if ($gradeA2){
alert("it's true");
}
}
Method and Utility – Platform
• $.mobile.path.parseUrl()
• Utility method for parsing a URL and its relative variants into an object that makes accessing the
components of the URL easy. When parsing relative variants, the resulting object will contain empty
string values for missing components (like protocol, host, etc).
// Parsing the Url below results an object that is returned with the
// following properties:
// obj.href: http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234&type=unread#msg-content
// obj.hrefNoHash: http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234&type=unread
// obj.hrefNoSearch: http://jblas:password@mycompany.com:8080/mail/inbox
// obj.domain: http://jblas:password@mycompany.com:8080
// obj.protocol: http:
// obj.authority: jblas:password@mycompany.com:8080
// obj.username: jblas
// obj.password: password
// obj.host: mycompany.com:8080
// obj.hostname: mycompany.com
// obj.port: 8080
// obj.pathname: /mail/inbox
// obj.directory: /mail/
// obj.filename: inbox
// obj.search: ?msg=1234&type=unread
// obj.hash: #msg-content
var obj = $.mobile.path.parseUrl(http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234);
Method and Utility - UI
• $.mobile.silentScroll()
• Scroll to a particular Y position without triggering scroll event listeners.
• $.mobile.showPageLoadingMsg()
• Show the page loading message, which is configurable via $.mobile.loadingMessage
• $.mobile.hidePageLoadingMsg()
• Hide the page loading message, which is configurable via $.mobile.loadingMessage.
$.mobile.showPageLoadingMsg();
setTimeout(function() {
$.mobile.hidePageLoadingMsg();
}, 2000);
$.mobile.loading('show');
setTimeout(function() {
$.mobile.loading(‘hide');
}, 2000);
Deprecated
Theme
• The theming system used in jQuery Mobile is similar to the ThemeRoller system in
jQuery UI with a few important improvements:
• CSS3 properties
• rounded corners, box and text shadow and gradients
• lightweight and reducing server requests.
• Multiple color "swatches" — each consisting of
• a header bar, content body, and button states
• make richer designs possible.
• Open-ended theming
• 26 unique swatches per theme
• CSS3 gradients
• reduce file size and number of server requests.
• Simplified icon set
• reduce image weight.
Theme
• The easiest way to create custom themes is with the ThemeRoller tool.
It allows you to build a theme, then download a custom CSS file,
ready to be dropped into your project.
• If no theme swatch letter is set at all, the framework uses the "a"
swatch (black in the default theme) for headers and footers and the
"c" swatch (light gray in the default theme) for the page content to
maximize contrast between the both.
Theme
swatch color selector
Palette pane
Preview Pane
Theme
Theme
Theme
<link rel="stylesheet" href="css/themes/test.css" />
<link rel="stylesheet" href="css/themes/jquery.mobile.icons.min.css" />
…
<div data-role="page" id="pagetwo" data-theme="c">
App Package
• Native app
• Installed through an application store (such as Google Play or Apple’s App Store)
• Developed specifically for one platform
• Can take full advantage of all the device features
• Web app
• Not real apps
• Websites that, in many ways, look and feel like native applications.
• Run by a browser and typically written in HTML5
• Hybrid app
• Part native apps, part web apps.
• Live in an app store
• Rely on HTML being rendered in a browser
App Package – Native App
• Pros
• Be able to access all the features of the phone (GPS, camera, etc.)
• Better run speed, performance and overall user experience
• Support for offline work
• Rich graphics and animation
• Can be found easily at app store
• The app icons are shown on the screen
• Download an app need to pay
• Cons
• More limits (specific operating system)
• Unknown deployment time (app store approval process)
• Content Restrictions (app store restrictions)
• User must update manually
App Package – Web App
• Pros
• Wide range of devices (almost all smart phones)
• Low development costs
• Deploy quickly and easily
• No content restrictions
• Users always access to the latest version
• Cons
• Poorer performance and user experience
• Poor graphics and animation support
• Does not apply to the app store
• Have to connect with Internet
• Restrict some functions (GPS, camera, etc.)
App Package – Hybrid App
• Pros
• Support multi-platform access
• Phone functions are accessible
• Suitable for applications store
• Partial support offline
• Cons
• Unknown deployment time
• User experience is not as good as using native apps
• Not very mature technology
App Package
• Phonegap
• a free and open source framework that allows you to create mobile apps
using standardized web APIs for the platforms you care about.
• appMobi
• Cross platform push messaging, app promotion, in-app purchasing, integrated
analytics and more, for all applications and deployed in any environment.
App Package
• Need adobe or github account
App Package
App Package
• Run on Android phone
Conclusion
• PhoneGap is an HTML5 app platform that allows developers to author
native applications with web technologies and get access to APIs and
app stores.
• Applications are built as normal HTML pages and packaged up to run
as a native application within a UIWebView or WebView (a
chromeless browser).

More Related Content

PDF
jQuery Mobile: Progressive Enhancement with HTML5
PDF
Advanced JQuery Mobile tutorial with Phonegap
PPT
jQuery Mobile with HTML5
PDF
Quick Intro to JQuery and JQuery Mobile
PDF
amis-adf-enterprise-mobility
PDF
Android UI Development
PDF
Hastening React SSR - Web Performance San Diego
PPTX
Uniface Lectures Webinar - Building Responsive Applications with Uniface: Get...
jQuery Mobile: Progressive Enhancement with HTML5
Advanced JQuery Mobile tutorial with Phonegap
jQuery Mobile with HTML5
Quick Intro to JQuery and JQuery Mobile
amis-adf-enterprise-mobility
Android UI Development
Hastening React SSR - Web Performance San Diego
Uniface Lectures Webinar - Building Responsive Applications with Uniface: Get...

What's hot (20)

PPTX
Introduction to jquery mobile with Phonegap
PDF
Thinking in Components
PPTX
Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012
PDF
Responsive Web Site Design
PPTX
Uniface Lectures Webinar - Building Responsive Applications with Uniface: Dev...
PDF
Rich Portlet Development in uPortal
PDF
Modular applications with montage components
PDF
DrupalGap. How to create native application for mobile devices based on Drupa...
PPTX
SPSNH 2014 - The SharePoint & jQueryGuide
PDF
uMobile Preconference Seminar
PDF
Building iPad apps with Flex - 360Flex
PDF
OttawaJS: angular accessibility
KEY
Javascript Frameworks for Well Architected, Immersive Web Apps
PDF
Once Source to Rule Them All
PPTX
jQuery Mobile UI
PDF
Web Components v1
ZIP
Anex.......
PDF
Native look and feel bbui & alicejs
PPTX
Building rich Single Page Applications (SPAs) for desktop, mobile, and tablet...
Introduction to jquery mobile with Phonegap
Thinking in Components
Oracle Application Express & jQuery Mobile - OGh Apex Dag 2012
Responsive Web Site Design
Uniface Lectures Webinar - Building Responsive Applications with Uniface: Dev...
Rich Portlet Development in uPortal
Modular applications with montage components
DrupalGap. How to create native application for mobile devices based on Drupa...
SPSNH 2014 - The SharePoint & jQueryGuide
uMobile Preconference Seminar
Building iPad apps with Flex - 360Flex
OttawaJS: angular accessibility
Javascript Frameworks for Well Architected, Immersive Web Apps
Once Source to Rule Them All
jQuery Mobile UI
Web Components v1
Anex.......
Native look and feel bbui & alicejs
Building rich Single Page Applications (SPAs) for desktop, mobile, and tablet...
Ad

Viewers also liked (11)

PDF
JQuery mobile
PDF
Git Workflow
PDF
Linux Char Device Driver
PDF
Servlet and JSP
PDF
Database and Java Database Connectivity
PDF
Basic Understanding and Implement of Node.js
PDF
JQuery UI
PDF
Introduction of openGL
PDF
Run-time of Node.js : V8 JavaScript Engine
PPTX
Implementing a JavaScript Engine
PDF
Html5 canvas
JQuery mobile
Git Workflow
Linux Char Device Driver
Servlet and JSP
Database and Java Database Connectivity
Basic Understanding and Implement of Node.js
JQuery UI
Introduction of openGL
Run-time of Node.js : V8 JavaScript Engine
Implementing a JavaScript Engine
Html5 canvas
Ad

Similar to jQuery Mobile and JavaScript (20)

KEY
jQTouch – Mobile Web Apps with HTML, CSS and JavaScript
PDF
Anatomy of an HTML 5 mobile web app
PPTX
Jquery mobile
PDF
Pablo Villalba -
PDF
Mobile App Development
PPTX
Jquery mobile book review
PDF
Mat Marquis - JQuery Mobile
PPTX
Adobe & HTML5
PPTX
J query mobile tech talk
PDF
HTML5 and the dawn of rich mobile web applications pt 1
PDF
Web Application Development in 2023.pdf
PDF
Web Application Development- Best Practices in 2023.
PPTX
Mobile web development
PPTX
jQuery Mobile
PDF
The Mobile Web - HTML5 on mobile devices
PPTX
Mobile JS Frameworks
PPTX
Introduction to jQuery Mobile
PDF
Real World Lessons in jQuery Mobile
PPTX
Intro to Jquery Mobile
PDF
Mobile web apps
jQTouch – Mobile Web Apps with HTML, CSS and JavaScript
Anatomy of an HTML 5 mobile web app
Jquery mobile
Pablo Villalba -
Mobile App Development
Jquery mobile book review
Mat Marquis - JQuery Mobile
Adobe & HTML5
J query mobile tech talk
HTML5 and the dawn of rich mobile web applications pt 1
Web Application Development in 2023.pdf
Web Application Development- Best Practices in 2023.
Mobile web development
jQuery Mobile
The Mobile Web - HTML5 on mobile devices
Mobile JS Frameworks
Introduction to jQuery Mobile
Real World Lessons in jQuery Mobile
Intro to Jquery Mobile
Mobile web apps

Recently uploaded (20)

PPTX
Computer Software - Technology and Livelihood Education
PDF
DNT Brochure 2025 – ISV Solutions @ D365
PPTX
Tech Workshop Escape Room Tech Workshop
PPTX
4Seller: The All-in-One Multi-Channel E-Commerce Management Platform for Glob...
PDF
Type Class Derivation in Scala 3 - Jose Luis Pintado Barbero
DOCX
How to Use SharePoint as an ISO-Compliant Document Management System
PDF
MCP Security Tutorial - Beginner to Advanced
PDF
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
PDF
Topaz Photo AI Crack New Download (Latest 2025)
PDF
iTop VPN Crack Latest Version Full Key 2025
PDF
How Tridens DevSecOps Ensures Compliance, Security, and Agility
PDF
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
PDF
E-Commerce Website Development Companyin india
PDF
AI Guide for Business Growth - Arna Softech
PDF
Wondershare Recoverit Full Crack New Version (Latest 2025)
PDF
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
PPTX
CNN LeNet5 Architecture: Neural Networks
PDF
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
PPTX
Introduction to Windows Operating System
PPTX
Full-Stack Developer Courses That Actually Land You Jobs
Computer Software - Technology and Livelihood Education
DNT Brochure 2025 – ISV Solutions @ D365
Tech Workshop Escape Room Tech Workshop
4Seller: The All-in-One Multi-Channel E-Commerce Management Platform for Glob...
Type Class Derivation in Scala 3 - Jose Luis Pintado Barbero
How to Use SharePoint as an ISO-Compliant Document Management System
MCP Security Tutorial - Beginner to Advanced
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
Topaz Photo AI Crack New Download (Latest 2025)
iTop VPN Crack Latest Version Full Key 2025
How Tridens DevSecOps Ensures Compliance, Security, and Agility
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
E-Commerce Website Development Companyin india
AI Guide for Business Growth - Arna Softech
Wondershare Recoverit Full Crack New Version (Latest 2025)
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
CNN LeNet5 Architecture: Neural Networks
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
Introduction to Windows Operating System
Full-Stack Developer Courses That Actually Land You Jobs

jQuery Mobile and JavaScript

  • 1. jQuery Mobile part 2 Gary 2014/1/8
  • 2. Outline • jQuery Mobile and JavaScript • Document Event • Configuration • Method and Utility • Theme • App Package
  • 3. Document Event • Unlike other jQuery projects, such as jQuery and jQuery UI, jQuery Mobile automatically applies many markup enhancements as soon as it loads • The sequence of document event • mobileinit • ready • load <script src="jquery.js"></script> <script> $(document).bind('mobileinit', function(){ $.mobile.ajaxEnabled=false; }); </script> <script src="jquery-mobile.js"></script>
  • 4. Configuration • Global • UI • AJAX • Regionalization • Touch overflow • Page • Page loading • Widget
  • 5. Configuration - UI • activeBtnClass string, default: "ui-btn-active" • The CSS class used for "active" button state. • activePageClass string, default: "ui-page-active" • The CSS class used for the page currently in view or in a transition. • minScrollBack integer, default: 250 • Minimum scroll distance that will be remembered when returning to a page. • defaultDialogTransition string, default: 'pop' • Set the default transition for dialog changes that use Ajax. Set to 'none' for no transitions.
  • 6. Configuration - AJAX • When jQuery Mobile attempts to load an external page, the request runs through $.mobile.loadPage(). This will only allow cross-domain requests if $.mobile.allowCrossDomainPages is set to true. • jQuery Mobile framework tracks what page is being viewed within the browser's location hash, it is possible for a cross-site scripting (XSS) attack to occur if the XSS code in question can manipulate the hash and set it to a cross-domain URL of its choice. This is the main reason that the default setting for $.mobile.allowCrossDomainPages is set to false.
  • 7. Configuration - Regionalization • Hard-coded //Global String $.mobile.loadingMessage = “loading”; $.mobile.pageLoadErrorMessage = “Error Loading Page” //Widget String $.mobile.page.prototype.options.backBtnText = “Back”; $.mobile.dialog.prototype.options.closeBtnText = “Close”; //Global String $.mobile.loadingMessage = “cargando”; $.mobile.pageLoadErrorMessage = “Error Cargando Página” //Widget String $.mobile.page.prototype.options.backBtnText = “Atrás”; $.mobile.dialog.prototype.options.closeBtnText = “Cerrar”; Deprecated $( document ).bind( 'mobileinit', function(){ $.mobile.loader.prototype.options.text = "loading"; $.mobile.loader.prototype.options.textVisible = false; $.mobile.loader.prototype.options.theme = "a"; $.mobile.loader.prototype.options.html = ""; });
  • 8. Configuration– Touch Overflow • A feature called touchOverflowEnabled is designed to leverage the upcoming wave of browsers that support overflow scrolling in CSS. Page Header Footer Content <head> <body> <script> $(document).bind("mobileinit", function(){ $.mobile.touchOverflowEnabled = true; }); </script> Deprecated Scrolling area
  • 9. Configuration - Page • Configuration of page • Configuration of loading page • Whenever loading external pages using AJAX, some default attributes are applied • Change loading page attributes once, not every time $(document).bind(‘mobileinit’, function(){ $.mobile.page.prototype.options.addbackbtn = true; $.mobile.page.prototype.options.backBtnTheme = “e”; $.mobile.page.prototype.options.headerTheme = “b”; $.mobile.page.prototype.options.footerTheme = “d”; }); $.mobile.loadPage.defaults $.mobile.changePage
  • 10. Configuration - Widgets • Every widget in jQuery Mobile has its own default configuration • We can modify the option objects of widget’s prototype • Every widget supports theme default attributes $(document).bind(‘mobileinit’, function(){ $.mobile.listview.prototype.filter = true; $.mobile.selectmenu.prototype.nativeMenu = false; });
  • 11. Method and Utility • Data-* • Page • Platform • Path • UI
  • 12. Method and Utility – Data-* • $.fn.jqmData(), $.fn.jqmRemoveData() • When working with jQuery Mobile, jqmData and jqmRemoveData should be used in place of jQuery core's data and removeData methods , as they automatically incorporate getting and setting of namespaced data attributes (even if no namespace is currently in use). • In jQuery • In jQuery Mobile $("div[data-role='page']") $("div:jqmData(role='page')") $("div[data-"+ $.mobile.ns +"role='page']")
  • 13. Method and Utility – Page • $.mobile.activePage() • Reference to the page currently in view. • $.mobile.changePage() • Programmatically change from one page to another. This method is used internally for the page loading and transitioning that occurs as a result of clicking a link or submitting a form, when those features are enabled. $.mobile.changePage(“external.html”); $mobile.changePage($(“#pageId”));
  • 14. Method and Utility – Page • The second non-essential argument $.mobile.changePage($(“#page2”), { transition: “slide”, reverse: true }); <script> function viewProduct(idProduct){ $.mobile.changePage(“productdetail.php”, { method: “post”, data: { action: ‘getproduct’, id: idProduct }, transition: “fade” }); } </script>
  • 15. Method and Utility – Platform • The framework provides some platform utilities to web development function clickbtn2(){ $gradeA2 = $.mobile.gradeA(); $getScreenHeight2 = $.mobile.getScreenHeight(); $getGradeA = $("#show").val("id"); $getGradeA.html($getScreenHeight2); if ($gradeA2){ alert("it's true"); } }
  • 16. Method and Utility – Platform • $.mobile.path.parseUrl() • Utility method for parsing a URL and its relative variants into an object that makes accessing the components of the URL easy. When parsing relative variants, the resulting object will contain empty string values for missing components (like protocol, host, etc). // Parsing the Url below results an object that is returned with the // following properties: // obj.href: http://jblas:[email protected]:8080/mail/inbox?msg=1234&type=unread#msg-content // obj.hrefNoHash: http://jblas:[email protected]:8080/mail/inbox?msg=1234&type=unread // obj.hrefNoSearch: http://jblas:[email protected]:8080/mail/inbox // obj.domain: http://jblas:[email protected]:8080 // obj.protocol: http: // obj.authority: jblas:[email protected]:8080 // obj.username: jblas // obj.password: password // obj.host: mycompany.com:8080 // obj.hostname: mycompany.com // obj.port: 8080 // obj.pathname: /mail/inbox // obj.directory: /mail/ // obj.filename: inbox // obj.search: ?msg=1234&type=unread // obj.hash: #msg-content var obj = $.mobile.path.parseUrl(http://jblas:[email protected]:8080/mail/inbox?msg=1234);
  • 17. Method and Utility - UI • $.mobile.silentScroll() • Scroll to a particular Y position without triggering scroll event listeners. • $.mobile.showPageLoadingMsg() • Show the page loading message, which is configurable via $.mobile.loadingMessage • $.mobile.hidePageLoadingMsg() • Hide the page loading message, which is configurable via $.mobile.loadingMessage. $.mobile.showPageLoadingMsg(); setTimeout(function() { $.mobile.hidePageLoadingMsg(); }, 2000); $.mobile.loading('show'); setTimeout(function() { $.mobile.loading(‘hide'); }, 2000); Deprecated
  • 18. Theme • The theming system used in jQuery Mobile is similar to the ThemeRoller system in jQuery UI with a few important improvements: • CSS3 properties • rounded corners, box and text shadow and gradients • lightweight and reducing server requests. • Multiple color "swatches" — each consisting of • a header bar, content body, and button states • make richer designs possible. • Open-ended theming • 26 unique swatches per theme • CSS3 gradients • reduce file size and number of server requests. • Simplified icon set • reduce image weight.
  • 19. Theme • The easiest way to create custom themes is with the ThemeRoller tool. It allows you to build a theme, then download a custom CSS file, ready to be dropped into your project. • If no theme swatch letter is set at all, the framework uses the "a" swatch (black in the default theme) for headers and footers and the "c" swatch (light gray in the default theme) for the page content to maximize contrast between the both.
  • 21. Theme
  • 22. Theme
  • 23. Theme <link rel="stylesheet" href="css/themes/test.css" /> <link rel="stylesheet" href="css/themes/jquery.mobile.icons.min.css" /> … <div data-role="page" id="pagetwo" data-theme="c">
  • 24. App Package • Native app • Installed through an application store (such as Google Play or Apple’s App Store) • Developed specifically for one platform • Can take full advantage of all the device features • Web app • Not real apps • Websites that, in many ways, look and feel like native applications. • Run by a browser and typically written in HTML5 • Hybrid app • Part native apps, part web apps. • Live in an app store • Rely on HTML being rendered in a browser
  • 25. App Package – Native App • Pros • Be able to access all the features of the phone (GPS, camera, etc.) • Better run speed, performance and overall user experience • Support for offline work • Rich graphics and animation • Can be found easily at app store • The app icons are shown on the screen • Download an app need to pay • Cons • More limits (specific operating system) • Unknown deployment time (app store approval process) • Content Restrictions (app store restrictions) • User must update manually
  • 26. App Package – Web App • Pros • Wide range of devices (almost all smart phones) • Low development costs • Deploy quickly and easily • No content restrictions • Users always access to the latest version • Cons • Poorer performance and user experience • Poor graphics and animation support • Does not apply to the app store • Have to connect with Internet • Restrict some functions (GPS, camera, etc.)
  • 27. App Package – Hybrid App • Pros • Support multi-platform access • Phone functions are accessible • Suitable for applications store • Partial support offline • Cons • Unknown deployment time • User experience is not as good as using native apps • Not very mature technology
  • 28. App Package • Phonegap • a free and open source framework that allows you to create mobile apps using standardized web APIs for the platforms you care about. • appMobi • Cross platform push messaging, app promotion, in-app purchasing, integrated analytics and more, for all applications and deployed in any environment.
  • 29. App Package • Need adobe or github account
  • 31. App Package • Run on Android phone
  • 32. Conclusion • PhoneGap is an HTML5 app platform that allows developers to author native applications with web technologies and get access to APIs and app stores. • Applications are built as normal HTML pages and packaged up to run as a native application within a UIWebView or WebView (a chromeless browser).