Beruflich Dokumente
Kultur Dokumente
Introduction
Architect @ QuickOffice Author @ Apress Beginning PhoneGap Write articles for PhoneGap Wiki Technical Talks and Corporate Training
2
Topics
1. Short Intro to PhoneGap 2. Choosing the right UI Framework (jQueryMobile, Sencha or GWT) 3. Remote Debugging 4. Building in the Cloud 5. Extending PhoneGap 6. Capabilities like OAuth
3
Mobile Platforms
iOS Android BlackBerry WebOS Bada
5
Symbian
Win7
Modern Browsers
All new Smart Phones come with modern browsers, which have better support for HTML5/CSS3 specs
Browser Webkit based Webkit based Webkit based IE 7-9 based * Webkit based Webkit based
WebViews
All of these smart phones supports using these modern browsers as embedded views (aka WebViews)
WebView WebView
HTML/Javascrip t
JSON packets
9
iPhone App
Android App
BlackBerry App
WebOS App
11
PhoneGap API
File System
Compass
etc
11
Benefits of PhoneGap
OpenSource 6 Platforms Existing AJAX Developers task force Same UI across
Mobile App Mobile Web
14
15
17
18
19
PhoneGap Limitations
Background processing
e.g Running sync every 5 mins Putting notification for users
Notifications
In fact these limitations are quite common for cross platform frameworks.
20
21
The Contenders
jQueryMobile Sencha Touch Google Webtoolkit (GWT)
22
jQueryMobile Info
MIT or GPL License
Supports
23
jQueryMobile Info
24
jQueryMobile Demo
25
jQueryMobile basics
<!DOCTYPE html> <html> <head> <title>Page Title</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0b2/ jquery.mobile-1.0b2.min.css" /> <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.min.js"></script> <script type="text/javascript" src="http://code.jquery.com/mobile/1.0b2/ jquery.mobile-1.0b2.min.js"></script> </head> <body> </body> </html>
26
jQueryMobile basics
<body> <div data-role="page> <div data-role="header"> <h1>Single Page</h1> </div><!-- /header <div data-role="content"> <p>This is a Single Page.</p> </div><!-- /content <div data-role="footer"> <h4>Footer Content</h4> </div><!-- /footer --> </div><!-- /page --> </body>
27
jQueryMobile basics
28
jQueryMobile basics
29
jQueryMobile basics
30
jQueryMobile Demo
Let see the demo http://jquerymobile.com/demos/1.0b2/
31
32
Sencha Touch
33
Sencha Touch
35
36
37
Sencha basics
<!DOCTYPE html> <html> <head> <title>GeoTweets</title> <link rel="stylesheet" href="../../resources/css/sencha-touch.css" type="text/css> <script type="text/javascript" src="../../sencha-touch-debug.js"></script> <!-- Application JS --> <script type="text/javascript" src="src/index.js"></script> </head> <body> </body> </html>
38
Sencha basics
Ext.setup({ tabletStartupScreen: 'tablet_startup.png', phoneStartupScreen: 'phone_startup.png', icon: 'icon.png', glossOnIcon: false, onReady: function() { . } };
39
Sencha basics
var panel = new Ext.TabPanel({ fullscreen: true, cardSwitchAnimation: 'slide', items: [ map, timeline] });
40
Sencha basics
var timeline = new Ext.Component({ title: 'Timeline', cls: 'timeline', scroll: 'vertical', tpl: [ '<tpl for=".">', '<div class="tweet">', '<div class="avatar"><img src="{profile_image_url}" /></div>', '<div class="tweet-content">', '<h2>{from_user}</h2>', '<p>{text}</p>', '</div>', '</div>', '</tpl>' ]
41
Sencha basics
var refresh = function() { var coords = map.geo.coords; Ext.util.JSONP.request({ url: 'http://search.twitter.com/search.json', callbackKey: 'callback', params: { geocode: coords.latitude + ',' + coords.longitude + ',' + '5mi', rpp: 30 }, callback: function(data) { data = data.results; // Update the tweets in timeline timeline.update(data); } });
42
43
GWT basics
GWT allows developers to code in Java and compile to Javascript Used to build browser based apps
44
Use Overlays and JSNI to wrap PhoneGap JS APIs with GWT APIs
45
Comparison
Feature Mobile Support UI Concept Widget Support jQueryMobile Yes HTML based Minimum Sencha Yes Javascript based Good Support Excellent (mobile) Time consuming GWT Generic Java Widget based Good Support but non generic Excellent (both) Time consuming since integration with PhoneGap Excellent
47
Extensibility
Good
Comparison
Feature Ideal for jQueryMobile Smaller Simpler Apps No No Sencha For moderate to complex apps Yes Yes GWT Both desktop and mobile complex apps You can implement Not Required
48
49
50
52
http://debug.phonegap.com
53
54
Debugging Demo
55
Debugging Locally
Install Weinre locally http://phonegap.github.com/weinre/ Inject debug script Debug on locally installed Weinre
56
57
58
PhoneGap Beta
Build Service for Pure PhoneGap Applications Pure PhoneGap == No Extensions Build on PhoneGaps cloud Share Code with PhoneGap Share necessary certificates with PhoneGap
59
60
61
62
63
64
65
66
67
68
Extending PhoneGap
69
70
71
Plugin Architecture
72
73
74
75
Calling Part
76
77
Conclusion
PhoneGap Build is great way to improve CIT for pure PhoneGap apps PhoneGap Extensions are great way to build hybrid apps e.g FileShare PhoneGap great way to reduce cost and risk, but meant for a type of application
78
79
81
PhoneGap App
PhoneGap Framework
82
./ ://. p htt
success.html?key=ads23sfs
83
key = ads23sfs
PhoneGap App
PhoneGap Framework
84
key = ads23sfs
PhoneGap App
PhoneGap Framework
85
Q&A
Reachable @ rohitsghatol@gmail.com Twitter - rohitghatol
86
87
88