Webpages As Apps

Websites as Apps

Websites have come a long way from the Hamster Dance. In their short lifespan, web browsers have become one of the most robust digital platforms, and for good reason – they’re on everything. Whether it be Linux, Mac, Windows, Android, iOS, Windows Phone, Ubuntu Phone, one thing you’ll find on almost every platform is a web browser. But what does all this have to do with apps?

Advantages of Webpages as Apps

Websites run thanks to a multitude of tools. For the layout and definition of content, Hyper Text Markup Language (HTML) is the standard by which the web has been functioning since 1995. Though it also provides some nice formatting options, a much more powerful tool called Cascaded Style Sheet (CSS) allows web developers access to a bevy of style options far beyond what HTML offers. And to handle data processing, user input, and almost anything else that a website needs that a programming language can provide, Javascript is widely considered to be the best and most robust solution to providing logic to sites. These three tools make up an overwhelming portion of all webpages on the net today and are continuously updated to provide more powerful features to enrich their content. Sound familiar?

If you think about it in terms of mobile app development, HTML and CSS are like our views and layouts to make up the user interface where Javascript is like our backend code, making web browsers our OS. This simple analogy is why many app developers are turning to web programming for their solutions—if a web browser functions as our OS, our code works on every platform with one (which is almost all of them).  Besides the obvious benefit of reaching more customers, the main advantage to developing a website instead of an app is only having one code base that you have to maintain to work on every major platform, significantly cutting down on the amount of work you have to do in order to fix a bug or release an update. And most mobile operating systems are eager to help your site become an app by offering interfaces within apps specifically designed to display webpages. It’s as easy as creating an app with one WebView, adding in your entire website with assets in to your project, and opening up your webpage when the app starts. If that sounds too tough or you get stuck, there are even programs like Phone Gap take care of all of that for you.

The Unfortunate Drawbacks of HTML5/Javascript Apps

So far web programming for mobile apps sounds delightful. Who wouldn’t want a multiplatform solution with a lower maintenance effort and very little effort to convert it into an app? I assure you the multiplatform code reuse comes at a price. When your app is just a webpage, you cannot take advantage of platform specific tools within the code, meaning that if you wanted to access any of the operating system’s functions, you’d have to program that feature for each platform.  Though coding these functions would take far less time than recoding the app for each platform would, it still adds overhead if you need to use OS-specific functions. The other unfortunate side effect of using the web browser instead of the native OS is that there is an associated performance hit. Since you’re running both your program and the code needed to interpret a webpage, you add processing overhead, something that may slow down your app enough to be noticeable, something users loathe.

Another drawback has to do with graphical power. Web browsers on mobile operating systems are historically not great at rendering high-intensity graphics. Most mobile game engines have been tweaked to get the most performance out of the platform they can. Even with graphics standards like OpenGL, browsers still have a hard time doing intensive graphics even on desktops. If you’re developing a game, or a game is part of your app, doing it on a browser may work provided it is simple enough. Case in point, as an experiment, I was running a simple marbles game developed using HTML5’s Canvas. This game worked fine as a 2D game with just circles. I then converted the game to 3D using a Javascript engine. I was lucky to get 1 frame per second when things were moving quickly. The slowness was due to rending with HTML5’s canvas and not WebGL since some platforms didn’t support the WebGL rendering engine. You can read more about it here, but take a look at this video for the stark comparison.

What’s Right for You?

All the pros and cons being laid out, web programming may be the solution for you. If your app idea isn’t very graphics intensive and doesn’t rely on platform specific calls like for alarms, you can potentially have a significantly smaller code base that works on all mobile platforms as well as just about anything with a web browser. It should also be noted that native code and HTML have to be mutually exclusive. For instance, you write platform specific calls to access the OS’s functions, but still maintain an HTML/CSS frontend with backend code being held mainly by Javascript. If multiplatform capability is quite important to you, consider looking in to web programming first as it’s a robust, nigh-ubiquitous solution to more simple program requirements.

Leave a Reply

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