Click here to Skip to main content
15,886,026 members
Articles / Mobile Apps / iOS
Article

Intel Multi-OS Engine

Rate me:
Please Sign up or sign in to vote.
4.83/5 (4 votes)
2 Nov 2015CPOL4 min read 16.2K   3   4
This article clearly expresses how your Java skills and Java skills only will enable you to develop cross-platform native apps for iOS and Android.

This article is for our sponsors at CodeProject. These articles are intended to provide you with information on products and services that we consider useful and of value to developers

Introduction

Not long ago Intel announced the Multi-OS Engine at the Android Developer Conference (Andevcon) 2015, Boston. It enables you to develop native mobile applications for iOS and Android with Java.

Image 1

Developing native mobile apps that work on both iOS and Android isn’t easy – or cheap. You could build two separate native apps to get a native look and feel at a greater cost:

Image 2

However, even for large companies with significant resources that choice proved to be difficult. That could be changing. Developers now have the chance to preview Intel’s Multi-OS Engine (MOE), which is designed to drastically reduce the development time needed to build separate native iOS and Android apps:

Image 3

Multi-OS Engine provides a comprehensive solution to your cross platform needs.

Why be native is so important?

Modern mobile users are very tempted. App stores for any platform are filled with a huge number of clones. How to stand out among them? I would rather choose something that looks and feels more consistent with the rest of the platform. Even though developing native mobile apps takes longer, native Look & Feel is exactly what end users are interested. So saving on this is simply impossible. For several reasons native applications have a significant advantage in this area:

  • Direct access to platform-specific UI components, like navigation stacks, date and time pickers, maps and etc. It's possible to reimplement these components on the web, but our reimplementations never feel exactly like their native counterparts, and they also don't get updated automatically with changes to the platform.
  • The lack of overhead related to the UI rendering.
  • Native multithreading. Web based frameworks don't allow to parallelize the application as good as it possible with native code. 

Why Java?

GitHub’s ranking of languages based on the volume of code stored in its repository clearly explain Facebook’s choice of Javascript for React Native and Intel’s choice of Java for Multi-OS Engine as the cross-platform language:

Image 4

One of the major reasons why Java became so popular is the vast amount of existing code such as libraries, examples and open source applications, that is available to Java developers.

Technical Overview

The Multi-OS Engine is available as a stand-alone plug-in that can be integrated into Android Studio. App projects can be started as simple as Android projects in Android Studio and Multi-OS engine configures the project to build and run as an iOS App on the iOS simulator that can be invoked from Android Studio as well. Thus you don’t necessarily need to know Objective-C to build your native app for iOS. Herewith Android development doesn't go through any changes. Further, you have a wonderful opportunity to reuse all the platform-independent code. MOE does not offer a 100% reuse of code. But this value can reach 60% with proper application architecture.

Image 5

Multi-OS Engine facilitates Java support on iOS through:

  • Auto Java binding generation from Objective-C and C header files from existing libraries or 3rd party packages
  • Java annotations and NatJ runtime library
  • Eliminating the 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!

Image 6

iOS Development Workflow with Multi-OS Engine

Image 7

These steps explain only the creation of iOS App with Multi-OS Engine, assuming that you are aware of the build process of an Android app in Android Studio.

  1. Create an Android Project in Android Studio and to include configuration for iOS app, add new configuration “Intel Multi-OS Engine Project”.
  2. Design UI for iOS in XCode or Multi-OS Engine’s UI designer in Android Studio
  3. Bind UI to Java using the NatJ runtime libraries.
  4. Android Studio is equipped with the Intellisense capabilities to bind the action handlers to the UI elements for iOS.    
  5. Local build is supported on OS X development machines where iOS Simulators can be invoked. For Windows development systems, remote/cloud build is supported.
  6. iOS applications then can be run on the Simulator which is integrated into Android Studio by Multi-OS Engine configuration or directly on the device itself.
  7. Debug your iOS applications directly in the Android Studio.

Code snippet

If you are a experienced Java developer all this Objective-C stuff can be confusing:

Objective-C
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    if ([segue.identifier isEqualToString:@"showDetail"]) {
        NSIndexPath *selectedIndexPath = [self.tableView indexPathForSelectedRow];
        // Set data
        ...
    }
}

Now just imagine the same functionality coded with Java:

Java
@Override
public void prepareForSegueSender(UIStoryboardSegue segue, NSObject sender) {
    if (segue.getIdentifier().toString().equals("showDetail")) {
        NSIndexPath selectedIndexPath = getTableView().indexPathForSelectedRow();
        // Set data
        ...
    }
}

It looks pretty similar, isn't it? But it's much more familiar for the Java developers. This is meaning that you can easily port any UI related Objective-C code to Java and focus on the business logic of your specific application.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Intel
Russian Federation Russian Federation
Senior Software Engineer at Intel

Comments and Discussions

 
GeneralMy vote of 3 Pin
Igor Stolyarenko19-Nov-15 9:07
Igor Stolyarenko19-Nov-15 9:07 
PraiseVery interesting! Pin
Ravi Bhavnani9-Nov-15 5:19
professionalRavi Bhavnani9-Nov-15 5:19 
GeneralRe: Very interesting! Pin
James_Parsons18-Nov-15 14:17
James_Parsons18-Nov-15 14:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.