Using HTML5 and other web technologies when developing an application for the android platform simplifies the development process and helps us cooping with the well known android platform fragmentation problem.

I chose to write this post in order to point at those cases in which we cannot avoid using Java in our application development for the android platform. I believe that similar considerations might apply for the other mobile platforms.

Computation Resource Limit

When developing an application for android devices which are relatively weak in their computation resources (e.g. old cpu model, shortage of memory etc) we should be careful with our expectations to get a smooth execution of the web technologies we chose to use. There are many cases (e.g. TV set top boxes, machines control boxes etc.) where we might be disappointing finding our app running slow and responding with delays. One option would be avoiding the relatively heavy JavaScript libraries as jQueryMobile and similars. The other option would be developing the user interface and the application logic in Java.

Using The Android Platform Capabilities

Although JavaScript libraries such as PhoneGap do allow us to access the android platform from within the code we write in JavaScript, those libraries don’t cover all platform capabilities. They usually cover the common capabilities, such as the camera, the address book and the notifications mechanism. When there is a need for using a platform capability PhoneGap (or any of the other similar libraries) doesn’t support one option is to search for a PhoneGap plugin that enables using the very specific platform capability we are interested at. Another option is to develop that plugin by ourselves. When developing such plugins there is a need to write code in Java. There is a need in knowing how to develop in Java for the android platform and there is a need in being familiar with the entire complexity of this platform. Many of the most interesting applications on google play use specific platform capabilities PhoneGap (or any of its alternatives) don’t support and relevant plugins don’t exist.

Code Running in The Background

There are many cases in which we need to have code running in the background. One example is the Facebook application that needs to be continuously updated by the server. Code running in the background cannot be in JavaScript. It won’t be good enough. Such code must be written in Java or in C\C++.

Using Web Technologies is Irrelevant

Application for the android platform do not necessary include the common on-screen user interface the user interacts with. There are many types of applications that don’t include any user interface of that sort. In most cases those applications can be developed in Java and the usage of web technologies is not relevant. Samples for these type of applications include live wallpapers, app widgets, keyboards and launchers.

High Quality Application

Although it is possible to develop an android application without even knowing Java the outcome in many cases is a poor application that includes one activity only. Usually it is an activity that contains the whole application rendered in a web view it includes. Instead of getting a flow of activities (screens) the user moves through and feels as any other application the outcome is different. Unlike most of the high quality Java applications on google play that handle in a successful way display rotation and pausing \ resuming when an incoming phone call arrives, the outcome is far from being perfect. The user expects the application to be as any other application. In order to achieve that our application better include a menu (the standard menu of the very same android device the user has). Developing that menu is possible using Java only. In addition, our application better uses the notification mechanism of the device. Doing that successfully we must code that part in Java and be familiar with the entire platform complexity. Other similar cases include an efficient use of fragments when developing for tablets and other big screen devices and an effective usage of the action bar (relevant for big screen devices). The only way to implement these two is using code written in Java.

Leave a Reply

Your email address will not be published. Required fields are marked *