sfd 2014: multiplatform app development with migeran

28
Multiplatform App Development with Migeran http://www.migeran.com © 2014 Migeran Ltd. All rights reserved. Gergely Kis CEO

Upload: migeran

Post on 20-Jul-2015

468 views

Category:

Software


1 download

TRANSCRIPT

Page 1: SFD 2014: Multiplatform App Development with Migeran

Multiplatform App Developmentwith Migeran

http://www.migeran.com© 2014 Migeran Ltd. All rights reserved.

Gergely Kis

CEO

Page 2: SFD 2014: Multiplatform App Development with Migeran

2

What is Migeran?● Java Runtime for iOS

● Complete Workflow

– Eclipse & Xcode

– On Device Debugging

– UI Designer

Create iOS Apps

in Java

Page 3: SFD 2014: Multiplatform App Development with Migeran

3

Why Migeran?

● Most mobile apps are built for both iOS andAndroid

● Standard development methods are suboptimal

– Java for Android

– Objective-C for iOS Avoid Code

Duplication

Java / Android Developers → iOS Developers

Page 4: SFD 2014: Multiplatform App Development with Migeran

4

Single Team with Migeran

Happy Management

Core Project Team

AndroidExpert

iOS Expert

Combined Effort = Faster Time to Market

Page 5: SFD 2014: Multiplatform App Development with Migeran

5

Created with Migeran

More Apps

Coming Soon

Page 6: SFD 2014: Multiplatform App Development with Migeran

6

Migeran Architecture

iOS

ART VM

Migeran ART Enhancements

NatJ

Standard Library Bindings

3rd Party Native Library Bindings

3rd PartyNative

Libraries

JavaLibraries

Migeran Application

Flexible Design

Page 7: SFD 2014: Multiplatform App Development with Migeran

7

Migeran Runtime● Based on Android's ART

– New VM with Ahead of Time translation

– Some restrictions due to iOS licensing

● Whole Program Optimization

– Do not include unused Java classes (ProGuard)

– Compile into a single code module

● Migeran ART enhancements

– Instrumentation

– Debugging (Single step 10 – 30 minutes ->  1 second)

Upstreamed to Android

Page 8: SFD 2014: Multiplatform App Development with Migeran

8

Migeran Live Tutorial

Page 9: SFD 2014: Multiplatform App Development with Migeran

9

Migeran Pic-Like App

● A Tinder clone

– Pictures requested from a Backend Server

– User rates the picture (Like (+1) or Dislike (-1)

– Only new pictures are shown to the user

● Technology

– Backend: Play 2 Framework + Mysql

– Client: Android and iOS

Page 10: SFD 2014: Multiplatform App Development with Migeran

10

Pic-Like App Design

● Simple REST API

● JSON requests

● Answer is always an image

● Images stored in the filesystem

● Ratings stored in database

Picture

Dislike Like

Backend

Page 11: SFD 2014: Multiplatform App Development with Migeran

11

Anatomy of a real Multiplatform Mobile App

Android

Runtime

UI

Windows

Runtime

UI

iOS

Runtime

UI

BlackBerry 10

Runtime

UI

Plat. Spec. Code Plat. Spec. Code Plat. Spec. Code Plat. Spec. Code

Common Code Savings here!

Page 12: SFD 2014: Multiplatform App Development with Migeran

12

Backend Service

● Play 2 Framework intro

– JVM based web framework

– Asynchronous core written in Scala

– Java and Scala APIs

● Ebean persistence layer

● REST API 3 endpoints

– nextPicture (POST, GET)

– upload (POST)

Page 13: SFD 2014: Multiplatform App Development with Migeran

13

Pic-Like Mobile App Architecture

Pic-like-common● Communication with the Backend● Usually includes the Model● Ideally also includes ViewModel and Routing

Pic-like-migeran● IOS version● Only UI● Depends on Common

Pic-like-android● Android version● Only UI● Depends on Common

Page 14: SFD 2014: Multiplatform App Development with Migeran

14

Sidebar: API Hell

● HttpClient included in Android

– Outdated version

– Forked from upstream

– Google refused to update („compatibility”)

– Does not work with the newer Fluent Facade

● HttpClient devs created -Android branch

– Uses Android compatible technologies (e.g. Android Logger)

– Works with Fluent (YAY!)

I just wanted to

make a REST call

On iOS we have

the ICU „Hell”

Page 15: SFD 2014: Multiplatform App Development with Migeran

15

Mobile App Backend API

● Asynchronous API

– Need to support cancellation

– Error handling

● Use HttpClient Fluent Facade

– Easy to use

– Supports Asynchronous API out of box

If you see this: new Thread()You are doing

it wrong!

Page 16: SFD 2014: Multiplatform App Development with Migeran

16

Android App Implementation

● Created in Eclipse

● Added Gradle build

● Hacked Gradle Eclipse plugin to generate a functionalAndroid Eclipse projekt

● UI Designed with Eclipse Designer

● Android specific code

– Activity

– IPicLikeDevice implementation

Page 17: SFD 2014: Multiplatform App Development with Migeran

17

Migeran App Implementation Outline

● Create Migeran Project

● Integrate with the rest of the build system

● Add UI Design

● Connect UI Design to ViewController

● Generate UI Binding

● Port the UI driver code from Android

● Port the IPicLikeDevice implementation

Page 18: SFD 2014: Multiplatform App Development with Migeran

18

Eclipse & Xcode Integrated

● Migeran Project in Eclipse

– An Xcode Project is createdautomatically

● Xcode is used for:

– Native components

– UI Design

– Packaging

0

Page 19: SFD 2014: Multiplatform App Development with Migeran

19

Migeran Build System

● Based on Gradle

● Supports Android and iOS multiplatformprojects

● Incremental compilation

● Xcodebuild is used to:

– Build native components

– Package the final applications

0

Works with CI

Servers

Page 20: SFD 2014: Multiplatform App Development with Migeran

20

UI Designer

Use Interface Builderor Storyboard

Implement actionsin Java

Page 21: SFD 2014: Multiplatform App Development with Migeran

21

NatJ: Easy to use native bindings

● Express native bindings in declarative Java code

● Full support for C and Objective-C constructs

● NatJ/Gen: Generate bindings automatically

Built into Eclipse

Page 22: SFD 2014: Multiplatform App Development with Migeran

22

Debugging from Eclipse

On Device Debugging

Page 23: SFD 2014: Multiplatform App Development with Migeran

23

Optional Interface Methods

Keep Java Semantics

Eclipse Quick Fix generates stubs

for optional methods

Page 24: SFD 2014: Multiplatform App Development with Migeran

24

Advanced Editing

Migeran Code Foldinghides generated code

Page 25: SFD 2014: Multiplatform App Development with Migeran

25

Migeran App Implementation Outline

● Create Migeran Project

● Integrate with the rest of the build system

● Add UI Design

● Connect UI Design to ViewController

● Generate UI Binding

● Port the UI driver code from Android

● Port the IPicLikeDevice implementationWe are done!

Page 26: SFD 2014: Multiplatform App Development with Migeran

26

Open Source Roadmap● November 2014

– Migeran 0.90 released

– Open Source Projectannounced

● December 2014

– Source code available

● January 2014

– Migeran 1.0Everyone is welcome

to participate

Page 27: SFD 2014: Multiplatform App Development with Migeran

27

Migeran Professional Support

● Premium Support

– Online remote assistance

● Long Term Supported Versions

● Hotfixes

● Migeran Academy

● Feature Votes

● Project Assistance

Contact us for details

Page 28: SFD 2014: Multiplatform App Development with Migeran

28

Questions & Answers

http://www.migeran.com© 2014 Migeran Ltd. All rights reserved.