HTML5 Frameworks for Mobile Web Applications
HTML5 Frameworks for Mobile Web Applications
Join the DZone community and get the full member experience.Join For Free
We are starting the series of tutorials and short reviews about popular HTML5 mobile frameworks. In this post we are discussing why would developers use existing mobile web framework instead of building one from the ground up. And we are creating simple mobile web application with Framework7
Mobile web applications allow us to quickly design and develop prototypes, reuse already written code across multiple mobile platforms and in many cases match look & feel for customers using wide range of devices with different operating systems.
Why to use HTML5 mobile web framework?
Mobile UX has specific requirements. The screens are generally much smaller and mobile users are used for specific navigation flows (navigation bars, home buttons, lists, menu items etc.).
Mobile operating systems also have specific recommendations and requirements for app UI to be user friendly. Even though with HTML5 you can fully customise look & feel – creating all these default flow elements would consume lots of time if you have to start everything from the ground up.
There are HTML5 mobile frameworks out there with already designed and implemented common elements you will need for mobile application. Majority of them are responsive, which means you can use the same framework to develop your mobile web application for different screen sizes. And code reuse in todays fast moving technology environments is very important, time saving factor.
Depending on the resources and timelines you have for a project, it might well make sense to use one of the existing HTML5 mobile frameworks and customise some parts of it if necessary.
If you have a luxury to spend more time while building the mobile web project you might consider creating such framework in house, but even then, its a good idea to take a look at existing open source HTML5 frameworks and see which components you can build in similar fashion. Most of open source frameworks have built extensive communities of developers around them who regularly contribute and improve the quality of code.
In these series I’m going to review few popular HTML5 mobile frameworks, based on the following they have on social code version control site GitHub. This post is about – Framework7
Framework7 – HTML framework for building iOS apps
This is what they say on framework web site. Framework7 is specific to one platform – iOS, however on showcase page many apps have Android OS versions as well. At the time of writing, this project is active and very popular on GitHub with healthy community of contributors and many commits.
The goal of this short review is to build simple mobile web application with home page, about page and login page. After building these we are going to take a look how we our application can store data locally and how can it communicate to cloud backend storage if needed.
Start Building Example Login Application
First things first. We have to clone or download the project from GitHub page.
git clone https://github.com/nolimits4web/Framework7.git or just download the zip
We are going to use one of the existing examples in order to create our app. These pre built example applications in Framework7 are great by the way. You can take a look at how example code is structured and reuse it in your apps. Current examples include
- Inline pages – app structure where all the views are coded in one HTML file.
- Split view – example application with split view, mostly seen in tablet applications.
- Tab bar – application with the example bottom tab bar for navigation.
We are using inline pages example app for our tutorial.
I have copied
inline-pages folder (you can find it in examples subdirectory of Framework7 project) and named it
The copied example application still has links to JS and CSS global files in the Framework7 folder structure.
Our fist job is to copy everything into
htmlcenter-login directory, so we can independently upload finished application to any web host (or PhoneGap wrapper) and HTML5 app should have all the resource files it needs.
I took the
js directories from dist and copied them over to
htmlcenter-login app directory. You will also notice files named
Now once we have resource files correctly referenced, we can make changes to default example app to match the design of prototype we are building.
Login App Views
There are 3 requirements for Framework7 application we are building in this tutorial. It should have 3 main mobile views –
Login. With navigation options between pages.
Home and About views will display text information with some links and Login page will allow user to enter email address and password in order to login.
The Framework7 example app we have copied over provides all the needed elements. I just rearranged them slightly.
In fact for Login page, I had to remove majority of elements from the example Form view leaving just what we needed – fields for Email / Password and the buttons. After the changes, application views should look like the ones below.
You can find full source code of HTML5 file I created in online Gist. Great thing about Framework7 examples – they are nicely commented out. I have commented the modified sections as well. In the end of the day HTMLCenter is all about learning.
This tutorial was a short introduction to the Framework7 HTML5 mobile web framework. In the above steps we have created a simple app with 3 views and default (minimalistic) look & feel.
The following tutorial in this series will show you how to make the actual login page work. We will take a closer look at what happens under the hood while your mobile application communicates with backend services. We are going to integrate Firebase backend as a service app, in order to keep user records. Stay tuned!
Published at DZone with permission of Saul Zukauskas , DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.