Cross platform-mobile-applications-final
Upcoming SlideShare
Loading in...5

Cross platform-mobile-applications-final






Total Views
Views on SlideShare
Embed Views



2 Embeds 231 230 1


Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

Cross platform-mobile-applications-final Cross platform-mobile-applications-final Presentation Transcript

  • Cross PlatformMobile ApplicationsBy Rohit GhatolContact me –
  • IntroductionRohit Ghatol• Project Manager @ Synerzip• Associate Architect @ QuickOffice Inc• GTUG Manager & Tech Next Founder• Certified Scrum Master• Corporate Trainer (Agile and Technical)• Was part of OpenSocial at Google 2
  • Topics• Overview• Understanding Mobile Apps• Cross Platform Mobile App Development • Pure HTML/JavaScript – PhoneGap • Interpreted JavaScript – Titanium Mobile• Native Mobile App Development• Hybrid Mobile App Development• Comparison between PhoneGap Vs Titanium• Conclusion• Q&A 3
  • OverviewThe process of developing Applications for various mobileplatform using common source code with little or no change tothe common source.This presentation focuses on Comparing two frameworks eachtaking a different approach to solve the above problem.We will Compare PhoneGap Vs Titanium . 4
  • Understanding Mobile Apps 5
  • Reaching Mobile Users 6
  • 1. Mobile Features Mostly Feature Sub Set Complete Feature Set 7
  • 2. Tablet Features Almost Complete Complete Feature Set Feature Set 8
  • 3. User InteractionTouch based Accelerometer Traditional Compass 9
  • e.g Layar Application 10
  • 4. Location aware Can be Location Aware but approximateLocation Aware and 11highly accurate
  • 5. Sensors Handy Camera and Voice Recording Upcoming NFC (Near Field Communication) 12 turning phone into Credit Card, Access Card, Business Card Exchanger
  • e.g Shopping ApplicationsScan a product’s barcode to know If not, then navigate to a store 13if it has the lowest price. which has the lowest price
  • 6. Push Notifications Push Notification Notifying the User proactively 14
  • Challenges in building Mobile Applications 15
  • 1. OS Fragmentation Windows 7 Fragmentation 16
  • 2. Multiple Teams/Product Windows 7 Multiple Teams/Products 17
  • 3. Uniform User Experience Windows 7 Uniform User Experience 18
  • 4. Feature Fragmentation 19 Feature Fragmentation
  • Approaches to Mobile Development 20
  • Types of Mobile App Dev1. Native Mobile Apps2. Cross Platform Mobile Apps3. Hybrid partly Native partly Cross Platform 21
  • Native Mobile Apps When To When Not To• High Performance Apps • Performance is not the main criteria• Heavy on OS and Device • More or less Replicates Features Web Apps with few device feature• Complex N/W comm. • Standard Restful• Canvas based Apps • Widget based apps• Only Few Platforms • Many Platforms 22
  • Cross Platform Mobile Apps When To When Not To• Performance is not the • High Performance Apps main criteria• More or less Replicates • Heavy on OS and Device Web Apps with few device Features feature • Complex N/W comm.• Standard Restful• Widget based apps • Canvas based Apps• Many Platforms • Only Few Platforms 23
  • Cross Platform Mobile Apps When To When Not To• Time to market is critical• Saving Cost is critical 24
  • Hybrid Mobile Apps When To Why To• Fairly Simple UI • Some parts of app are common • Rest parts are different• Complex Backend • Use Cross Platform to develop common part• Quite few platforms • Use Native to develop the weight lifting parts• E.g ShareFile• Recommended way - PhoneGap Plugin 25
  • Cross Platform Mobile App Development 26
  • Cross Platform Strategies Common Source Cross Platform Source Code Common Platform Mapping to Native WEB APPLICATION Bridge - JavaScript – Java – Objective C UI Platform APIs OS – Android / iPhone JavaScript – Java Bridge Mapping to Native OS – Android / iPhone Titanium Mobile PhoneGap 27
  • Common Platform Approach 28
  • Modern BrowsersAll new Smart Phones come with modern browsers, which have bettersupport for HTML5/CSS3 specsMobile OS BrowserAndroid Webkit basediPhone Webkit basedBlackBerry 6.0 + Webkit basedWindow Phone 7 IE 7 based *WebOS Webkit basedNokia Webkit based 29
  • WebViewsAll of these smart phones supports using these modernbrowsers as embedded views (aka WebViews) 30
  • JavaScript to native and backAll these browser engine (most common being webkit) supportJavascript to talk to native code and back HTML/Javascript Native Code (Java/C++/ObjC) JSON packets 31
  • Hybrid ApplicationsHTML/Javascript application loads Google Maps and talks to thenative code to gain access to GPS location HTML/Javascript Native Code (Java/C++/ObjC) GPS Location 32
  • Over all Architecture HTML5/CSS3 Application UI Framework e.g PhoneGap API jQueryMobile Phone Gap Bridge Camera GPS SQLite SQLite Accelerom Compass etc File System eter 33
  • Possibilities• Limitless Possibilities• Expose Camera, Accelerometer, GPS, any of the phones sensors to javascript• Instead of just building Browsed Based applications augment with more phone features 34
  • Development• HTML/CSS Application uses Common API exposing device features 35
  • Development• Sample code 36
  • Mapping to Native 37
  • Over all Architecture Javascript Based Application Titanium UI API Titanium Phone API Titanium Framework Window Dialog SQLite SQLite Accelerom Compass etc File System eter 38
  • Development• Two API Sets • One for UI * (Specific to Titanium Mobile) • Create Windows • Create Dialogs • ……. • One for Phone Features • Same as PhoneGap • Access Camera • Access GPS • …… 39
  • DevelopmentUI API Set 40
  • DevelopmentUI API Set 41
  • Issues• Common API set across platforms is always minimum • E.g IPhone as a widget, which Android not have• Fragmentation of the API itself. • What is platform specific and not part of Common API comes in Platform specific api? 42
  • Mobile App Dev Frameworks Common Platform Mapping to Native • PhoneGap • Titanium Mobile* Rhodes Mobile is another promising framework, but out of scope for today’s 43discussion
  • Compare Screens (IPhone) PhoneGap Titanium Mobile 44
  • Compare Screens (Android) PhoneGap Titanium Mobile 45
  • 46
  • PhoneGap• Only platform to support 6 Platforms 47
  • PhoneGap• Standards based and extended 48
  • PhoneGap Prerequistes• Need to be acquainted with Android, IOS, BlackBerry, WebOS• Need to be expert at HTML/Javascript or framework like GWT• Need to be acquainted with JavaScript libraries like • Jquery • • Prototype • Etc• Or Ajax framework like GWT• Need different project for each platform, inject PhoneGap code in each project• PhoneGap has no IDE, use Eclipse for Android and Xcode for IPhone 49
  • Demo Screens - IPhone 50
  • Demo Screens - Android 51
  • PhoneGap Features 52
  • Challenges and Advantages• HTML based UI is the biggest Challenge as well as Advantage• Same UI can be used for Web and Mobile and even Desktop• Promising Framework • GWT – Used by Spring Roo for Enterprise Application Development • jQueryMobile – Based on legendary Jquery and now features • Multipage Template • Page Slide Transitions • Dialogs • Toolbars • Forms 53 • Lists
  • Code Walkthrough - PhoneGap 54
  • Getting Started PhoneGapStep 1: Create Android Eclipse Project 55
  • Getting Started PhoneGapStep 2: Add Phone Gap Java Library 56
  • Getting Started PhoneGapStep 3: Add Phone Gap Javascript and with other web app files 57
  • Getting Started PhoneGapStep 4: Modify Main Activity class 58
  • Getting Started PhoneGapStep 5: Extend DriodGap instead of Activity 59
  • Getting Started PhoneGapStep 6: Write Javascript Code to create UI &use PhoneGap API 60
  • 61
  • PhoneGap on XCode 62
  • 63
  • jQueryMobile UI Development 64
  • jQuery Declarative UI<!-- Main Page --> <div data-role="page" id="home"> <!-- Header of Main Page --> <div data-role="header"> <h1>AlternativeTo Home</h1> </div> <!-- Content of Main Page --> <div data-role="content"> <p>Find Alternatives To Your favourite Softwares </p> <p><a href="#search" data-role="button">Search Alternatives</a></p> <p><a href="#recent" data-role="button">Recent Alternatives</a></p> </div> 65 </div>
  • jQuery Declarative UI 66
  • Extending PhoneGap to open more of underlying system 67
  • Phone Gap Extension Javascript Code Android Code• References - 68 Plugins• Author – Rohit Ghatol
  • Mobile 69
  • • Appcelerator Titanium SDK • Appcelerator Titanium SDK• Titanium Module SDK • Titanium Module SDK Paid Modules • Commerce Modules • Communication Modules • Analytics Module • Media Modules 70
  • Titanium Mobile Currently supports only Android and IPhone platforms. 71
  • Titanium Mobile Titanium JavaScript Interpreted By Wekit Mozilla Rhino JavascriptCore 72 IPhone Android
  • Titanium Architecture 73
  • Titanium Prerequistes• Need to be acquainted with Android, IOS programming• Need to know JavaScript• Use Titanium Mobile IDE to configure projects and use Text IDE to edit the code (unlike PhoneGap, there is only one project for all platforms) 74
  • Demo Screens - IPhone 75
  • Demo Screens - Android 76
  • Challenges and Advantages• Being Native is the biggest strength• Limited cross platform ui api is a weakness• Platform specific api leads to fragmentation within code 77
  • Code Walkthrough – Titanium Mobile 78
  • Titanium Developer• IDE for Titanium Mobile and Desktop• Allows Creating Titanium Project• Allows building Android and IPhone Applications• Does not provide any Source code Editor 79
  • Directory Structure 82
  • App.js (entry point)var tabGroup = Titanium.UI.createTabGroup();var win1 = Titanium.UI.createWindow({ title: Search, url: search.js});var tab1 = Titanium.UI.createTab({ window:win1, title:Search Alternatives’});tabGroup.addTab(tab1);tabGroup.addTab(tab2);;
  • search.js (building UI)var window = Titanium.UI.currentWindow;var search = Titanium.UI.createSearchBar({height:43, top:0});var actInd = Titanium.UI.createActivityIndicator({ height:50,});var tableview = Titanium.UI.createTableView({ top:50});window.add(search); 84window.add(tableview);
  • search.js (Ajax Call)var xhr = Titanium.Network.createHTTPClient();xhr.onload = function(){ actInd.hide(); var doc = xhr.responseText; var json = eval((+doc+)); var data = []; //…. Load data in data // provide the data to table to populate the table tableview.setData(data); 85};
  • search.js (Event handling)//send ajax request to fetch altrnatives for searchTextfunction searchAlternatives(searchText){,;xhr.send();}//start search when user hits enter on search boxsearch.addEventListener(return, function(e){; 86 searchAlternatives(e.value);});
  • Native Mobile App Development 87
  • Native App Development• Basically you need to hire experts who can • Build Android, IOS, BB, BlackBerry and Windows mobile apps • Devs should have experience to deploy apps on market • Devs should have experience on various devices • QA should know how to automate things on devices/emulator• Plan for risks if this is your companies first Mobile App deployment 88
  • Hybrid Mobile App Development 89
  • Hybrid App Development• Have Web Developers for Common UI• Have native code experts for heavy weight lifting• Use frameworks like PhoneGap Plugin Development framework to glue the above two pieces• Measure at every milestone to keep track of effect of changes• Use Automation to regress every layer 90
  • ShareFile Story• as 91
  • Comparison Titanium Mobile PhoneGap• Android and IPhone • 6 Platforms• Gives out native app • Gives out a mobile web app• API is more proprietary • API is less proprietary• UI has Limitations • UI possibilities are unlimited• UI will be fast• Much better User Experience • UI could be slow • User Experience will get• Portal Code can not be reused better with enhancements • Portal Code can be reused• Extensions are possible• Limited support for • Extensions are possible and HTML/Javascript 92 easy to implement More will come out of discussion, comments are welcome
  • Conclusion• Webkit is the next Virtual Machine.• Maybe Going where Java could not go• HTML 5, CSS 3 and Javascript is future,but not ready just yet• HTML 5, CSS3 and Javascript to lessen the fragmentation• HTML 5 will compete with native components 93
  • References• Phone Gap Documentation• Titanium Mobile Documentation• ShareFile Story 94