Hybrid UI framework shootout: Ionic vs. Famo.us vs. F7 vs. OnsenUI


1 Introduction

In the past 2 years I’ve been working intensively on mobile applications, mostly hybrid, and mostly with AngularJS. In my quest to find a good UI framework that integrates with AngularJS, I came across the following options: IonicFrameworkFamo.usFramework7 and OnsenUI. I also came across Material Design which I will talk about in a moment.

Disclaimer: This article isn’t meant to teach you how to use or build applications with these frameworks; my goal is to show you the simplicity of building a hybrid application, and to help you to get some sense of what is the most suitable framework for you. I hope I succeed!

2 What is a hybrid application?

A hybrid application is a native application built with web development skills: HTML5, CSS, JavaScript that are later packages into a native container. The native application contains a hidden browser (called WebView) that is linked to your HTML files. Using CordovaPhoneGap, or other similar solutions, it is possible — and even pretty easy — to wrap the HTML code with native code, and you will be able to deploy to the app stores pretty easily.

 Hybrid applications growth.

Wait, what?

Yes, you can build an HTML5 application and run it as a native application! Corodva, PhoneGap, and other native-bridge applications can access native functions such as the camera, accelerometer, geolocation, contact list and much more.

Why?

Building hybrid applications has some benefits. It is mostly cross-platform out of the box, which saves you money and time (which saves you even more money...). Building hybrid applications will give you the opportunity to develop your crazy ideas fast, real fast. It brings another great benefit — you can take any web developer, in any level, and after short period of learning they too can become app developers at your firm. That comes at a lower cost and with a shallower learning curve than Objective-C, Swift, Java and other native languages.

What about performance?

Unfortunately, none of the frameworks I’m about to talk about can manage to give full native feel out of the box like you get when you develop...well...native. They are definitely on their way there.

3 UI Frameworks

In the past, when developing for mobile you would probably use jQuery libraries for animations and create your own CSS and HTML. This is quite ok for building a website, but when developing for mobile devices, this is bad — very bad. You need to work hard to make it responsive, to be cross-platform, and to feel native. UX nowadays is super important, and if the users feel that your application is slow, buggy, and sticks, well, that‘s bad news.

Recently there has been fast growth in hybrid applications and mobile development, and many companies figured it out. In the last year three UI frameworks joined the list, and many more are on the way, giving us a better, more efficient, more performant hybrid experience.

3.1 Ionic Framework

Ionic FrameWork is about one year old. Since its release, it has gained a lot of respect in the hybrid & mobile development community. Its Git repo has more than 10,000 stars, its is updated almost daily, and the Ionic Forum is fairly active -- even better for asking questions than StackOverflow.

Its version 1.0 is still beta, and bugs exist, but it is definitely on its way to becoming much more fluent. The Ionic team are working hard to make their framework be as efficient, performant and native feeling as can be.

The Ionic framework wraps the AngularJS framework; this is a huge benefit as Ionic interacts beautifully with Angular.

The Ionic framework offers also the Ionic Box which helps you to start even faster, and for you - Microsoft Windows users - it saves a lot of headaches (or you can just start using Linux...). Bottom line - starting an Ionic application takes less than 5 minutes.

Moreover, Ionic provides a lot of utilities and it is pretty easy to do small customizations for iOS, Android, and the other operating systems.

One more side note - Ionic are working hard on the “Ionic Creator,” which is a kind of an IDE / GUI tool - for drag-and-drop creation of basic templates for Ionic applications. Sign up for their beta!

So lets have a quick look at how fast you can start an Ionic project.

First - let‘s install Ionic and Cordova:

$> npm install -g cordova ionic
Get expert bash help

Now let‘s create a new Ionic project:

$> ionic start <project-name> <optional-template>
Get expert bash help

Optional templates allow you to choose to start a side-menu project, tab, or blank project.

Example:

$> ionic start AirPair tabs
$> cd AirPair/
$> ionic serve
Get expert bash help

The result:

(More examples at Ionic‘s CodePen)

And thats it, you have a running web application with Ionic! Ionic created the sample application with 3 pages as an example, you can delete them or use them as a base for your application.

Lets have look at the structure of the project:

hooks
scss
   -- ionic.app.scss
www
   -- css
   -- img
   -- js
      ----> app.js
      ----> controllers.js
      ----> services.js
   -- lib
   -- templates
      ----> friend-detail.html
      ----> tab-account.html
      ----> tab-dash.html
      ----> tab-friends.html
      ----> tabs.html
   -- index.html
Get expert markup help

As you can see, it comes with a pretty simple and easy to understand structure. If you are already familiar with PhoneGap or Cordova, it‘s easy to set up a platform and run them, for example:

$> ionic platform add ios
$> ionic build ios
$> ionic emulate ios
Get expert bash help

The same can be done with Android (in the same exact way), and, of course on every OS Cordova supports (iOS, Android, Blackberry, Windows Phone, Palm WebOS, Bada, and Symbian).

I was actually pretty shocked the first time I used Ionic. It took me only 3 minutes to have a working application. It saves you a lot of time building the skeleton of the app you want to build, and even if its not quite the skeleton you need, Ionic makes it very easy to change and override their CSS files (SASS).

Ionic also provides a wide set of tools to use - from Pull-To-Refresh , to Infinite Scroll, and a lot of time-savings features.

One of the key things I like about Ionic is the fast growth of the community; their forums are pretty active, and there are a lot of questions even on StackOverflow. (I would recommend asking directly in the forums).

Ionic pros and cons

Pros Cons
AngularJS from core. Beta phase (bugs)
Full UI Componenets (Pull-to-Refresh, Infinite-loader, tabs, etc) Slow transiations & animations
Strong community, widely used.  
   
Subject Score
Documentation 8.0
Fast Start 10.0
Performance 5.0
Community 7.0
Learning Curve 7.0

3.2 Famo.us + AngularJS

Famo.us‘s mobile framework is a newborn baby. Only 4-5 months old, it‘s the newest framework on the market nowadays. Famous targets a specific need at this time: performance. With 60 fps animations, Famo.us is the choice for you if you want to brag in your hybrid app. We won‘t be discussing vanilla Famo.us, but rather the Famo.us & Angular bundle made by ThomasStreet.

Basically, Famo.us uses its own JavaScript engine that works with the GPU acceleration provided by CSS3 3D transformation functions to make animations as smooth as can be at 60 fps. It uses a different approach from other frameworks in order to render DOM elements, by not using the DOM at all -- Famo.us creates its own DOM rendering tree. Performance-wise, they have done a great job.

An example from Famo.us‘s CodePen (click the image to view):  Click here for more examples.

This video provides a nice case study of AngularJS & Famo.us -- it shows some nice combinations between the two of them, and sheds some light on how they get things done.

Nowadays, Famo.us is still not a competitor of Ionic as they still target different things. Their new support in AngularJS suggests that in the next few months it will be a threat to Ionic, as the main issues Ionic developers encounter are performance and smooth animations.

A while ago, the Ionic team wrote in the forums[http://forum.ionicframework.com/] that they might consider integrating with it in the future, but its problematic as Famo.us uses a whole other philosophy for its UI.

Unfortunately, Famo.us gives us a pretty basic starter kit, which makes for a faster start, but it lacks... everything. Basically, its just a structure of files and folders and a few nice examples of using Angular with Famo.us. It took me quite a while to understand how to get things that are done in the "native" Famo.us in the AngularJS & Famo.us bundle.

In order to start a Famo.us + AngularJS project, you simply need to clone the starter kit or install it via Bower.

Some node dependencies:

$> npm install -g serve
$> npm install -g gulp
Get expert bash help

Starting the project:

$> mkdir && cd AirFamous
$> bower install famous-angular
$> npm install
$> bower install
$> gulp watch
Get expert bash help

This will create a NodeJS server at port 9000 -- http://localhost:9000 -- and you can start writing Famo.us. When opening the browser, you will see an example of integrating Angular with Famo.us.

Famo.us has basically 2 main "DOM" components: the modifiers and the surface.

The surface is basically the content -- HTML elements -- and the modifier is anything you want to animate, move, or do something cool with. The modifier wraps the surface.

Pros Cons
You can create great animations at 60fps, which makes the app to feel more alive, better user experience. Not providing basic skeletons (menus, tabs, basic app structure/layout).
Has AngularJS intergration & a starter kit. Still early.
  Not widely use, hard to find real examples and show cases.
  Documentation lacks of real “getting started” docs.
Subject Score
Documentation 6.0
Fast Start 4.0
Performance 10.0
Community 4.0
Learning Curve 4.0

Conclusion:

At first, I wasn’t that impressed with Famo.us, but when testing it on my mobile devices I was pretty amazed by the results. Its capabilities and flexibility are great, but the learning curve is steep and the documentation is still not too detailed or understood. I found most of the work like a shot in the dark at first, and you need to look at the examples to understand how it behaves. If your ever considered using Trigger.io, they have a Famo.us integration which will take care of the UI things that are missing in first place.

That said, it is a good choice when building complex user experience animations, and you should definitely keep track of their work; they are growing fast and in a good direction.

3 FrameWork 7

About a year ago when I started working on my startup I was looking for a strong UI framework that had enough components ready so I wouldn‘t have to mess with unnecessary headaches. This was just before Ionic Framework released and caught my eyes.

F7 is a “Full Featured HTML Framework For Building iOS Apps” (as written in their website) - and that was the reason I couldn’t use it: because it is not cross-platform.

Never the less, F7 is great for building hybrid iOS applications. It provides a full set of UI components that are exactly what you would expect when opening a native iOS application.

Unlike Ionic and the Famou.us + Angular combination, you would have to use the F7 MVC framework that comes built in for creating an F7 application.

Starting an application in Framework 7 is simple, so let‘s do it:

$> mkdir f7 && cd f7
$> bower install framework7
Get expert bash help

This will create the bower_components directory with the source code of F7.

In order to start, we would actually need to create a basic HTML file (which is available for copy-paste right here), unlike Ionic or OnsenUI that give us nice basic templates.

Click on the picture to see on CodePen: 

Pros Cons
Near perfect iOS UX Not Cross-Platform
Many Utils Using its own MVC framework.
Easy to start Not widely use
  No ‘starting-kit‘
Subject Score
Documentation 9.0
Fast Start 7.0
Performance 6.0
Community 4.0
Learning Curve 9.0

Side note: when developing with F7 you need to put the files in your web server’s directory and work from the server (localhost). F7 uses AJAX calls in order to move between pages which means you need a web server running. This is not needed when deploying for PhoneGap/Cordova.

4 OnsenUI

OnsenUI is an Ionic competitor. It also comes with AngularJS support and provides the same solution as the Ionic team meant to build. OnsenUI was born as an answer for PhoneGap & Cordova developers who were struggling with the UI when starting a project, as the internet lacks in mobile UI frameworks.

The first thing I noticed when starting to test OnsenUI is that its “getting started” guide is not quite clear. The templates they created are not hosted in a repository (such as git), and you have to download them in order to use them. So if there‘s a bug or a problem, you can’t write an issue report, or -- even if you want to -- solve it and submit a pull request for other poor developers who encountered the same issue. If the template was upgraded, its not easy to update it on your side.

A nice feature of OnsenUI is the ability to choose the colors and basic component styling online, and then download the result to get a better starting point (instead of changing CSS yourself). You can also use the Monaca IDE to create a project with a custom template without the need to download the files.

Lets take a closer look on what we have to do to start a project.

We’ll navigate to “getting started” section, and choose ourselves a nice template. Let‘s choose the tab-bar.

When you unzip the file you will see a standard Cordova / PhoneGap directory structure; we are interested in the www directory.

Lets go back to their website and choose a different color scheme:

I chose the dark theme, now lets download it and see what we got in the zipped file:

onsen-css-components.css
onsen-css-components.min.css
stylus/
    components/
        button-bar.styl
     → button.styl
     → checkbox.styl
     → global.styl
     → index.styl
     ……
  -- default.styl
Get expert markup help

In order to change the theme, simply go back to the OnsenUI directory you‘ve downloaded before, and replace the CSS files in www/lib/onsen/css.

Now, replace the downloaded stylus directory with the directory found under www/lib/onsen/stylus. Now refresh the browser, and you will see the theme changed.

Like the Ionic Framework, OnsenUI provides a nice set of directives (custom HTML elements) that helps you to focus on business logic instead of inventing the wheel yourself.

When comparing to Ionic, there are two things to look at. First of all, Ionic‘s community is way more active, and that pushes it to be even a better framework as there are a lot of contributors.

The second thing is the framework itself. While both provide many directives as utils (pull to refresh, lists, tabs, menus, etc.), Ionic takes it a bit more seriously and lets you inject services into the AngularJS side and control these directives. I haven‘t checked out the difference in their performance, but I can tell that Ionic now focuses their whole energy in making it more performant, starting with the collection-repeat directive.

Pros Cons
Cross-Platform, Cordova/PhoneGap friendly Not Cross-Platform
Many Utils Using its own MVC framework.
AngularJS Compatible Not widely use
Easy to customize  
Subject Score
Documentation 7.0
Fast Start 9.0
Performance 5.0
Community 3.0
Learning Curve 9.0

5 Material Design

Material design is a Google concept for developing UI in native applications starting with Android L. They started a project in AngularJS alongside the Ionic team. Their goal is to provide a set of AngularJS-native UI elements that implement the material design system. It looks promising, but it‘s too early to talk about or even show you some examples. You can check out their status and examples at http://material.angularjs.org/ - and you should definitely keep track of it.

6 Conclusion

The real competition for me is Famo.us vs. Ionic Framework -- they are both aiming for the same target: providing a native-like UI framework for building hybrid applications. But they addressed their target differently.

While the Ionic team started from the UI end so you could start an application and immediately have a basic skeleton with lots of UI components and features, they are now trying to fix their performance issues. On the other hand, Famo.us started from the performance, efficiency, physics and animations end, and are now starting to think about brining a full UI package.

When choosing a framework, in any technology -- whether it is your front-end or back-end -- it is always important to remember what you are trying to achieve.

Are you building an iOS-only application, or is it cross-platform? Are you trying to make impressive animations and transitions and smooth UX? Do you want to deploy your product fast? Does your target audience have high-end mobile devices, or are they mostly using old phones?

When you figure these questions out, the answer will be right in front of you. I chose Ionic as my favorite, because I needed to deploy my MVP fast, it is AngularJS based, and it provides a lot of cool features like pull to refresh, infinite loading, slide-boxes, and much more that saved me countless hours.

Even more importantly, it is supported by a large community, making me focus on the business logic and not worry about developing the whole UI myself. Never the less, Famo.us is on the right track and I really think that in the near future we could see great things come out of it.

Read more at http://www.airpair.com/ionic-framework/posts/hybrid-apps-ionic-famous-f7-onsen#f6ez2PhVJGe0E53d.99

时间: 2024-10-09 16:47:58

Hybrid UI framework shootout: Ionic vs. Famo.us vs. F7 vs. OnsenUI的相关文章

Android UI framework architecture

1.http://elinux.org/images/d/dc/Inside_Android's_User_Interface.pdf 2.http://stackoverflow.com/questions/7776115/android-gui-architecture-relation-between-surface-view-window-canvas 3.https://himmele.googlecode.com/svn/trunk/Google%20Android/Android%

C++ UI framework

Name platform Description MFC windows http://en.wikipedia.org/wiki/Microsoft_Foundation_Classes WTL windows http://en.wikipedia.org/wiki/Windows_Template_Library Owl Windows outdated vcl Windows Outdated, cannot used by vc/gcc? smartWin++ windows htt

[Selenium+Java] Selenium Framework: Keyword Driven &amp; Hybrid

Original from: https://www.guru99.com/creating-keyword-hybrid-frameworks-with-selenium.html What is Selenium Framework? Selenium Framework is a code structure that helps to make code maintenance easy. Without frameworks, we will place the “code” as w

Android应用开发之Hybrid

什么是Hybrid? 从用户的角度来看,Hybrid的app和native的app并没有明显的区别.他们从app store下载或安装apk,打开app开始使用,这一切都是一样的,而且两者都包含各种类型的应用,游戏.社交.电商等等.最重要的是,用户根本不关心你是Hybrid还是native,他们只想要安装一个自己喜欢的应用,并开始使用. Native与Hybrid的本质区别是构建方式的不同,这些不同主要体现在应用框架和语言两方面. Android Native所使用的语言大家都知道,主要是Jav

第一章:hybrid app开发之技术选型

伴随着移动互联网的兴起,越来越多的企业将部分资源投入其中,想在互联网+的大潮中分一杯羹,并期望着站在风口上,成为时代的弄潮儿. 现在不会做一个app都不好意思说是搞互联网的,那么开发一个app的方式有哪些呢?基于目前市面上比较流行的app都是基于android和ios的,所以我们只针对这两种平台谈app:虽然也有其他平台,但鉴于市场占有率,不纳入本系列的范围. 第一种方式:native app IOS:基于XCode开发工具,使用Swift或者OC开发语言,来进行原生态的IOS应用的开发. An

Ionic框架入门(原文翻译)

注: 从未做过翻译,打算学学Ionic框架,从网上未找到中文资料,看到官网上有一个入门资料,所以打算试着用自己半瓶子的英语做个翻译尝试.这是一个有些痛苦与长期的过程.翻译一部分,放一部分吧,一点一点的来.,原文地址:The Ionic Book The Ionic Book Ionic框架入门 Welcome to the official Ionic Book, where we will walk through the process of getting Ionic and all it

【开源】浅谈Hybrid技术的设计与实现第二弹

前言 接上文:浅谈Hybrid技术的设计与实现(阅读本文前,建议阅读这个先) PS:据说加个开源在前面阅读量高点,于是就试试咯...... 上文说了很多关于Hybrid的概要设计,可以算得上大而全,有说明有demo有代码,对于想接触Hybrid的朋友来说应该有一定帮助,但是对于进阶的朋友可能就不太满足了,他们会想了解其中的每一个细节,甚至是一些Native的实现,小钗这里继续抛砖引玉,希望接下来的内容对各位有一定帮助. 进入今天的内容之前我们首先谈谈两个相关技术Ionic与React Nativ

[App]App Framework

-------------------------------------------------------------------------------------------------------- Intel's App Framework The JavaScript library for mobile HTML5 app development App Framework is built from the grounp up to be light and excel on

device framework(设备框架)

Table A-1  Device frameworks Name First available Prefixes Description Accelerate.framework 4.0 cblas, vDSP Contains accelerated math and DSP functions. See Accelerate Framework. Accounts.framework 5.0 AC Contains interfaces for managing access to a