MOBILE DEVELOPMENTWith jQuery Mobile & PhoneGap by Pete Freitag / Foundeo Inc... A touch optimized HTML5 Framework for building mobile websites and apps... jQuery Mobile is currently in
Trang 1MOBILE DEVELOPMENT
With jQuery Mobile & PhoneGap
by Pete Freitag / Foundeo Inc
petefreitag.com / foundeo.com
Trang 3A touch optimized HTML5
Framework for building mobile
websites and apps
Trang 4jQuery Mobile is currently in Alpha 2, so keep in mind that not all features are implemented
or stable at this time
Trang 5TOUCH OPTIMIZED?
like swipe, swipeleft, swiperight, orientationchange, tap,
taphold, etc
Trang 6MOBILE OS SUPPORT
Trang 7BUT I DON’T KNOW JQUERY
simple jQuery Mobile Web Site or App
comes time to add dynamic interactions
Trang 8WHAT’S IN JQUERY MOBILE?
Trang 9LET’S GET STARTED
<!doctype html>
< html >
< head >
< title >jQuery Mobile Example</ title >
< link rel ="stylesheet"
href ="jquery.mobile-1.0a2/jquery.mobile-1.0a2.css" />
< script src ="jquery-1.4.4.min.js"></ script >
< script src ="jquery.mobile-1.0a2/jquery.mobile-1.0a2.js"></ script > </ head >
3) jQuery Mobile JS
Trang 10associate an element with a widget For example:
Trang 11custom data storage associated with the element
do <div data-id=”#cat.id#”> </div> and it will still pass as valid HTML5
Trang 12linked together via a link to #pageElementID
Trang 13EXAMPLE PAGES
< div data-role =" page " id =" home " >
< div data-role =" header " >
< h1 > Home </ h1 >
< a href =" #settings " data-role =" button " >
Settings </ a >
</ div >
</ div >
< div data-role =" page " id =" settings " data-theme =" b " >
< div data-role =" header " >
Trang 14be controlled using the data-theme attribute
Trang 15button tag, an a tag, or input type=submit|button|reset|image
right, top or bottom by specifying data-iconpos or to just use the icon use data-iconpos=”notext”
Trang 16BUTTON ICONS
custom icons easily
Trang 17<ul data-role =" listview " data-theme =" c " >
<li><a href =" #about " > About Us </a></li>
<li><a href =" #settings " > Settings </a></li>
</ul>
More Advanced List View options available, see docs.
Trang 18WORKING WITH FORMS
data-role=”fieldcontain” attribute
< form >
< div data-role ="fieldcontain">
< label for ="slider">Slider:</ label >
< input type ="range" name ="slider" id ="slider" value ="0" min ="0" max ="100" /> </ div >
</ form >
Trang 19ALPHA LIMITATIONS
content dynamically
some bugs
Trang 20JQUERY MOBILE
jQuery Mobile
Trang 21www.phonegap.com
Trang 22WHAT IS PHONEGAP?
Blackberry, Symbian, and WebOS using HTML, CSS, and JavaScript
Trang 23accessing native device API’s such as:
• GPS
Trang 24PHONEGAP PLUGINS
be platform specific For Example:
Trang 25CREATING AN IOS APP
Template
Trang 26CREATING AN IOS APP
Trang 27CREATING AN IOS APP
Edit
index.html
Trang 28CREATING AN IOS APP
folder
Display Name
Trang 29IPHONE DEMO
Trang 30CREATING AN ANDROID APP
http://wiki.phonegap.com/w/page/30862722/phonegap-android-eclipse-quickstart
Trang 31ANDROID DEMO
Trang 32DEMO MILEAGEPAD.COM
ColdFusion Powered:
MileagePad.com
Trang 33Thank You!
petefreitag.com / foundeo.com