RoboVM brings Java 8 programmers to iOS

RoboVM brings Java 8 programmers to iOS

[51CTO translation] RoboVM allows developers to use lambdas and defaults, while providing full access to hardware and native iOS APIs.

Java's poor performance on the iOS platform has always been a headache for Java developers. Although Java developers can use various roundabout ways to run their own applications on such devices, Apple's development restrictions on Java on its iOS smartphones and tablets are still a headache. In order to solve this long-standing problem, RoboVM, as a leader in similar technical solutions, was officially unveiled at the JavaOne Technology Conference held recently in San Francisco.

RoboVM can convert Java bytecode into native ARM or x86 code, and also includes a channel for connecting Java and Objective-C code. For now, RoboVM is mainly used in the field of game applications, but the project founder Niklas Therning expects that after the release of version 1.0 in November or December this year, its scope of application will be extended to more application types. In a recent email interview, he answered various questions raised by reporters about RoboVM.

Reporter: What are the limitations of running Java code on iOS?

Therning: Since late 2010, Apple has allowed developers to embed interpreters in their apps, and these apps also embed all the scripts needed to run, which is a significant reduction in iOS restrictions on Java. But even with the original restrictions, RoboVM can still work well because it does not need to launch other executables, does not need to embed any interpreters, and does not translate any code at runtime. With RoboVM, all bytecode is pre-compiled to machine code on the developer's device, and the final application is built very similarly to native applications built with Xcode and Objective-C/Swift - in other words, it does not have a distinct Java application style... We have proven that Java and other JVM languages ​​can work well on the iOS platform with RoboVM without violating Apple's iOS Developer Program License Agreement. I really don't see anything contrary to this in Apple's guidance.

Reporter: Does the RoboVM solution contain any revolutionary technological achievements? If so, can you talk about it in detail?

Therning: RoboVM is the only solution that can help developers use all the new language features in Java 8, including lambdas and default methods. RoboVM is unique in that it provides full access to hardware and native iOS APIs through a set of Java to Objective-C bindings. With these bindings, you can use Java to build applications that you can do with Apple's Xcode and Objective-C/Swift.

Reporter: Does the RoboVM solution include JavaFX?

Therning: RoboVM allows developers to build cross-platform applications using the JavaFX GUI framework with 100% code reuse between platforms. We are currently working on LodgOn to enable JavaFX to work on both iOS and Android mobile devices, and the results are very exciting. However, it is important to emphasize that RoboVM does not depend on JavaFX to work. If you prefer to use native UI components for application development, you can choose this alternative. In the keynote of the JavaOne 2014 conference, we demonstrated how technicians can develop Android and iOS applications with native UI and still maintain a high code reuse rate between the two platforms.

Reporter: So how does RoboVM differentiate itself from projects like Codename One? According to the latter's official website, it claims to be able to "translate Java bytecode into native C/Objective-C code and leverage Xcode compilation mechanisms to achieve seamless development of mobile applications."

Therning: In RoboVM, we chose a slightly different approach for our precompilation mechanism. Instead of Codename One translating Java code into C/Objective-C, we chose to leverage the inherent strengths of the LLVM project toolchain. You can think of RoboVM as a front-end for LLVM that translates Java bytecode into LLVM bitcode, which is then optimized and translated into machine code using the LLVM back-end. LLVM supports all different types of CPU architectures and operating system options; in theory, it should be enough for RoboVM to work with all of them.

But for now, we are still focusing on iOS. By using LLVM bitcode instead of C/Objective-C as a transitional stage - different from Codename One - we can have more effective control over the final machine code and achieve actual results in code compactness and running speed far beyond C/Objective-C.

Original link: RoboVM beckons Java 8 programmers to iOS

Nuka-Cola Translation

<<:  What did Cook say to Apple China employees before accepting media interviews?

>>:  Responsive Interaction in Material Design

Recommend

The Douyin system operation guide summarized after a loss of 200,000!

Long article warning: This article is the product...

28 thoughts on marketing, operations, copywriting, and new media!

1 What is a brand? It seems that there are very f...

Chen Beibei: What are the benefits of search engine optimization?

With the rapid development of the Internet, many ...

Weibo advertising strategy engineering, style and scenarios

Overview 1. Advertising styles and scenarios The ...

How does operations conduct target user analysis?

Steve Jobs said, I never rely on market research,...

Sogou advertising cases in the medical beauty industry!

Basic customer information Customer Background Th...

How to create a hit product amid product homogeneity?

Have you noticed that some products become popula...

Be careful! A poison that can kill you with just 1 mg may be in your kitchen!

Fermented foods are loved by people for their uni...

How to create private domain products with tens of millions of users?

If we were to select the hottest business term in...