j2objc

Translate Android Studio Java code to Objective-C with j2objc,Is it possible?


I've tested j2objc by translating simple HelloWorld Java code to Objective-C, and that's ok. Next, I've tried to convert Java code that was written in adroid studio with GUI translate to Objective-C. But it doesn't work and give me error. How can I translate android studio java code to Objective-C, or something else that can be accessed with iOS? Thanks


Solution

  • GUI code is explicitly not supported by j2objc; the first paragraph on http://j2objc.org states:

    The goal is to write an app's non-UI code (such as application logic and data models) in Java, which is then shared by web apps (using GWT), Android apps, and iOS apps.

    AFAIK, there is no tool that converts Android UI to iOS. There are, however, several platforms that have their own UI abstraction which support Android and iOS, such as Xamarin, Corona SDK and Apache Cordova (aka Phonegap).