{"id":3360,"date":"2012-11-02T07:00:16","date_gmt":"2012-11-02T15:00:16","guid":{"rendered":"http:\/\/www.formtek.com\/blog\/?p=3360"},"modified":"2012-11-02T07:00:16","modified_gmt":"2012-11-02T15:00:16","slug":"mobile-development-using-phonegap-to-build-apps-that-run-in-any-mobile-environment-good-or-bad","status":"publish","type":"post","link":"https:\/\/formtek.com\/blog\/mobile-development-using-phonegap-to-build-apps-that-run-in-any-mobile-environment-good-or-bad\/","title":{"rendered":"Mobile Development: Using PhoneGap to Build Apps that Run in Any Mobile Environment &#8212; Good or Bad?"},"content":{"rendered":"<p><a title=\"PhoneGap homepage\" href=\"http:\/\/phonegap.com\/\" target=\"_blank\">PhoneGap <\/a>lets you write an HTML-based app that can be built and deployed in any of six different mobile ecosystems. \u00a0It\u00a0is a compelling idea. \u00a0It&#8217;s actually a bit like Sun Microsystems&#8217; slogan for Java applied to the mobile development landscape: <a title=\"Write Once, run Everywhere\" href=\"http:\/\/en.wikipedia.org\/wiki\/Write_once,_run_anywhere\" target=\"_blank\">Write Once, Run Everywhere<\/a>.<\/p>\n<p>Developing an application that can run across all major mobile platforms is no easy task. \u00a0For example, there are Apple iOS, Android, Blackberry, Windows Phone 7 and Symbian platforms to consider. \u00a0The development languages and environments used by each of these platforms is significantly different. \u00a0And that&#8217;s not to consider the form factor differences between devices, like phones and tablets. \u00a0Even on a single platform, there can be big differences in how the application needs to work across different product versions of the software OS and the hardware on which it runs. \u00a0It&#8217;s no wonder that most developers only have the resources to target development for iOS and\/or Android platforms for their applications.<\/p>\n<p>With PhoneGap, developers create their applications primarily by using standard HTML\/HTML5, CSS and Javascript. \u00a0PhoneGap provides hooks in Javascript that permit access to native device functionality, like geolocation,\u00a0\u00a0the camera, and the accelerometer. \u00a0PhoneGap applications basically run on the native browser for the mobile device, but they are packaged and made to appear to the user as native apps. \u00a0While the HTML and Javascript used is generally similar across all platforms, the PhoneGap application needs to be built and packaged separately within each of the target platform developer environments.<\/p>\n<p>Since PhoneGap doesn&#8217;t create a truly native application, developers that want to develop highly interactive games are recommended against using PhoneGap, but for other kinds of applications, like &#8216;Enterprise&#8217; applications which don&#8217;t use a lot of dynamic screens, PhoneGap apps may be a good choice. \u00a0More on that in a bit.<\/p>\n<p><a title=\"PhoneGap described on Wikipedia\" href=\"http:\/\/en.wikipedia.org\/wiki\/PhoneGap\" target=\"_blank\">PhoneGap<\/a> grew out of a <a title=\"iOSDevCamp 2008 and PhoneGap\" href=\"http:\/\/iphone.iusethis.com\/app\/gap\" target=\"_blank\">Hackathon <\/a>project called Gap\u00a0developed for iOSDevCamp held in San Francisco in 2008. \u00a0While the project didn&#8217;t win any awards at that event, the developers that created it were convinced that they were on to something. \u00a0 The company <a title=\"Nitobi\" href=\"http:\/\/www.crunchbase.com\/company\/nitobi-software\" target=\"_blank\">Nitobi <\/a>where the developers were from continued to support and develop PhoneGap after the hackathon event. \u00a0\u00a0IBM liked the idea and provided some support to the PhoneGap Open Source project. \u00a0And in October 2011, PhoneGap was bought by Adobe. \u00a0Around that same timeframe the source for PhoneGap was contributed to the Apache Software Foundation under the name\u00a0<a title=\"Apache Cordova\" href=\"http:\/\/incubator.apache.org\/cordova\/\" target=\"_blank\">Cordova<\/a>.<\/p>\n<p><a title=\"Who Uses PhoneGap?\" href=\"http:\/\/www.tricedesigns.com\/2012\/03\/27\/who-uses-phonegapapache-cordova\/\" target=\"_blank\">Who uses PhoneGap<\/a>? \u00a0Actually a fairly impressive list of companies are actively using PhoneGap\/Cordova. \u00a0The list includes Wikipedia and Salesforce. \u00a0 As owner of the project, Adobe markets and sells support for it. \u00a0IBM sells the product <a title=\"PhoneGap on IBM Worklight\" href=\"http:\/\/www-01.ibm.com\/software\/mobile-solutions\/worklight\/\" target=\"_blank\">Worklight <\/a>which is based on PhoneGap. \u00a0Mobile gamemaker Zynga has created apps based on PhoneGap. \u00a0Microsoft and Blackberry use PhoneGap and are supporters of PhoneGap because apps created with it can run not only on iOS and Android, but also on their platforms, and these apps will help them fill build out their war chests of available apps.<\/p>\n<p>But does PhoneGap really live up to the hype? \u00a0Mark Zuckerberg doesn&#8217;t think so, at least now. <a title=\"Facebook drops use of HTML5\" href=\"http:\/\/css.dzone.com\/articles\/who-uses-phonegapapache\" target=\"_blank\"> Facebook recently dropped<\/a> their efforts to build out mobile applications using a forked version of Cordova, and Zuckerberg commented that choosing HTML5 was their <a title=\"Facebook's Biggest Mistake -- Mark Zuckerberg\" href=\"http:\/\/www.theregister.co.uk\/2012\/09\/14\/facebook_html_5_vs_native_apps\/\" target=\"_blank\">&#8216;biggest mistake&#8217;<\/a>. \u00a0Facebook has since retreated to the path of native app mobile development.<\/p>\n<p>Part of the problem comes down to the fact that PhoneGap is really just a fake out. \u00a0It&#8217;s based on some clever engineering that enables communication between the browser application and the native-level features on the device. \u00a0The <a title=\"AgilIQ blog on PhoneGap messaging\" href=\"http:\/\/agiliq.com\/blog\/2012\/09\/dissecting-phonegaps-architecture\/\" target=\"_blank\">AgilIQ blog<\/a> has an interesting story where they dissected and analyzed exactly what goes on under the covers between a PhoneGap HTML app and the native device. \u00a0It&#8217;s not too pretty. \u00a0While the iOS communication stream isn&#8217;t too bad, the back and forth messaging that happens in the Android implementation creates a heavy overhead. \u00a0 These observations explain why there are frequent complaints about PhoneGap apps on Android being not too snappy.<\/p>\n<p>Daniel Pfeiffer <a title=\"Daniel Pfeiffer Reflow\" href=\"http:\/\/floatlearning.com\/2011\/06\/the-cost-of-reflows-on-a-web-app\/\" target=\"_blank\">noted that the &#8216;Reflow&#8217; of HTML<\/a> in the mobile browser is another area where many PhoneGap apps see performance hits. \u00a0Within a dynamic HTML app, there are frequently changes that are made to the HTML DOM. \u00a0Pfeiffer notes that mobile browsers are typically very slow at doing reflows which are the redraws of the entire page to reflect any new change in the DOM. \u00a0When dynamic changes happen, often consecutive calls will be made, one after the next, and each of those calls triggers a separate reflow.<\/p>\n<p>There are also differences in the look and feel between standard PhoneGap apps and native ones that may need to be worked around in order to make the app acceptable to end users.<\/p>\n<p>For example, PhoneGap HTML look and feel can create issues. \u00a0 Those issues have prompted PhoneGap developers to be creative. \u00a0For example, attempts have been made to develop CSS themes that mimic the look of a native app running on each of the different possible target platforms. \u00a0Often in order to get the theme you need to load up on another framework that supports the theme, but adding another framework to the mix can further impact performance. \u00a0Trying to create pixel-perfect screens that match up with native ones can, for example, can also involve complicated CSS renderings that draw on the machine&#8217;s processing power and further affect performance. \u00a0Tricks have also been devised to handle things like screen transitions to make the look more like the native platform.<\/p>\n<p>So, does the use of PhoneGap to create mobile apps make sense, or is it a &#8216;mistake&#8217;? \u00a0Do all the workarounds and clever tricks needed to successfully emulate a native app really make development any simpler, and can PhoneGap-based apps really be as good as native-built ones?<\/p>\n<p>While there are numerous examples of successful mobile apps built with PhoneGap, using it does seem a bit risky. \u00a0No matter how clever you may be in your development, a PhoneGap app will never be as performant as an equivalent native one. \u00a0And as mentioned above, for simple apps that don&#8217;t require a lot of interactions with the user, it may make sense. \u00a0But prior to building your app, it can be difficult to know whether you&#8217;ll run into problems, and if you do, exactly what those problems will be. \u00a0Ultimately as mobile devices become increasingly powerful and technology like HTML5 and CSS3 become more mature, solutions like PhoneGap will either work better than they currently do or they will simply become unnecessary. \u00a0That will be great when that happens. \u00a0But until then, you&#8217;ll need to try it to see for yourself, or opt straight away for native development.<\/p>\n<div class=\"lightsocial_container\"><div class=\"lightsocial_element\"><a class=\"lightsocial_a\" href=\"http:\/\/digg.com\/submit?url=https%3A%2F%2Fformtek.com%2Fblog%2Fmobile-development-using-phonegap-to-build-apps-that-run-in-any-mobile-environment-good-or-bad%2F&amp;title=\" target=\"_blank\"><img decoding=\"async\" class=\"lightsocial_img\" src=\"https:\/\/formtek.com\/blog\/wp-content\/plugins\/light-social\/digg.png\" alt=\"Digg This\" title=\"Digg This\" \/><\/a><\/div><div class=\"lightsocial_element\"><a class=\"lightsocial_a\" href=\"http:\/\/www.reddit.com\/submit?url=https%3A%2F%2Fformtek.com%2Fblog%2Fmobile-development-using-phonegap-to-build-apps-that-run-in-any-mobile-environment-good-or-bad%2F&amp;title=\" target=\"_blank\"><img decoding=\"async\" class=\"lightsocial_img\" src=\"https:\/\/formtek.com\/blog\/wp-content\/plugins\/light-social\/reddit.png\" alt=\"Reddit This\" title=\"Reddit This\" \/><\/a><\/div><div class=\"lightsocial_element\"><a class=\"lightsocial_a\" href=\"http:\/\/www.stumbleupon.com\/submit?url=https%3A%2F%2Fformtek.com%2Fblog%2Fmobile-development-using-phonegap-to-build-apps-that-run-in-any-mobile-environment-good-or-bad%2F&amp;title=\" target=\"_blank\"><img decoding=\"async\" class=\"lightsocial_img\" src=\"https:\/\/formtek.com\/blog\/wp-content\/plugins\/light-social\/stumbleupon.png\" alt=\"Stumble Now!\" title=\"Stumble Now!\" \/><\/a><\/div><div class=\"lightsocial_element\"><a class=\"lightsocial_a\" href=\"http:\/\/buzz.yahoo.com\/buzz?targetUrl=https%3A%2F%2Fformtek.com%2Fblog%2Fmobile-development-using-phonegap-to-build-apps-that-run-in-any-mobile-environment-good-or-bad%2F&amp;headline=\" target=\"_blank\"><img decoding=\"async\" class=\"lightsocial_img\" src=\"https:\/\/formtek.com\/blog\/wp-content\/plugins\/light-social\/yahoo_buzz.png\" alt=\"Buzz This\" title=\"Buzz This\" \/><\/a><\/div><div class=\"lightsocial_element\"><a class=\"lightsocial_a\" href=\"http:\/\/www.dzone.com\/links\/add.html?title=&amp;url=https%3A%2F%2Fformtek.com%2Fblog%2Fmobile-development-using-phonegap-to-build-apps-that-run-in-any-mobile-environment-good-or-bad%2F\" target=\"_blank\"><img decoding=\"async\" class=\"lightsocial_img\" src=\"https:\/\/formtek.com\/blog\/wp-content\/plugins\/light-social\/dzone.png\" alt=\"Vote on DZone\" title=\"Vote on DZone\" \/><\/a><\/div><div class=\"lightsocial_element\"><a class=\"lightsocial_a\" href=\"http:\/\/www.facebook.com\/sharer.php?t=&amp;u=https%3A%2F%2Fformtek.com%2Fblog%2Fmobile-development-using-phonegap-to-build-apps-that-run-in-any-mobile-environment-good-or-bad%2F\" target=\"_blank\"><img decoding=\"async\" class=\"lightsocial_img\" src=\"https:\/\/formtek.com\/blog\/wp-content\/plugins\/light-social\/facebook.png\" alt=\"Share on Facebook\" title=\"Share on Facebook\" \/><\/a><\/div><div class=\"lightsocial_element\"><a class=\"lightsocial_a\" href=\"http:\/\/delicious.com\/save?title=&amp;url=https%3A%2F%2Fformtek.com%2Fblog%2Fmobile-development-using-phonegap-to-build-apps-that-run-in-any-mobile-environment-good-or-bad%2F\" target=\"_blank\"><img decoding=\"async\" class=\"lightsocial_img\" src=\"https:\/\/formtek.com\/blog\/wp-content\/plugins\/light-social\/delicious.png\" alt=\"Bookmark this on Delicious\" title=\"Bookmark this on Delicious\" \/><\/a><\/div><div class=\"lightsocial_element\"><a class=\"lightsocial_a\" href=\"http:\/\/www.dotnetkicks.com\/kick\/?title=&amp;url=https%3A%2F%2Fformtek.com%2Fblog%2Fmobile-development-using-phonegap-to-build-apps-that-run-in-any-mobile-environment-good-or-bad%2F\" target=\"_blank\"><img decoding=\"async\" class=\"lightsocial_img\" src=\"https:\/\/formtek.com\/blog\/wp-content\/plugins\/light-social\/dotnetkicks.png\" alt=\"Kick It on DotNetKicks.com\" title=\"Kick It on DotNetKicks.com\" \/><\/a><\/div><div class=\"lightsocial_element\"><a class=\"lightsocial_a\" href=\"http:\/\/dotnetshoutout.com\/Submit?title=&amp;url=https%3A%2F%2Fformtek.com%2Fblog%2Fmobile-development-using-phonegap-to-build-apps-that-run-in-any-mobile-environment-good-or-bad%2F\" target=\"_blank\"><img decoding=\"async\" class=\"lightsocial_img\" src=\"https:\/\/formtek.com\/blog\/wp-content\/plugins\/light-social\/dotnetshoutout.png\" alt=\"Shout it\" title=\"Shout it\" \/><\/a><\/div><div class=\"lightsocial_element\"><a class=\"lightsocial_a\" href=\"http:\/\/www.linkedin.com\/shareArticle?mini=true&amp;url=https%3A%2F%2Fformtek.com%2Fblog%2Fmobile-development-using-phonegap-to-build-apps-that-run-in-any-mobile-environment-good-or-bad%2F&amp;title=&amp;summary=&amp;source=\" target=\"_blank\"><img decoding=\"async\" class=\"lightsocial_img\" src=\"https:\/\/formtek.com\/blog\/wp-content\/plugins\/light-social\/linkedin.png\" alt=\"Share on LinkedIn\" title=\"Share on LinkedIn\" \/><\/a><\/div><div class=\"lightsocial_element\"><a class=\"lightsocial_a\" href=\"http:\/\/www.technorati.com\/faves?add=https%3A%2F%2Fformtek.com%2Fblog%2Fmobile-development-using-phonegap-to-build-apps-that-run-in-any-mobile-environment-good-or-bad%2F\" target=\"_blank\"><img decoding=\"async\" class=\"lightsocial_img\" src=\"https:\/\/formtek.com\/blog\/wp-content\/plugins\/light-social\/technorati.png\" alt=\"Bookmark this on Technorati\" title=\"Bookmark this on Technorati\" \/><\/a><\/div><div class=\"lightsocial_element\"><a class=\"lightsocial_a\" href=\"http:\/\/twitter.com\/home?status=Reading+https%3A%2F%2Fformtek.com%2Fblog%2Fmobile-development-using-phonegap-to-build-apps-that-run-in-any-mobile-environment-good-or-bad%2F\" target=\"_blank\"><img decoding=\"async\" class=\"lightsocial_img\" src=\"https:\/\/formtek.com\/blog\/wp-content\/plugins\/light-social\/twitter.png\" alt=\"Post on Twitter\" title=\"Post on Twitter\" \/><\/a><\/div><div class=\"lightsocial_element\"><a class=\"lightsocial_a\" href=\"http:\/\/www.google.com\/buzz\/post?url=https%3A%2F%2Fformtek.com%2Fblog%2Fmobile-development-using-phonegap-to-build-apps-that-run-in-any-mobile-environment-good-or-bad%2F\" target=\"_blank\"><img decoding=\"async\" class=\"lightsocial_img\" src=\"https:\/\/formtek.com\/blog\/wp-content\/plugins\/light-social\/google_buzz.png\" alt=\"Google Buzz (aka. Google Reader)\" title=\"Google Buzz (aka. Google Reader)\" \/><\/a><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>PhoneGap lets you write an HTML-based app that can be built and deployed in any of six different mobile ecosystems. \u00a0It\u00a0is a compelling idea. \u00a0It&#8217;s actually a bit like Sun Microsystems&#8217; slogan for Java applied to the mobile development landscape:<span class=\"ellipsis\">&hellip;<\/span><\/p>\n<div class=\"read-more\"><a href=\"https:\/\/formtek.com\/blog\/mobile-development-using-phonegap-to-build-apps-that-run-in-any-mobile-environment-good-or-bad\/\">Read more &#8250;<\/a><\/div>\n<p><!-- end of .read-more --><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"class_list":["post-3360","post","type-post","status-publish","format-standard","hentry","category-mobile"],"_links":{"self":[{"href":"https:\/\/formtek.com\/blog\/wp-json\/wp\/v2\/posts\/3360","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/formtek.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/formtek.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/formtek.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/formtek.com\/blog\/wp-json\/wp\/v2\/comments?post=3360"}],"version-history":[{"count":0,"href":"https:\/\/formtek.com\/blog\/wp-json\/wp\/v2\/posts\/3360\/revisions"}],"wp:attachment":[{"href":"https:\/\/formtek.com\/blog\/wp-json\/wp\/v2\/media?parent=3360"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/formtek.com\/blog\/wp-json\/wp\/v2\/categories?post=3360"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/formtek.com\/blog\/wp-json\/wp\/v2\/tags?post=3360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}