Multi-OS Engine Technology Overview

28
Intel® Software and Service Group, Developer Product Division Developing Multi-OS Native Mobile Applications With Java* Peng Tu - Principal Engineer, Software Architect Karthi Chinnaswamy – Technical Consulting Engineer Yash Oswal – Intern Software Engineer Technology Preview

Transcript of Multi-OS Engine Technology Overview

Page 1: Multi-OS Engine Technology Overview

Intel® Software and Service Group, Developer Product Division

Developing Multi-OS Native Mobile Applications With Java*Peng Tu - Principal Engineer, Software ArchitectKarthi Chinnaswamy – Technical Consulting EngineerYash Oswal – Intern Software Engineer

Technology Preview

Page 2: Multi-OS Engine Technology Overview

Intel® Software and Service Group, Developer Product Division 2

Installed Base Choices

2010

2015

- 1.0 2.0 3.0 4.0 5.0

Device Installed Base by OSPCs, tablets, mobile phones

Billions Source: Gartner, Intel

* Other brands and names are the property of their respective owners.

Page 3: Multi-OS Engine Technology Overview

Intel® Software and Service Group, Developer Product Division 3

Developers are Targeting Multiple Platforms

* Other brands and names are the property of their respective owners.

Source: Vision Mobile

Page 4: Multi-OS Engine Technology Overview

Intel® Software and Service Group, Developer Product Division 4

Solutions for the

multi-os world

Page 5: Multi-OS Engine Technology Overview

Intel® Software and Service Group, Developer Product Division 5

Intel Mobile App Developer Tools

HTML5 Approach

Device independen

t methodolog

y

Faster TTM for

development

Driven by Open

Source & Large

developer community

Native Approach

Vendor specific

programming language

Allows developers to take full

of the platform

architecture

Device dependent methodolog

y

Page 6: Multi-OS Engine Technology Overview

Intel® Software and Service Group, Developer Product Division

HTML5 and Hybrid Apps

Access device and native platform features through JavaScript* APIs

Cordova* support−5.1 support

Crosswalk* Runtime for Android*−Greater app performance−Extends Hybrid Capabilities, delivers

native like performance

6

Intel® XDKCross-platform Development

Environment

Accelerometer

Geolocation

Camera

Compass

Contacts

Device

Notification

Storage

Display, Multitouch, Connection, Event,s File, Globalization, Media

InAppBrowser, and more...

Device APIs

Page 7: Multi-OS Engine Technology Overview

Intel® Software and Service Group, Developer Product Division 7

Create Java-based iOS apps Develop & Deploy in Android* Studio on Windows*

or Mac* Design Native iOS* UI in Android* Studio or

Xcode* Debug On-Device or Simulator Access Objective-C Language Features and 100%

iOS* platform API Automatically Generate High-Performance Native

Bindings

Multi-OS Engine Technology Preview

* Other brands and names are the property of their respective owners.

Page 8: Multi-OS Engine Technology Overview

Intel® Software and Service Group, Developer Product Division 8

Accelerating App Time-to-Market

Estimated savings based on reuse of portable Android app code with assumptions of 80 lines of code per developer per day, 260 working developer-days per year, and 50% of lines-of-code uniquely developed for app (i.e., not part of a portable library)

40% 45% 50% 55% 60% 65% 70% 75% 80%0

1

2

3

4

5

6

7

Estimated Savings to Develop Java-based iOS App Using Multi-OS Engine

(Top 25 Non-Game Apps in Google Play - Bubble Size Relative to Lines-of-Code)

Portable - Directly Reusable Code (full app)

Dev

elop

er-Y

ears

of

Effor

t

Potential to save years of

developer effort

Page 9: Multi-OS Engine Technology Overview

Intel® Software and Service Group, Developer Product Division 9

MULTI-OS ENGINE

Technology Preview

Page 10: Multi-OS Engine Technology Overview

Intel® Software and Service Group, Developer Product Division

Multi-OS Engine for iOS*

10

Common logic code

iOS* UI and API code

iOS* Native Applications in Java* Android* ART runtime and

library

Nat/J Java* to ObjC bridge

Page 11: Multi-OS Engine Technology Overview

Intel® Software and Service Group, Developer Product Division

Android* Java* ART Runtime and Library

11

Android* ART runtime and library

State of the art Android*Java ART runtime‐ Ahead of Time (AOT) compilation on host for

performance‐ Enhanced memory management and garbage

collection

Enhancements‐ Support 64 bit iOS* app image‐ Java 8 lambda support through Retrolambda

integration Maximum compatibility with Android’s

Java* execution environment

Page 12: Multi-OS Engine Technology Overview

Intel® Software and Service Group, Developer Product Division

Nat/J Java* to Native Binding

Auto Java* binding generation from ObjC and C header files from existing libraries or 3rd party packages

Java* annotations and Nat/J runtime library

No need to write JNI functions Prebuilt jar files interfacing iOS* API are

provided in MOE so you can start coding iOS* app in Java* immediately

12

Nat/J Java* to ObjC bridge

Page 13: Multi-OS Engine Technology Overview

Intel® Software and Service Group, Developer Product Division 13

Development Flow

Create

DesignBind UI to Java*

Edit - IntelliSense

Build - Local/cloud

Test/Debug - iOS* simulator/device

Launch

Page 14: Multi-OS Engine Technology Overview

Intel® Software and Service Group, Developer Product Division

Single Team, Two UIs

Use common application logic to ensure same functionality on multiple OS

Access native UI API for native look-and-feel

Leverage Java* and Android* skills for iOS* development

Shorten time to market and reduce maintenance cost through code sharing

14Technology Preview

Page 15: Multi-OS Engine Technology Overview

Intel® Software and Service Group, Developer Product Division 15

Multi-OS Engine Stack

Java iOS* App‐ MOE Java ART VM‐ NatJ Java bindings for

CocoaTouch and ObjC libraries

Java Android* App‐ NatJ Java bindings for NDK and C

librariesiOS*

MOE Java* ART VM

NatJ Bridge

Multi-OS Java Applications

C/C++ Libraries

Java* Libraries

Android*

iOS* ObjC API/Libs

Technology Preview

Page 16: Multi-OS Engine Technology Overview

Intel® Software and Service Group, Developer Product Division

Building iOS* App with Multi-OS EngineDemonstration:1. Port an Android* Notes app to iOS*

with shared local file access

2. Use NatJ Java* binding generator to share SQLite* code

3. Develop a Java* game for iOS*

16

Page 17: Multi-OS Engine Technology Overview

Intel® Software and Service Group, Developer Product Division 17

Port a Notes-taking App to iOS

1) Make a shared data module for persistent notes• With platform specific directory path for Android and iOS

2) iOS Master-Detail template• iOS View Controller vs Android Activities• iOS Segue vs Android Intent• Java binding generation

3) iOS View Controller API programming with Java• Interact with shared Java data model class

Page 18: Multi-OS Engine Technology Overview

Intel® Software and Service Group, Developer Product Division

Persistent Storage with SQLite

• SQLite does not need explicit configuration to be setup• It is serverless.• Single ordinary database file on disc.• Cross-platform database files• Implementation in C

Page 19: Multi-OS Engine Technology Overview

Intel® Software and Service Group, Developer Product Division

Our approach

Step 1 Place sqlite.h file in the common folder.Step 2 Generate NAT/J bindings using MOE tool.Step 3 Add the moe jar to access the native runtime bindingsStep 4 Import .so files of sqlite with NAT/J bindings for Android.Step 5 Import generated .so library for NAT/J.Step 6 Create common Java classesStep 7 Create platform specific code.

Page 20: Multi-OS Engine Technology Overview

Intel® Software and Service Group, Developer Product Division 20

Develop a LibGDX game with Multi-OS EngineSteps:

1) Clone LibGDX library from Github2) Apply a backend patch provided by Intel for Multi-OS Engine

Support3) Develop your game application as a common Java module4) Create an Android* App and invoke the common game module5) Create an iOS* App using Multi-OS Engine Plugin and invoke the

common game module6) Your cross platform game app is ready!

Page 21: Multi-OS Engine Technology Overview

Intel® Software and Service Group, Developer Product Division 21

Download Multi-OS Engine Technology Preview

https://software.intel.com/multi-os-engine

Page 22: Multi-OS Engine Technology Overview

Intel® Software and Service Group, Developer Product Division 22

Resources and ReferencesWebsite: https://software.intel.com/multi-os-engineSample applications:

Java: https://github.com/moe-java-samples/moe-java-samples Kotlin: https://github.com/moe-java-samples/moe-kotlin-samples

Tech forum: https://software.intel.com/en-us/forums/multi-os-engineTutorials and getting started guides:

https://software.intel.com/en-us/blogs/2015/08/27/tutorials-and-quick-start-guides-for-multi-os-engine

Video and Webinars: https://software.intel.com/en-us/articles/videos-and-webinars-multi-os-engi

ne

Page 23: Multi-OS Engine Technology Overview

Intel® Software and Service Group, Developer Product Division 23

Next Technical Talk

Building Hybrid Web Apps with Cordova, Crosswalk, and Intel XDK Cross-Platform Development Environment December 3, 2015 @ 11:00 – 11:45

Intel® XDK and CrossWalk Technical Talk

Page 24: Multi-OS Engine Technology Overview

Intel® Software and Service Group, Developer Product Division 24

Additional Dev Tools For Android

software.intel.com/android/tools

The Smart Way to Create Smart Code-Based on Deep, System-Wide Insights

Page 25: Multi-OS Engine Technology Overview

Intel® Software and Service Group, Developer Product Division 25

Intel® Developer Zone

Visit the - software.intel.com

Visit - androidhub.intel.com

Join us on Social Media

@IntelSoftware

Intel Developer Zone

• @IntelDeveloperZone

• Intel Software TV

Page 26: Multi-OS Engine Technology Overview

Intel® Developer Product Division, Software and Service Group 26

Thank youIntel Team

Page 27: Multi-OS Engine Technology Overview

Intel® Software and Service Group, Developer Product Division

Legal Disclaimer and Optimization NoticeINFORMATION IN THIS DOCUMENT IS PROVIDED “AS IS”. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. INTEL ASSUMES NO LIABILITY WHATSOEVER AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO THIS INFORMATION INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.

Software and workloads used in performance tests may have been optimized for performance only on Intel microprocessors. Performance tests, such as SYSmark and MobileMark, are measured using specific computer systems, components, software, operations and functions. Any change to any of those factors may cause the results to vary. You should consult other information and performance tests to assist you in fully evaluating your contemplated purchases, including the performance of that product when combined with other products.

© ,2014, Intel Corporation. All rights reserved. Intel, the Intel logo, Atom, Cilk, VTune, the Look Inside. logo, and Look Inside. are trademarks of Intel Corporation in the U.S. and other countries.

OpenCL and the OpenCL logo are trademarks of Apple Inc. used by permission by Khronos.Optimization NoticeIntel’s compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804

27

Page 28: Multi-OS Engine Technology Overview

Placeholder Footer Copy / BU Logo or Name Goes Here