39
Department of Computer Science Institute for System Architecture, Chair for Computer Networks Application Development for Mobile and Ubiquitous Computing 10. Cross-Platform Development Dr. Ing. Thomas Springer Technische Universität Dresden Chair of Computer Networks

Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Department of Computer Science Institute for System Architecture, Chair for Computer Networks

Application Development for Mobile and Ubiquitous Computing

10. Cross-Platform Development

Dr. Ing. Thomas Springer Technische Universität Dresden

Chair of Computer Networks

Page 2: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Adaptation and

Context-

awareness

Mobile Internet

Mobile Middleware

Application Development

Enabling Technologies and Challenges

Disconnected

Operations

Mobile

Databases

Location-

based

Services

Communication

Mechanisms

Android iOS

.Net Compact

Framework/

Windows

Phone 7

Mobile

Web AppsJava ME

Cross-Platform Development

Mobile Business Apps

Lecture Structure

Dr. Thomas Springer Slide 2 Application Development - 10. Cross-Platform Development

Page 3: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Strong fragmentation of market for mobile device platforms

Market changes quickly

High update rate

• Device features

• Platform APIs

Dr. Thomas Springer 3 Application Development - 10. Cross-Platform Development

Why Cross-Platform Development?

Page 4: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Why Cross-Platform Development?

Dr. Thomas Springer 4 Application Development - 10. Cross-Platform Development

Mobile Device

Hardware

Operating System

CLDC

Configuration, KVM

Midlet Suite Midlet Suite ...

MIDP Profile

Optional Packets

Mobile Device

Dalvik VM +

Core libraries

Hardware

Libraries

App

.apk

App

.apk...

Application Framework

Linux Kernel

Mobile Device

Hardware

App

.ipa

App

.ipa...

Media

Mach/BSD Kernel

Custom Frameworks

UIKit

FoundationCore Services

Cocoa Touch

Mobile Device

Hardware

App

.xap

App

.xap...

App Model

Hardware Foundation

Silverlight

Kernel

UI ModelCloud

Integration

XNA HTML/JavaScript

Common Language Runtime

Frameworks

Java ME

Project

Android

Project

iOS

Project

Windows Phone

Project

Page 5: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

High development effort

• Know-how for multiple platforms

• High update rates of technology

• Customers don‘t pay per platform but for project

Short time to market

• Fast support of platform changes/new platforms

High maintenance effort

• Manage multiple code bases

• Avoid inconsistencies

Mobility Support

Dr. Thomas Springer 5 Application Development - 10. Cross-Platform Development

Problem description

Page 6: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Write once, run everywhere?

Dr. Thomas Springer 6 Application Development - 10. Cross-Platform Development

Mobile Device

Hardware

Operating System

CLDC

Configuration, KVM

Midlet Suite Midlet Suite ...

MIDP Profile

Optional Packets

Mobile Device

Dalvik VM +

Core libraries

Hardware

Libraries

App

.apk

App

.apk...

Application Framework

Linux Kernel

Mobile Device

Hardware

App

.ipa

App

.ipa...

Media

Mach/BSD Kernel

Custom Frameworks

UIKit

FoundationCore Services

Cocoa Touch

Mobile Device

Hardware

App

.xap

App

.xap...

App Model

Hardware Foundation

Silverlight

Kernel

UI ModelCloud

Integration

XNA HTML/JavaScript

Common Language Runtime

Frameworks

Cross-Platform

Project

Page 7: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

How can we achieve it?

Dr. Thomas Springer 7 Application Development - 10. Cross-Platform Development

Mobile Device

Hardware

Operating System

CLDC

Configuration, KVM

Midlet Suite Midlet Suite ...

MIDP Profile

Optional Packets

Mobile Device

Dalvik VM +

Core libraries

Hardware

Libraries

App

.apk

App

.apk...

Application Framework

Linux Kernel

Mobile Device

Hardware

App

.ipa

App

.ipa...

Media

Mach/BSD Kernel

Custom Frameworks

UIKit

FoundationCore Services

Cocoa Touch

Mobile Device

Hardware

App

.xap

App

.xap...

App Model

Hardware Foundation

Silverlight

Kernel

UI ModelCloud

Integration

XNA HTML/JavaScript

Common Language Runtime

Frameworks

Cross-Platform

Project

Page 8: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Heterogeneous Hardware

• Form factors

• Resources

• Device features (touch input, buttons, connectivity, sensors, …)

Heterogeneous Software Platforms

• Execution environment

• Programming languages

• Platform APIs, UI Kit

• App anatomy and programming model

• Tool chains

• Deployment and verification process

User expectations

• Look and Feel

• Design guidelines

Mobility Support

Dr. Thomas Springer 8 Application Development - 10. Cross-Platform Development

Challenges

Page 9: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

A device platform is a combination of device hardware, operating system, runtime system, libraries, and frameworks forming a standard execution environment for applications on devices which run that platform.

A device platform has a characteristic set of features:

• Specific „look and feel“ (UI guidelines and interaction concepts)

• App runtime defining app anatomy and lifecycle

• Developer tool chain (programming languages, libraries, APIs)

• Specific app distribution and deployment process

Native Code is code which can be directly executed within the standard execution environment of the device platform. It has full access to the platforms libraries and frameworks, possibly also to operating system APIs and hardware features.

Dr. Thomas Springer 9 Application Development - 10. Cross-Platform Development

Terms and Definitions Device Platform

Page 10: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

An App is a specific type of applications created for and running on a particular device platform.

A Native App is an App which is created for and can be deployed and started on a device platform whithout any further dependencies.

A Mobile App is typically created for and running on a mobile device platform. It‘s started from the home screen, supports graphically-oriented interactions and occupies the full screen.

Dr. Thomas Springer 10 Application Development - 10. Cross-Platform Development

Terms and Definitions App

Page 11: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Mobile App Types

Dr. Thomas Springer 11 Application Development - 10. Cross-Platform Development

Device Platform

Interpreter

Cross-Platform App

(+ Native Ext.)

Cross-Platform API

Native

Code

Interpreted

App

Web

browser

Web App

Hybride App

Page 12: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

What to start with?

Dr. Thomas Springer 12 Application Development - 10. Cross-Platform Development

Cross-Platform Development Approaches

Execution PhaseBuild PhaseImplementation

Phase

Mobile

Device

Source

Code Executable

Program

Design Phase

Model

GUILogic

GUILogic

Page 13: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Model-driven Development

Dr. Thomas Springer 13 Application Development - 10. Cross-Platform Development

Cross-Platform Development Approaches

Execution PhaseBuild PhaseImplementation

Phase

Model-to-Model-

Transformation

Mobile

Device

Source

Code Executable

Program

Design Phase

Model

GUILogic

GUILogic

Model-to-Code-Transformation

Interpretation

Page 14: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Cross-compilation to native code

Dr. Thomas Springer 14 Application Development - 10. Cross-Platform Development

Cross-Platform Development Approaches

Execution PhaseBuild PhaseImplementation

Phase

Machine

Code

Cross-Compilation / JIT-Compilation

Model-to-Model-

Transformation

Execution

Mobile

Device

Source

Code Executable

Program

Design Phase

Model

GUILogic

GUILogic

Model-to-Code-Transformation

Interpretation

Page 15: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Support for abstract runtime

Dr. Thomas Springer 15 Application Development - 10. Cross-Platform Development

Cross-Platform Development Approaches

Execution PhaseBuild PhaseImplementation

Phase

Machine

Code

Byte Code

Cross-Compilation / JIT-Compilation

Model-to-Model-

Transformation

Interpretation

AOT- / JIT-Compilation

Execution

Compilation

Mobile

Device

Source

Code Executable

Program

Design Phase

Model

GUILogic

GUILogic

Model-to-Code-Transformation

Interpretation

Page 16: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Script languages

Dr. Thomas Springer 16 Application Development - 10. Cross-Platform Development

Cross-Platform Development Approaches

Execution PhaseBuild PhaseImplementation

Phase

Machine

Code

Byte Code

Cross-Compilation / JIT-Compilation

Model-to-Model-

Transformation

Interpretation

Interpretation

AOT- / JIT-Compilation

Execution

Compilation

Mobile

Device

Source

Code Executable

Program

Design Phase

Model

GUILogic

GUILogic

Model-to-Code-Transformation

Interpretation

Page 17: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Translate to other programming languages

Dr. Thomas Springer 17 Application Development - 10. Cross-Platform Development

Cross-Platform Development Approaches

Execution PhaseBuild PhaseImplementation

Phase

Machine

Code

Byte Code

Cross-Compilation / JIT-Compilation

Model-to-Model-

Transformation

Source-to-Source-Translation

(Code Transformation)

Interpretation

Interpretation

AOT- / JIT-Compilation

Execution

Compilation

Mobile

Device

Source

Code Executable

Program

Design Phase

Model

GUILogic

GUILogic

Model-to-Code-Transformation

Interpretation

Page 18: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Cross-Platform Development Approaches

Dr. Thomas Springer 18 Application Development - 10. Cross-Platform Development

Execution PhaseBuild PhaseImplementation

Phase

Machine

Code

Byte Code

Cross-Compilation / JIT-Compilation

Model-to-Model-

Transformation

Source-to-Source-Translation

(Code Transformation)

Interpretation

Interpretation

AOT- / JIT-Compilation

Execution

Compilation

Mobile

Device

Source

Code Executable

Program

Design Phase

Model

GUILogic

GUILogic

Model-to-Code-Transformation

Interpretation

Page 19: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Translation Approach

Dr. Thomas Springer 19 Application Development - 10. Cross-Platform Development

Translation Approach

Execution PhaseBuild PhaseImplementation

Phase

Machine

Code

Byte Code

Cross-Compilation / JIT-Compilation

Model-to-Model-

Transformation

Source-to-Source-Translation

(Code Transformation)

Interpretation

Interpretation

AOT- / JIT-Compilation

Execution

Compilation

Mobile

Device

Source

Code Executable

Program

Design Phase

Model

GUILogic

GUILogic

Model-to-Code-Transformation

Interpretation

Page 20: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Interpretation Approach

Dr. Thomas Springer 20 Application Development - 10. Cross-Platform Development

Interpretation Approach

Translation Approach

Execution PhaseBuild PhaseImplementation

Phase

Machine

Code

Byte Code

Cross-Compilation / JIT-Compilation

Model-to-Model-

Transformation

Source-to-Source-Translation

(Code Transformation)

Interpretation

Interpretation

AOT- / JIT-Compilation

Execution

Compilation

Mobile

Device

Source

Code Executable

Program

Design Phase

Model

GUILogic

GUILogic

Model-to-Code-Transformation

Interpretation

Page 21: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Web-based Approach

Dr. Thomas Springer 21 Application Development - 10. Cross-Platform Development

Interpretation Approach

Translation Approach

Execution PhaseBuild PhaseImplementation

Phase

Machine

Code

Byte Code

Cross-Compilation / JIT-Compilation

Model-to-Model-

Transformation

Source-to-Source-Translation

(Code Transformation)

Interpretation

Interpretation

AOT- / JIT-Compilation

Execution

Compilation

Mobile

Device

Source

Code Executable

Program

Design Phase

Model

GUILogic

GUILogic

Model-to-Code-Transformation

Interpretation

Web-based Approach

Page 22: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Hybrid Approach

Dr. Thomas Springer 22 Application Development - 10. Cross-Platform Development

Interpretation Approach

Translation Approach

Execution PhaseBuild PhaseImplementation

Phase

Machine

Code

Byte Code

Cross-Compilation / JIT-Compilation

Model-to-Model-

Transformation

Source-to-Source-Translation

(Code Transformation)

Interpretation

Interpretation

AOT- / JIT-Compilation

Execution

Compilation

Mobile

Device

Source

Code Executable

Program

Design Phase

Model

GUILogic

GUILogic

Model-to-Code-Transformation

Interpretation

Web-based Approach

Hybrid Approach

Page 23: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Model-driven Approach

Dr. Thomas Springer 23 Application Development - 10. Cross-Platform Development

Interpretation Approach

Translation ApproachModel-driven Approach

Execution PhaseBuild PhaseImplementation

Phase

Machine

Code

Byte Code

Cross-Compilation / JIT-Compilation

Model-to-Model-

Transformation

Source-to-Source-Translation

(Code Transformation)

Interpretation

Interpretation

AOT- / JIT-Compilation

Execution

Compilation

Mobile

Device

Source

Code Executable

Program

Design Phase

Model

GUILogic

GUILogic

Model-to-Code-Transformation

Interpretation

Web-based Approach

Hybrid Approach

Page 24: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Many tools and approaches

Dr. Thomas Springer 24 Application Development - 10. Cross-Platform Development

Page 25: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Dr. Thomas Springer 25 Application Development - 10. Cross-Platform Development

Example EMODE Model-Driven Approach

Execution PhaseImplementation/Build Phase

JavaME

Design Phase

RefinementAbstract Design

Task Model

Concept

Model

Abstract UI

Model

Functional-

Core-Adapter

Model

Context-

Model

Concrete UI

Model

Executable

Task Model

FCA-Code

Context-

Provider-

Code

Source Code

Interpretation

(EMODE-Runtime

Environment)

other

Platforms

...

M-M

M-M

M-M

M-C

M-C

M-C

M-C

M-M = Modell-to-Modell-Transformation

M-C = Modell-to-Code-Transformation

Step-wise design and refinement

Models for UI and application logic

Integrated tool environment to consistently develop UI and application logic

Page 26: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Qt C++ as source

Virtual GUI toolkit

Cross-platform libraries allow access to many device specific features (camera, contacts, Maps, GPS, Sensors, etc.)

Qt Quick allows declarative description of touch-based UIs

• Interpreted in special runtime engine

Currenty only Symbian, Maemo and MeeGo supported (Prototype for Android)

Dr. Thomas Springer 26 Application Development - 10. Cross-Platform Development

Qt Translation Approach

Execution phaseBuild phaseImplementation

phase

Qt C++-

Sourcecode

C++-

Sourcecode

...

Execution

Preprocessor

Machine

codeSymbian,

MeeGo,

Maemo,

Windows,

Linux,

Mac OSMachine

code

...

Cross-

Compilation

Execution

Page 27: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

JavaME as common code base

Parameterized code to customize code for different platforms

Source-to-Source Transaltion to various programming languages

Transformed code can be further edited

Compatibility libraries per platform to bridge API-gap

No IDE, but translation scripts, compatibility lib and cross-compiler

Dr. Thomas Springer 27 Application Development - 10. Cross-Platform Development

Bedrock Translation Approach

Execution PhaseBuild phase

JavaME-

Source Code

Implementation

Phase

JavaME-

Source Code

Source-to-Source-

Translation C++-Source

Code

Java-Source

Code

(Android)

Dalvik-

Bytecode

Machine

code

Machine

code

C#-

Source Code

ActionScriptActionScript-

Bytecode

CIL-Code

CIL-Code

HTML5,

JavaScript

JavaME

BlackBerry

Android

iOS,

Bada,

Symbian,

WinMobile,

webOS,

BREW, ...

Windows

Phone

Windows

Desktop

(.NET)

Flash Player

Browser

JavaME-

Bytecode

BlackBerry-

Bytecode

...

...

Realisation in Bedrock Integration of Platform-SDKs

Compilation

Compilation

Compilation

Cross-Compilation

Cross-Compilation

Compilation

Compilation

Compilation

Interpretation

Interpretation

Interpretation

Interpretation

Interpretation

Interpretation

Interpretation

Execution

Execution

Code-Transformation,

Compatibility Libraries

Page 28: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Approach using m:1:n language translation

XML as common language for byte code based on Java Bytecode

Transformation based on XML Stylesheets

Compatibility libraries used to port apps (even from Android to iOS)

Dr. Thomas Springer 28 Application Development - 10. Cross-Platform Development

XMLVM Translation Approach

Execution phaseBuild phaseImplementation

phase

covered by XMLVM

(Xcode: Cross-Compilation to

executable code)

Interpretation

Java-

BytecodeJava-Platform

.NET-Platform

iOS

Browser

XMLVM-

JVM

(XML)

JavaScript-

Sourcecode

C/C++-

Sourcecode

Interpretation

InterpretationCLI-

Bytecode

BCEL

DX

XSL

XSL

MBEL

Interpretation

Cross-Compilation ...

...

Objective-C-

Sourcecode

Python-

Sourcecode

XMLVM-CLR

(XML)

XMLVM-DEX

(XML)

Java-

Bytecode

Java-

Sourcecode

Compilation

Compilation

CLI-

Bytecode

XMLVM-

CLR, -DFA

(XML)

.NET-

Sourcecode

(C#, VB, ...)

Ruby(YARV)-

Bytecode

Ruby-

Sourcecode

Compilation

Ruby

BCEL

XSL

MBEL

BCEL = Byte Code Engineering Library

MBEL = Microsoft Bytecode Engineering Library

Page 29: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Specific AIR runtime engine + libraries

GUI declaratively described in MXML (special extensions to support touch-based interactions)

GUI description compiled to ActionScript code

Dr. Thomas Springer 29 Application Development - 10. Cross-Platform Development

Adobe Air Interpretation Approach

Execution phaseBuild phaseImplementation

phase

ActionScript-

Sourcecode

ActionScript-

Bytecode

Compilation

Machine

code

...

Interpretation

(AIR-runtime need to

be installed)

ExecutionAOT-Compilation

Interpretation

(AIR-runtime need to

be installed)

Android,

Windows,

Linux,

Mac OS

iOS

TV

BlackBerry

Tablet OS

Page 30: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Ruby, HTML, CSS and JavaScript as common code base in one project

Application bundled with lightweight web server + Rhodes Ruby Framework + Ruby VM

Dr. Thomas Springer 30 Application Development - 10. Cross-Platform Development

Rhodes Mobile Interpretation Approach

Execution PhaseBuild PhaseImplementation

Phase

Interpretation

(bundled VM)

InterpretationBlackBerry

Compilation

Compilation

Ruby-

Bytecode

BlackBerry-

Bytecode

iOS

Android

WinMobile

Interpretation

(Browser-Engine of Platform,

WebView)

One Cross-platform

Project

Ruby-

Source code

HTML-, CSS-,

JavaScript-

Source Code

Page 31: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Supports development of client and server side code for Web-Applications in Java

Source-to-Source translation to HTML, JavaScript and CSS (High-leve Translator

JavaScript Code optimized for various browsers

Mobile support with specific extensions of GWT libraries (GWTMobile, GWT-Mobile-Webkit)

Dr. Thomas Springer 31 Application Development - 10. Cross-Platform Development

Google Web Toolkit (GWT) Web-based Approach

Execution phaseBuild phase Implementation

phase

Java-Source

Code (Client)

JavaScript-,

HTML-, CSS-

Source Code

Interpretation

Interpretation

Browser

(Client)

Java-Platform

(Servlet

Container /

Google App

Engine)

Source-to-Source-

Translation

Java-

Bytecode

CompilationJava-Source

Code (GWT

Servlet)

Page 32: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Phone Gap Hybrid Approach

Apache Cordova (formerly PhoneGap)

• Cross-platform tool to create mobile apps based on HTML, CSS and Javascript

• Combination of Web-based and Translation approach

• Supported platforms: iOS, Android, Windows Phone 7 and 8, BlackBerry OS and bada

• Approach:

o web content wrapped in PhoneGap App

o Native code to create native browser UI element (UIWebView (iOS) or WebView (Android))

o and present locally stored web content

Runnable as App

Deployment via App Stores possible

Page 33: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Web-technologies to create UI + logic

Cross-platform PhoneGap Javascript API to access device specific features

Wrapped to native code

Often used in combination with Mobile Web Application Frameworks like jQuery Mobile or Sencha Touch

Native UI elements not supported

Phone Gap Approach

HTML, CSS, JavaScript

iOS PhoneGap Bib

(JavaScript)

iOS PhoneGap Bib

(Nativ)

PhoneGap Cross-Platform-API for JavaScript

(Nativer Wrapper

Code)

iOS-Plattform-API

Android PhoneGap

Bib (JavaScript)

Android PhoneGap

Bib (Nativ)

(Nativer Wrapper

Code)

Android-Plattform-

API

App project for

iOS

App projekt for

Android

Page 34: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

PhoneGap Development

Start: Cross-platform web project

Compilation with platform-specific IDEs

Web service „PhoneGap build“ for creating Apps without native IDEs -> build.phonegap.com

34

Xcode - iOS

Eclipse IDE -AndroidApp content

HTML, CSS, Javascript

Co

rdo

va.js

...

cord

ova.js

An

dro

idco

rdo

va.js iO

S

...

Android App

iOS App

...

Page 35: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

PhoneGap API

Cross-platform API provides common interface to access device specific features

mapped to device OS by Javascript-to-native bridge

35

http://phonegap.com/about/feature

Page 36: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Comparision

Dr. Thomas Springer 36 Application Development - 10. Cross-Platform Development

Tool Supported Device Platforms Programming Language

Approach App Execution Env.

Generic App parts

Native GUI-Widgets

Supported Platform-Features

Bedrock Android, Antix Game Player, bada, BlackBerry, BREW, Flash, iOS (iPhone, iPad), JavaME, Nintendo DS / DSi / DSiWare, Sony PSP / PSP Minis, Symbian, webOS, Windows Mobile, Windows Phone 7, Browser (HTML5)

Java (JavaME) Source-to-Source-Translation to C++, Java, C#, ActionScript, JavaScript; Plattform-SDK for Cross-Compilation

native Logic, GUI no

Qt Symbian, Maemo, MeeGo, Windows, Linux, Mac OS C/C++ Cross-Compilation native Logic, GUI Yes

XMLVM iOS, Android, .NET-Plattform, Java-Plattform, further languages: JavaScript, Python, C++, Objective-C

Java, Ruby, Programming Langugage of .NET-Platform

Bytecode-Compilation native Logic Yes

Adobe AIR iOS (iPhone, iPad), Android, Blackberry Tablet OS, Desktop-PCs, TV

ActionScript, MXML

Bytecode-Interpretation / AOT-Compilation (iOS)

Engine / native

Logic, GUI partly

Kony Android, iOS, J2ME, BlackBerry, Symbian, Windows Mobile, Windows Phone 7, webOS, BREW; Tablets: iOS, Android, BlackBerry, webOS;

Lua Bytecode-Interpretation / Source-to-Source-Translation, Cross-Compilation (iOS)

Engine / native

Logic, GUI yes

Rhodes Android, BlackBerry, iOS (iPhone, iPad), Windows Mobile, Windows Phone 7

Ruby, HTML, CSS, JavaScript

Interpretation of scripting languages Bytecode-Interpretation

Engine, hybrid

Logic, GUI partly

Titanium Mobile

Android, iOS (iPhone, iPad), BlackBerry, Titanium Mobile Web SDK: Browser

JavaScript Interpretation approach Engine Logic, GUI yes

Sencha Touch

iOS (iPhone, iPad), Android, BlackBerry (incl. PlayBook)

JavaScript, (HTML, CSS)

JavaScript-Application-Framework

Web Logic, GUI No

Google Web Toolkit

Any device with Web browser Java Source-to-Source-Translation to HTML, CSS, JavaScript

Web Logic, GUI No

PhoneGap iOS (iPhone, iPad), Android (Smartphones, Tablets), webOS, Symbian, BlackBerry, Windows Phone, bada

Native Code, HTML, CSS, JavaScript

Hybride Approach hybride Logic, GUI no

Page 37: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Strong fragmentation of market for mobile device platforms

Cross-Platform frameworks try to bridge the gap

Large number of tools following manifold approaches

• Methodology

• Target platforms

• Native features

• App anatomy

• User interactions

No tool fulfills all requirements

In sum: instead of „Write once, run everywhere“ it‘s more „Write once, run many“

Possible strategy for projects

1. Web App to support large set of platforms

2. Native Apps in addition for most important platforms

Dr. Thomas Springer 37 Application Development - 10. Cross-Platform Development

Summary

Page 38: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Dirk Hering: Analyse von Methoden und Werkzeugumgebungen zur plattformunabhängigen Entwicklung mobiler Applikationen, Diplomarbeit, TU Dresden, 2010

Kramer, Dean ; Clark, Tony ; Oussena, Samia: MobDSL: A Domain Specific Language for multiple mobile platform deployment. In: 2010 IEEE International Conference on Networked Embedded Systems for Enterprise Applications (NESEA), 2010, S. 1–7

Hamann, Thomas ; Hübsch, Gerald ; Springer, Thomas: A Model-Driven Approach for Developing Adaptive Software Systems. DAIS 2008, Proceedings Bd. 053 (LNCS), pp. 196–209, 2008

Kassinen, Otso ; Harjula, Erkki ; Koskela, Timo ; Ylianttila, Mika: Guidelines for the Implementation of Cross-platform Mobile Middleware. In: International Journal of Software Engineering and Its Applications (IJSEIA) 4 (2010), Nr. 3, S. 43–57

Calvary, Gaëlle ; Coutaz, Joëlle ; Thevenin, David ; Limbourg, Quentin ; Bouillon, Laurent ; Vanderdonckt, Jean: A Unifying Reference Framework for multi-target user interfaces. In: Interacting with Computers 15 (2003), Nr. 3, S. 289–308

Dr. Thomas Springer 38 Application Development - 10. Cross-Platform Development

References

Page 39: Application Development for Mobile and Ubiquitous ...ts2/admuc/lecture1213/10. Cross-Platform... · •Customers don‘t pay per platform but for project Short time to market •Fast

Adobe AIR: http://www.adobe.com/products/air

Bedrock: http://www.metismo.com

Google Web Toolkit: http://code.google.com/intl/ de-DE/webtoolkit

Kony Platform: http://www.kony.com/platform

PhoneGap: http://phonegap.com/

Qt: http://qt.nokia.com/products

Rhodes: http://rhomoile.com

Sencha Touch: http://www.sencha.com/products/touch

Titanium Developer: http://www.appcelerator.com

XMLVM: http://xmlvm.org

Dr. Thomas Springer 39 Application Development - 10. Cross-Platform Development

References