Which solution to build a modern mobile application ?
The contenders
1. Hybrid solutions
Concept: the same development stack as web applications: HTML, CSS, JavaScript.
The application is rendered in the mobile using a "web view" (a web browser embedded in the mobile application)
Usually, the UI is not as smooth as a real native application but animations in the browser have improved a lot recently and it is hard to see the difference.
Plugins (Cordova) are used to communicate with device feature (like the camera, the battery level...)
A building process creates the application for either Android or iOS. Then the application can be uploaded to iTunes or GooglePlay.
Strong points: hybrid applications are easy to test since they can run in the browser (except device specific features, of course).
You can use the same code base to build a web site and a mobile application.
A comparison of mobile frameworks: here
A. ionic
- Very popular (+18K Github stars)
- Built on top of AngularJS and some Angular tools like angular-ui router
An other solution, based on ionic: Supersonic. No public repository :(
B. reapp.io
- Built on top of ReactJS and Webpack (the stack of the moment!)
- Not much activity over the last 3 months (only 2.5k stars)
2. React Native
Concept: build an application using only React components
No HTML: only React components that map iOS components.
For example <Text><Text>
to create an inline element (the equivalent of a <span>
tag in HTML), or <View></View>
to create a block element (<div>
).
No CSS: JavaScript objects are used to style objects.
- Easy to setup on Mac, you can have an application running in 5 minutes.
- Only available for iOS (at least now)
- 16K stars since it was released in March... this is insane!
3. NativeScript
Concept: build an application from JavaScript, XML for views and a subset CSS. Generate real native components, it is does run a simple web view like the hybrid solution.
- Not locked to any framework, you can use whatever you want.
- Comes with its own double-way binding system to connect views (XML) and data.
- 3.9K stars, it is slowly becoming popular.
- TODO: check by myself!
To sum up
Solution | 100% Native | React Native | NativeScript | Hybrid (WebView) |
---|---|---|---|---|
Languages | Swift | React, JS | XML, JS, CSS | HTML5, CSS, JS |
Platform | only iOS | only iOS | iOS and Android | iOS and Android |
The future: Web workers ?
Use web workers to create rich web applications ? (with offline storage, background processes...)
Note: it seems to be not supported in Firefox 38 ?