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
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
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
directory, so we can independently upload finished application to any web host (or
) and html5 app should have all the resource files it needs.
i took the
directories from dist and copied them over to
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 –
. 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.