“UIWebView” Apps: Good or Bad?

I’ve witnessed an ongoing debate in recent months over a specific part of the iOS SDK that allows developers to embed web content into their app. This specific class, “UIWebView”, has given the opportunity for some developers to masquerade web apps as native apps by simply embedding their web-based app within a native container.

This approach to app development is an interesting, and controversial one. There’s many pros and cons including the biggest, cross-platform compatibility. Today we’ll take a look at these “UIWebView”-based apps and investigate whether they’re good or bad for developers and consumers.

What are these apps?

This class of app are native mobile apps that’s native features extend only to the embedding of a window of web content. The actual app itself is powered by web technologies like HTML and JavaScript, and is hosted online with little or no content actually residing on the device’s storage. Developers can create apps like this in a number of ways, and it certainly isn’t exclusive to Apple’s platform.

As previously mentioned, one of the main methods to achieve this (on Apple’s iOS platform) is through the “UIWebView” class, a part of the iOS SDK which allows developers to embed web content.

You use the UIWebView class to embed web content in your application. To do so, you simply create a UIWebView object, attach it to a window, and send it a request to load web content. You can also use this class to move back and forward in the history of webpages, and you can even set some web content properties programmatically.

Additionally, there’s third party services which facilitate such development. PhoneGap is a mobile development framework which is described as an HTML app platform allowing developers to author native apps with web technologies. PhoneGap’s supported platforms include iOS, Android, BlackBerry, Symbian, WebOS and Windows Phone 7.

PhoneGap is a solution for developers who want to package and distribute web apps natively.

Pros and Cons

The main advantage of powering a native app with web-based technologies is cross-platform compatibility. The web is the ultimate universal platform because pretty much any of our devices will connect to it, even our games consoles. Additionally, by using a much wider known language, developers require less of an education in authoring apps meaning it ultimately takes them less time to develop for a platform.

Additionally, by being a web-based app, developers can much more easily push out updates and modify their service without requiring user action, a benefit for rapidly-developing applications.

There are some significant disadvantages, however. First off, having an app that is not written in a device’s native code means it can’t take full advantage of the actual device and the ability to integrate aspects of the hardware is much limited (access to files on the device, the camera, accelerometer etc is not possible). Additionally, performance can be hindered because apps can’t necessarily take full advantage of a device’s power. In iOS 4, web apps that we’re launched from the home screen did not benefit from boosted JavaScript performance like they did when running within the Safari app.

Of course, web apps do require the web and a lack of internet connection will prevent your use of the app.

Conclusion

Whether having entirely web-based apps contained in a native app is good thing really depends on what the app is. If a light-weight app that would have no significant benefits being written in native technologies is distributed in this way, the advantage of cross-platform compatibility probably outweighs any nominal performance hindrance.

However, there’s a lot of apps that do a lot of cool and useful stuff with device-specific hardware. If a developer has the time, effort and resources to produce native apps, it’s probably always the best course of action. But for those that can’t, these types of web apps are a great second.

Leave a Reply

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