Optimized Cross Platform Development

24
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

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

Page 1: 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

Page 2: Optimized Cross Platform Development
Page 3: Optimized Cross Platform Development

(DESKTOP)

Page 4: Optimized Cross Platform Development
Page 5: Optimized Cross Platform Development

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

What does that mean for software developers?

Page 6: Optimized Cross Platform Development

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

Page 7: Optimized Cross Platform Development

Cross platform development tools

One codebase; target multiple platforms

Many existing tools on the market

Page 8: Optimized Cross Platform Development

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)

Page 9: Optimized Cross Platform Development

Commonly encountered issues

Large installer size

Excessive memory use

Low performance

Limited API access

Page 10: Optimized Cross Platform Development

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

Page 11: Optimized Cross Platform Development

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

Page 12: Optimized Cross Platform Development

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

Page 13: Optimized Cross Platform Development

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”

Page 14: Optimized Cross Platform Development

Commonly encountered issues

Large installer size

Excessive memory use

Low performance

Limited API access

Page 15: Optimized Cross Platform Development

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

Page 16: Optimized Cross Platform Development

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

These approaches can produce working

applications, but the approach can be improved

Page 17: Optimized Cross Platform Development

Programming language conversion

(Source code)

Small Installers Optimal memory useNo API access limitationsNative performance

Page 18: Optimized Cross Platform Development

www.eqela.com

Page 19: Optimized Cross Platform Development

GAMESBUSINESSSYSTEMS

WEBSITESTOOLS

Page 20: Optimized Cross Platform Development

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

Page 21: Optimized Cross Platform Development

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)

Page 22: Optimized Cross Platform Development

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

Page 23: Optimized Cross Platform Development

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

Page 24: Optimized Cross Platform Development

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

Given the right technical architecture, cross platform

applications can be optimized

[email protected]

www.eqela.com