Sunday, December 12, 2010

Native Apps vs Web Apps

The Issues Native Apps Web Apps
Internet access Not required Required, except for rare apps with offline capability
Installation/updates Must be deployed or downloaded Hit refresh
User interface Native apps are responsive and functional Browsers can be clunky, but new advancements in JavaScript like jQuery Mobile are catching up fast
Device compatibility Platform-dependent, hardware-dependent Platform-agnostic, content can be reformatted with CSS to suit any device
Animation/Graphics Fast and responsive Web apps are getting closer, but will probably always lag
Streaming media Few problems with audio and video. Flash works, but only if the device supports it Flash works where supported. Browser-based audio and video are getting there, but still beset by compatibility headaches. Give it a year or two
Fonts Tight control over typefaces, layout Almost on par, thanks to advancements in web standards. Give it six months
Is my content searchable? Not on the web By default
Sharable/Tweetable? Only if you build it in Web links are shared freely. Social APIs and widgets allow easy one-click posting
Discussion and collaboration Only if you build it, and it’s more difficult if data is disparate Discussion is easy, all data is stored on a server
Access to hardware sensors Yes, all of them: camera, gyroscope, microphone, compass, accelerometer, GPS Access through the browser is limited, though geolocation is common
Development Specific tools required for some platforms (like Apple’s). You have to build a new app for each target platform Write once, publish once, view it anywhere. Multiple tools and libraries to choose from
Can I sell it? Charge whatever you want. Most app distributors take a slice, up to 30% Advertising is tolerated, subscriptions and paywalls less so. No distribution costs beyond server fees
Distribution Most app stores require approval. And you gotta wait No such hassle
Outside access to your content No, the reader must download your app Yep, just click a link
Advertising Control over design (though limited in iAds) and rate More choices for design, plus access to web analytics. Rates vary widely

Thursday, December 9, 2010

Frameworks for developing mobile web apps

Smart Phones are the future of the next gen web. There’s a lot of buzz with the new mobile web frameworks and mobile platforms. There’s also a lot of confusion and vague terms being thrown around that are causing people to misunderstand what each of these tools do.I did a small research to understand some of them and to clear doubts i had.

Types of Mobile Apps :
  • Native Apps - written using Android SDK Java(for android phones) , Cocoa Objective-C (for IOS/IPhone).
  • Web Apps - written using Sencha Touch or JQuery Mobile frameworks (in normal web technologies Js/Html/css)
  • Web Apps which look like Native Apps - wrapped using Titanium or Phonegap frameworks which can access some of the mobile devices native APIs using javascript
We have many frameworks for developing native and web apps. Interestingly , we have some more frameworks for converting(wrapping) webapps to native apps.These wrapper frameworks provide some Javascript native APIs through which a "web app" has access to the mobile phone functions such as Geolocation, Accelerometer Camera, Contacts, Database, File system, etc .

Developing Native apps and Web apps in mobiles have their pros and cons. Lets discuss about each of the type below :

Native Apps

A native app is defined as the software specifically written to run on a device’s operating system and machine hardware, and typically needs to be rewritten for different devices.A native app runs on your device.All of it’s resources are installed locally on your machine.A native app uses platform and language specific API’s native to that device.A native app has access to local resources while a mobile web app cannot.

We have to write a native app in Java Android sdk for android based devices and upload them to android app market. If we need to make that app for Iphone , then we need to write the same in Objective-c(cocoa) to run it in IOS and upload it to apple appstore.The same applies for symbian, blackberry and other OS s too. Unless you are a Backend(Java/Obj-c) developer , you wont be much interested in this.

Web apps

The future of the Mobile Web is likely to be dominated by cross-platform browser-based mobile web sites - rather than apps built specifically for iPhone, Android, or any other platform.
A mobile web app is not the same as a mobile native app. A mobile web app runs in your browser.Think of a mobile web app as a website like facebook.com or Twitter.com. Almost all of the app’s resources are remote, stored on some server somewhere. Sure there might be some local storage happening but at the end of the day it’s a website application. Check out for more differences here.

A Web app is typically coded in a browser-rendered language such as HTML,CSS combined with JavaScript. Direct control over the application’s distribution and cost advantages are usually the main reasons for launching a Web application. For webdevelopers,its very easy to build them and requires no app store approval.
Frameworks like Sencha Touch and JQuery Mobile can give native look for the webapps.The difference between the capabilities of Web-based and native mobile apps is narrowing rapidly with the invent of these frameworks.

Sencha Touch and jQuery Mobile

These are mobile web frameworks. You can use these technologies to create web-based mobile apps. Both of these projects run in javascript.

Sencha Touch, the first HTML5 mobile JavaScript framework that allows you to develop mobile web apps that look and feel native on iPhone and Android touchscreen devices. Sencha Touch is a cross-platform library aimed at next generation, touch-enabled, devices. With Sencha Touch you write an object-oriented javascript application that generates HTML markup.Higher learning curve than most other web frameworks but best one for writing high level web applications.

JQuery Mobile (1.0 Alpha 2) is built on the famous JQuery requires JQuery 1.4.4. JQuery Mobile uses the very best HTML 5 and CSS 3 features to provide the best possible experience in the most-capable browsers.JQuery Mobile aims to be more mature and as much cross browser as possible.The following quote describes best of it.

“A unified user interface system across all popular mobile device platforms, built on the rock-solid jQuery and jQuery UI foundation. Its lightweight code is built with progressive enhancement, and has a flexible, easily themeable design.”

JQuery Mobile (like jQuery )adds interactivity and styling to ‘classic’ declarative HTML, probably generated on the mobile site’s server side.

Sencha Touch (like ExtJS) is more of a programmatic approach, where a mobile app is written almost entirely in Javascript, and creates the majority of the HTML itself on the client when executed.

Sencha Touch seems very sophisticated and use it if we had to build a complex feature rich web app. But Jquery mobile supports more devices & platforms and has less learning curve.In future it might include many rich features.So i support JQuery.

PhoneGap and Titanium


Titanium is a cross platform technology that goes beyond the mobile and currently supports iPhone, Android devices, desktop applications, Windows and Mac, with plans to support the BlackBerry in the near future.The idea behind the Titanium platform is that you write your applications with web technologies like javascript APIs and html, and when you want to test your application, Titanium will compile your code in a native application. Which mean that you can in fact write one application for the iPhone and Android in titanium and the framework will compile it for those platform separately.

Titanium doesn’t compile HTML and JavaScript into native applications (as some people might think) but instead acts as a JS API that links to pre-compiled native objects. What’s the difference? Well a Titanium app will not have the performance of a fully native app nor does it give you full access to the all native API elements.

PhoneGap serves as a wrapper for the browser. PhoneGap opens a webkit view in a native application. So your html and css is shown exactly how it will look in the real application. Titanium can do the exact same thing via “webViews” but Titanium takes it a step further by offering a slew of native APIs for Cocoa/Android Touch outside the browser.

PhoneGap and Titanium are not similar to Sencha Touch and jQuery Mobile.Both allow you to distribute native or native-like apps. A lot of people think that Titanium and PhoneGap are in competition with Sencha Touch and jQuery Mobile. But its wrong , they are used as wrappers.
Both don’t need to “build support” for Sencha Touch or jQuery Mobile. Why? Because the devices they support come with browsers. Remember, Sencha Touch and jQuery Mobile run in the browser. Since both PhoneGap and Titanium allow you to run things in a given device’s browser, they already have support for Sencha Touch and jQuery Mobile.

You can use Sencha Touch and jQuery Mobile inside both PhoneGap and Titanium. If you decide your html/js to be cool as a native app, you can use either PhoneGap or Titanium to wrap a browser around your app and put it in the app store or marketplace. This is where the confusion comes. Putting your Sencha Touch or jQuery Mobile apps in a native wrapper doesn’t make it a native app. It makes it appear as if it is a native app. You might get some extra functionality from PhoneGap or Titanium API’s, but it’s still not necessarily a ‘native’ app. It’s a web app running locally on the device. It’s a great way to use web technologies inside a native-like area.