Note! This the first installment of series on mobile development. This series will cover different strategies and techniques.

Why JavaScript?

I want to deliver an application via a web browser. Perhaps I've developed an application for a small group of folks. I want get the initial application out the door as quickly as possible. A web application (App) that runs within a web browser spares me the overhead of vendor specific devices, operating systems and stores.

As mentioned in the introduction above. A JavaScript web app is a strategy. Later in this series we'll discuss other strategies line native applications.

Doesn't JavaScript limit functionality? JavaScript running within a web browser?

Modern version of JavaScript along with HTML5 and CSS3 provide a lot more functionality than the original ECMAScript standard released in 1997.

HTML5 provides database to persist data across sessions (I.E. offline) in the client.

Offline Processing. In addition to embedded databases, the HTML5 "Application Cache" functions as an install kit for you web application's artifacts. In other words, once installed, you can run a stand alone application.

Our example application will demonstrate how to replace the server with the javascript engine/loader running inside the web browser. In a mobile environment, reducing your application to one javascript engine, via a single page architecture, is a critical performance gain.

Our example application will reproduce functions typically performed by the server. For example, we'll produce a new html document, and a "download link" all within the web browser.

File Access. Our project will demonstrate how we can read from and write to the client file system, just like a traditional desktop application.

CSS3 and HTML5 together deliver a rich user interface, cross-platform and light weight. We leverage the web browser to deliver the functionality.

Isn't Javascript slow?

Sure. performance is a challenge, specially on small devices. JavaScript has come along way from it's inception. We are going to demonstrate some optimization techniques. Performance needs to be measured in context. We need to look how many functions our application performs. What type of operations. What web browsers do we need to support? Granted most successful applications grow in size. However, it is still a good idea to analyze an application's requirement before ruling that JavaScript is too slow.

Also consider, the mobile market is in flux. Part of me is betting on the new FireFox OS. My first mobile JavaScript application was suffering from performance problems. I installed it on the Firefox OS simulator and it ran just like a native application.

What about a hybrid application, like phone gap/cordova?
We'll explore that in this journal. I've developed on an Android phone (v 2.8) with phone gap/cordova. The big feature for me was the ability to write your own native plugins (I.E. native code that communicates with the JavaScript engine). If you are an experienced programmer, you may have many functions you've developed over the years. Many of those functions can then be packaged as a JavaScript plug-in. In addition, if you have a true web designer who's versed in CSS, you can style your app without having to deal with vendor specific mechanisms.

To summarize, web technology is more prone to public standards (versus private proprietary application programming interfaces (API)). So, the hybrid strategy has a lot of appeal.

We will go there, but not right away.
Are we going to use libraries?

Again, libraries provide all sorts of benefits. We will go there, but not right now. Our first priority is to train our selves. Initially, we won't be able to build solution as elegant as jQuery or BackBone/Underscore, etc. However, purely as a learning device, let's employ plain JavaScript and Document Object Model (DOM) manipulation.

Later, when we use those great libraries and frameworks, we'll have a good knowledge base to start from.

Note! this is introduction to a series located here.

About the Author:
Lorin M Klugman is an experienced developer focused on new technology.
Open for work (contract or hire).
Drop Lorin a note. Click here for address.
Please no recruiters :)
- Home