Friday, 13 September 2013

Hybrid mobile application native packaging using PhoneGap 2.9


Friends,

As I was occupied with a mobile application project for the last couple of months, there was an undesired break in blogging. Let me get back to the momentum that we had. This time I would like to talk more about native packaging of hybrid applications across multiple platforms using PhoneGap 2.9. Those who have worked with PhoneGap might be familiar with the ifs and buts of the native packaging process. I would like to throw some light into the dark areas of native packaging. ;)

Hybrid application

A hybrid application means an app that works in all platforms with the same look and feel. It can be developed using HTML5 or JavaScript. In case of HTML5, you may have to use CSS media queries to handle responsive design. If you are interested in MVC JavaScript programming, Sencha Touch offers a flexible and powerfool way of creating hybrid apps since the responsive design is inherently taken care of by Sencha.




Platforms

I would be dealing with Android, iOS, Windows and BlackBerry packaging. As it can be too lengthy if put together, I decided to keep them separate. I shall give links to each of them in this post as and when those posts are ready. In this post, I plan to give an outline as well as a general description of native packaging using PhoneGap.

Why not PhoneGap3.0?

Many of you may be knowing that PhoneGap has released their latest version 3.0.0 which supports packaging and building of platform specific applications from a single project. During the time I write this blog post, I would say, that is still in premature status. Active development is still going on. May be in another few months we will get a bug free tool.

Other options?

If you are confused whether to use PhoneGap for your application, I can list down a few tools which may be useful for you.
  1. Kony
  2. Titanium appcelerator
  3. Sencha Touch
  4. IBM worklight
1 and 4 are licensed tools whereas SenchaTouch supports native packaging for Android and iOS only. Titanium supports Android, iOS, BlackBerry10 and Tizen.

None of the above could match PhoneGap in providing maximum number of platform support and native APIs. Supported platforms are given below.
  1. Android
  2. iOS
  3. BlackBerry 10, PlayBook, 7 and below
  4. Windows Phone 7, 8 and Windows 8 (store apps)
  5. Tizen
There are support for some 'not so popular' platforms too.

Set up dev environment

Though it appears to be simple and easy while talking about multi platform support, it is not exactly as it seems. Each platform has its own hardware and software requirements. Lets understand those in details.
Also download PhoneGap 2.9.0 from here.

Android

Android platform can be set up in Windows, Mac or Linux systems. Make sure you have following items ready in your system.
  1. Eclipse + ADT plugin
  2. Android SDK Tools
  3. Android Platform-tools
  4. The latest Android platform
  5. The latest Android system image for the emulator

iOS

Apple restricts the development of iOS apps outside mac environment. That means, to package the iOS app you must need a macintosh system.
  1. Mountain Lion or greater
  2. XCode 4.5 or greater
  3. iOS developer account (for deploying to a device)
You can still package apps using XCode 4.2. But it may not work properly in iOS6 and many native APIs will not be supported in XCode 4.2.

Windows Phone 7

Just like Apple does, Windows demands the need of Windows 7 or Vista as the OS for packaging. And following items are required to be installed.

  1. Windows Phone SDK 7
  2. Visual Studio Express
  3. Windows Phone Emulator which requires a DirectX 10 or above capable graphics card with a WDDM 1.1 driver

Windows Phone 8

Windows 8, Windows 8 Pro is required for this platform. Also following additional tools are required.

  1. Windows Phone SDK 8
  2. Visual studio Ultimate
  3. Windows Phone 8 emulator which requires a processor that supports Second Level Address Translation (SLAT)

Windows 8 Store Apps

These are the apps for Windows 8 tablets. The development system should be Windows 8 and should have Visual Studio Express edition.

BlackBerry (BB10, PlayBook, OS7 and earlier)

Like Windows, BlackBerry provides separate SDKs for all the three different platforms. For hybrid app development BlackBerry provides WebWorks SDK and for native apps it has native SDK. Though PhoneGap supports packaging for all the different devices, their latest blog says that in the future PhoneGap will support only BB10. PlayBook is anyway out of the market. Nowdays no new devices in OS7 are released too. For BB10 devices, PhoneGap utilizes Native SDK for BB10 and for others it uses WebWorks SDK.
Following are the system requirements.
  1. Windows XP,7,8 or Mac OSX 10.6.4+
  2. Java Development Kit 
  3. Apache Ant

Now lets check each of the platform in detail. I shall update this blog by providing links to each of them as and when they are ready.
  1. Android - available
  2. iOS- available
  3. BlackBerry- available
  4. Windows Phone 8- available

Happy coding!

No comments:

Post a Comment