Our Blog

Pros and cons of Phonegap apps

Svetoslav Sinyovski
by Svetoslav Sinyovski on Thu 18 October 2012 No comments

PhoneGap

PhoneGap is a free open source framework for HTML5 app development. Adobe owns the project and offers integration of the framework in its web development tool Dreamweaver. Apple’s Xcode IDE has some neat features useful to PhoneGap developers as well – HTML and JavaScript code highlighting and code completion. PhoneGap grows fast and new versions are frequently released. This is necessary to reflect updates in the many platforms it supports and to introduce new wonders to the enthusiastic community such as Adobe PhoneGap Build – a service that allows compilation in the cloud, aiming to simplify the usually complex setup required to compile apps for each platform.

The pros

There can be no limit to the pros of using PhoneGap. If you’re a web developer, it’s the logical choice to do mobile app development. With your existing skills you can build anything you can imagine and deploy it to iOS, Android, Windows Phone, Blackberry, webOS and Symbian. A single person can develop, distribute and sell an app on all these platforms, a feat hardly possible with the resources of an entire company, were the app native. Or, one could simply use it as a vast learning resource – a gateway into the world of mobile app development, to catch a glimpse of the look and feel of each platform’s development tools and workflow. And that’s not all – JavaScript code is reusable. Nothing goes to waste.

In web development, cross-domain AJAX requests can be problematic due to security. If you want to get JSON data from another site for example, you may have to deploy various workarounds such as injecting JavaScript from the site directly in your code. With PhoneGap apps this is not a problem. Not to mention you don’t have to worry about compressing or optimizing your CSS and JavaScript files to save bandwidth – they can remain human-readable at all times. In addition to this, you also have access to the phone’s hardware, which may include magnetometer/compass, accelerometer (detects the phone’s orientation in space) and camera. Access to the file system allows storage of large amounts of data not limited by browser settings. Additional features may also be available – audio services for playing and recording sound, location services, access to contacts and events.

The cons

The cons of using PhoneGap can be difficult to explain. For people without tech background and for everyone else of course, we should begin with the most notable limitation. All mobile platforms are constantly changing and evolving. The companies behind them have their own interests and vision for the future of their products and it’s PhoneGap that has to adapt, not the other way around. HTML and JavaScript support on these platforms can be stripped in various ways and its state could vary between versions much like browsers do. Developers have a lot more to worry about too such as patents, marketing and legal stuff, use of encryption in their apps. Supporting more platforms rather adds to these problems, with Apple having perhaps the most evolved system to help minimize damage from doing things wrong and aid developers.

A PhoneGap app can occupy several times the memory size of a native app. Unless it’s a very simple app, this memory will grow in time because web developers don’t have direct control over objects in memory. This can be an issue if your app targets users with high expectations on performance and quality. In iOS 5 Apple offered native integration for Twitter, same was done for Facebook in iOS 6. This is not simply a new feature for convenience, it’s a necessity aiming to reduce the use of web views in native apps because the memory cost of a web view in an app can be several times the normal size of the app. This kills other apps in memory which the user has previously run – not a big issue in itself but next time these apps are run there’s typically a short pause until they restart and the transition is not smooth.

Conclusion

JavaScript is the core language PhoneGap relies on. It’s compiled at run time in memory, unlike native platform languages such as Objective C, Java and C++ which are compiled into executable files. The JavaScript parts of PhoneGap apps’ source code are distributed in the app bundle and visible to developers who download it. It’s a kind of developer paradise, if you’re the open-minded type. While this can be troubling, it also defines PhoneGap’s place in the software ecosystem. The idea behind software such as this will not die for sure, but will PhoneGap be the leading product on the scene? JavaScript is one of the most popular languages out there, and PhoneGap is owned by Adobe, a very big player, which also owns Flash. This will probably ensure PhoneGap stays on the software scene for a long time. It could make it the right choice for HTML5 app development all along too.

Artwork from http://phonegap.com/about/artwork

Svetoslav SinyovskiPros and cons of Phonegap apps

Related Posts

Take a look at these posts

Join the conversation