Multiplatform App Developmentwith Migeran
http://www.migeran.com© 2014 Migeran Ltd. All rights reserved.
Gergely Kis
CEO
2
What is Migeran?● Java Runtime for iOS
● Complete Workflow
– Eclipse & Xcode
– On Device Debugging
– UI Designer
Create iOS Apps
in Java
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
4
Single Team with Migeran
Happy Management
Core Project Team
AndroidExpert
iOS Expert
Combined Effort = Faster Time to Market
5
Created with Migeran
More Apps
Coming Soon
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
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
8
Migeran Live Tutorial
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
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
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!
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)
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
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”
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!
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
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
18
Eclipse & Xcode Integrated
● Migeran Project in Eclipse
– An Xcode Project is createdautomatically
● Xcode is used for:
– Native components
– UI Design
– Packaging
0
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
20
UI Designer
Use Interface Builderor Storyboard
Implement actionsin Java
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
22
Debugging from Eclipse
On Device Debugging
23
Optional Interface Methods
Keep Java Semantics
Eclipse Quick Fix generates stubs
for optional methods
24
Advanced Editing
Migeran Code Foldinghides generated code
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!
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
27
Migeran Professional Support
● Premium Support
– Online remote assistance
● Long Term Supported Versions
● Hotfixes
● Migeran Academy
● Feature Votes
● Project Assistance
Contact us for details
28
Questions & Answers
http://www.migeran.com© 2014 Migeran Ltd. All rights reserved.