Optimized Cross Platform Development

Post on 26-May-2015

435 views 0 download

Tags:

description

Why do many developers have a negative impression on the quality of cross platform software development tools? What are the technical reasons for this impression? And can cross platform development be done in a better way? With Eqela, we introduce a source code conversion approach that allows developers to address all of the common issues. (Presentation slides as presented in the Softech.ph conference)

Transcript of Optimized Cross Platform Development

Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.

Optimized Cross Platform Development

Markku Kero / Job and Esther Technologies

June 2014 / Softech.ph

(DESKTOP)

Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.

What does that mean for software developers?

C++ JS ObjCSwift

C/C#

JS CJava

Java C

C++

C#C++ C

C++

C#

ObjCSwift

→ You need to have some kind of strategy to deal with this

Cross platform development tools

One codebase; target multiple platforms

Many existing tools on the market

Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.

Common sentiment: “Cross platform tools do not work.

Writing native code is the best (only) way.”

(= writing the same application several times, once per platform)

Commonly encountered issues

Large installer size

Excessive memory use

Low performance

Limited API access

Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.

Source codetargeting a

specificplatform

Tool

Source / bytecode and

interpreter orVM for iOS

Source / bytecode and

interpreter orVM for Android

Run inbrowser

Androidapp

iOSapp

Runtime /Virtual

machine

(Java, JavaScript,Lua, Ruby, C#, ..)

A common cross platform tool

Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.

Operating system

Language interpreter / runtime

APIs and libraries Application code

A common cross platform toolArchitecture

Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.

A common cross platform toolArchitecture

Operating system

Language interpreter / runtime

APIs and libraries Application code Makes applicationinstallers bigger

Increases memoryusage

Reduces runtimeperformance

Applications can onlyaccess selected

parts of the native API

Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.

Another popular architecture

SourceCode in

HTML, CSS,JavaScript

Tool

LibrariesC code

That opens aBrowser andDisplays the

program

Java codeThat opens aBrowser andDisplays the

program

AndroidSDK

Androidinstaller

iOSSDK

iOSinstaller

Run inbrowser

HTML5 / “embed a web browser”

Commonly encountered issues

Large installer size

Excessive memory use

Low performance

Limited API access

Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.

The C++ approach

C++application

code

SDK /compiler

Run inbrowser

Androidapplication

iOSObjective-C

runtimeC++ classlibrary

BlackBerry10 application

WindowsPhone

app

iOSSwift

runtime

Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.

These approaches can produce working

applications, but the approach can be improved

Programming language conversion

(Source code)

Small Installers Optimal memory useNo API access limitationsNative performance

www.eqela.com

GAMESBUSINESSSYSTEMS

WEBSITESTOOLS

class Main : LayerWidget{ public void initialize() { base.initialize(); add(LabelWidget.instance().set_text(“Hello World”)); }}

Main.eq EqelaCompiler

LayerWidget,LabelWidget

Main.java,LayerWidget.java,LabelWidget.java

AndroidSDK

Androidapplication

A sample Eqela application

class Main : LayerWidget{ public void initialize() { base.initialize(); add(LabelWidget.instance().set_text(“Hello World”)); }}

package mk.test;public class Main extends eq.gui.LayerWidget{

@Overridepublic void initialize() {

super.initialize();((eq.gui.ContainerWidget)this).add(((eq.gui.Widget)eq.widget.LabelWidget.eq_widget_LabelWidget_instance().set_text(eq.api.StringStatic.eq_api_StringStatic_for_strptr("Hello world"))));

}

public Main() {}

}

(EQELA)

(JAVA)

class AndroidHTTPGet{

public static bool execute(String url) {embed “java” {{{

org.apache.http.client.methods.HttpUriRequest hur =new org.apache.http.client.methods.HttpGet(url.to_strptr());

android.net.http.AndroidHttpClient hc =android.net.http.AndroidHttpClient.newInstance(“testing”);

org.apache.http.HttpResponse resp = hc.execute(hur);if(resp == null) {

return(false);}

}}}return(true);

}}

→ All platform specific features / APIsare accessible

Embedding other languages

Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.

Comparison: A “hello world” application

First approach (virtual machine / interpreter)Tool A: 8MB installerTool B: 4MB installer

The “embed a web browser” approach:~300KB installer

The “source code conversion” approach:96KB installer

Copyright (c) 2014 Job and Esther Technologies, Inc. All Rights reserved.

Given the right technical architecture, cross platform

applications can be optimized

markku.kero@jobandesther.com

www.eqela.com