Upload
carlo-bernaschina
View
278
Download
0
Embed Size (px)
Citation preview
MILANO 1863 POLITECNICO
Cross-Platform Development Frameworks
REASONS AND COMPARISONS
Carlo Bernaschina – [email protected]
There is an increasing number of mobile platforms available on smartphones and tablets:
• Android
• iOS
• Windows Phone
• Symbian
• BlackBerry
• Meamo > MeeGO > Tizen / Sailfish
• Ubuntu Touch
• Firefox OS
• …
Background MOBILE PLATFORMS
Android and iOS lead the market with more than 90%
of the share.
Is it worthy to take explicitly into account other
platforms?
Background MARKET SHARE 2015
The major platforms support different programming
languages:
• iOS (Swift, Objective-C, C/C++)
• Android (Java, C/C++)
• Windows Phone (.Net (C# VB.NET), C++)
• Ubuntu Touch (QML/JavaScript, C++)
• Firefox OS (JavaScript)
• …
Background OFFICIAL PLATFORM SUPPORT TO PROGRAMMING LANGUAGES
The major platforms support different UI Frameworks,
some of them are even custom built for those
platforms:
• iOS (Custom)
• Android (Custom)
• Windows Phone (WPF/XAML)
• Ubuntu Touch (QML)
• Firefox OS (HTML+CSS)
• …
Background OFFICIAL PLATFORM SUPPORT TO UI FRAMEWORKS
Is it possible to develop applications that with small or
no effort can run on the major Mobile Platforms?
How?
The Question
The most common cross-platform development
framework are:
• Qt Mobile
• Xamarin
• Flutter
• Appcelerator Titanium
• Apache Cordova
Cross-Platform Frameworks THE MOST COMMON CROSS-PLATFORM FRAMEWORKS
Qt is a C/C++ cross-platform application framework
that is widely used in desktop and embedded
environments.
In version 5.1 (July 2013) an experimental support for
Android and iOS has been introduced with a new set of
APIs devoted to the management of mobile devices.
Qt-Mobile
Qt Mobile is mainly based on the new QML UI
language.
QML allows to define the UI of the application
declaratively and to use JavaScript for the definition of
scripts that respond to events related to UI
components.
It is possible to expose APIs developed in C/C++ to the
JavaScript code.
Qt-Mobile HOW IT WORKS
• SUPPORTED PLATFORMS Android, iOS, Windows Phone, Windows RT, BlackBerry10 and Sailfish
• PROGRAMMING LANGUAGES JavaScript, C/C++
• UI Framework Qt Quick (QML)
• NATIVE UI No, but native look and feel can be reached with themes
• PERFORMANCE Native (It is native C/C++ code)
• WORA? (Write Once Run Anywhere) Yes
Qt-Mobile FEATURES
• You do not require access to native UI Components,
but want a native look and feel
• Your application requires high levels of performance
• You already have QML based UI components to use
• You already have Qt C/C++ code that can be easily
reused in your application
Qt-Mobile WHEN TO USE IT
Xamarin is a cross-platform application framework
based on C#.
It has been presented in 2011 with initial support for
Android and iOS.
Xamarin
Xamarin applications use a C# JIT compiler to allow
the code to run on the different platforms.
The C# classes can be easily shared without
modifications.
It is possible to access UI Native components and
Native APIs but that part of the application need to be
adapted for each target platform.
Xamarin HOW IT WORKS
• SUPPORTED PLATFORMS Android, iOS, Windows Phone
• PROGRAMMING LANGUAGES C#, VB.net (just for libraries)
• UI Framework Custom Framework (Native Wrapper)
• NATIVE UI Yes
• PERFORMANCE Native (the JIT compiler generates native binaries)
• WORA? (Write Once Run Anywhere) No* (but majority of the code can be shared)
Xamarin FEATURES
* It is under development a XAML cross-platform library that allows to share application views
• You do require access to native UI Components
• Your application requires high levels of performance
• You already have C# code that can be used in your
application
• Business logic code is much more than the UI one.
Xamarin WHEN TO USE IT
Flutter is a cross-platform application framework
based on Dart.
It has been presented at Google I/O 2016 with support
for Android and iOS.
Flutter
Flutter applications the Dart VM to allow precompiled
code to run on the different platforms.
Flutter has some interesting new features:
• Integrated profiler/debugger (Observatory)
• Hot Reload of applications reload the code without loosing the current state.
Flutter HOW IT WORKS
• SUPPORTED PLATFORMS Android, iOS
• PROGRAMMING LANGUAGES Dart
• UI Framework Custom Widget Based Framework
• NATIVE UI No (Material Design)
• PERFORMANCE The AOT compiler generates native code
• WORA? (Write Once Run Anywhere) Yes
Flutter FEATURES
• You do plan to develop a Material Design app
• Your application requires high levels of performance
Flutter WHEN TO USE IT
Appcelerator is a cross-platform application
framework based on JavaScript.
It has been presented in December 2008 as an
alternative to adobe air for desktop applications.
In June 2009 it added first support for iOS and Android.
Appcelerator Titanium
Appcelerator Titanium uses a JavaScript VM to allow
code portability between platforms.
It is possible to access UI Native components and
Native APIs but that part of the application need to be
defined for each target platform.
Appcelerator Titanium HOW IT WORKS
• SUPPORTED PLATFORMS Android, iOS, Windows Phone
• PROGRAMMING LANGUAGES JavaScript
• UI Framework Custom Framework (Native Wrapper)
• NATIVE UI Yes
• PERFORMANCE Not at native level (JavaScript is interpreted)
• WORA? (Write Once Run Anywhere) No (write once, adapt everywhere)
Appcelerator Titanium FEATURES
• You do require access to native UI Components
• Your application does not require high levels of
performance
• You already have JavaScript code that can be used
in your application
• Business logic code is much more than the UI one.
Appcelerator Titanium WHEN TO USE IT
Cordova is a cross-platform mobile application
framework based on Web Technologies.
It has been presented in 2011 while officially graduated
in October 2012 as a top level project within the
Apache Software Foundation (ASF).
It is the base framework for other projects like
PhoneGap or Intel XDK
Apache Cordova
Cordova instantiate a WebView, a component
common to all the platforms that allows to incorporate
a Web Browser inside an application, and loads inside
it static HTML, CSS and JavaScript assets.
It is not possible to access UI Native components,
while it is possible to access Native APIs via plugins
that expose a common interface regardless to the
underling platform.
Cordova HOW IT WORKS
• SUPPORTED PLATFORMS Android, iOS, Windows Phone, BlackBerry OS, Ubuntu OS, Firefox OS, WebOS, FireOS
• PROGRAMMING LANGUAGES JavaScript
• UI Framework Web UI Frameworks (HTML / CSS, …)
• NATIVE UI No (There are some CSS frameworks that mimic the native components)
• PERFORMANCE Not at native level (JavaScript is interpreted)
• WORA? (Write Once Run Anywhere) Yes
Cordova FEATURES
• You do not require access to native UI Components
• Your application does not require high levels of
performance
• You already have HTML / CSS templates and
JavaScript code that can be used in your application
Cordova WHEN TO USE IT
• https://www.netmarketshare.com/operating-system-market-share.aspx?qprid=8&qpcustomd=1
• https://developer.apple.com/library/prerelease/watchos/documentation/Swift/Conceptual/Swift_Programming_Language/
• https://developer.android.com/ndk/guides/concepts.html
• https://msdn.microsoft.com/en-us/library/windows/apps/ff626516(v=vs.105).aspx
• https://developer.ubuntu.com/en/apps/qml/
• https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS
• http://www.qt.io/mobile-app-development/
• https://xamarin.com/platform
• https://developer.xamarin.com/guides/cross-platform/application_fundamentals/pcl/portable_visual_basic_net/
• https://github.com/flutter/flutter/wiki/Early-Access:-Hot-Reload
• https://flutter.io
• http://docs.appcelerator.com/platform/latest/#!/guide/Titanium_Platform_Overview
• https://cordova.apache.org/docs/en/5.1.1/guide/overview/
Reference