Porting Java/Swing application to iOS

303 views
Skip to first unread message

juan.m...@gmail.com

unread,
Nov 7, 2014, 11:31:41 AM11/7/14
to codenameone...@googlegroups.com
Hi,

 we have a large standalone Java application that currently runs on Linux. It is written in standard Java with Swing and is heavily multi-threaded. Given the recent development of tools that can cross-compile Java to iOS (CodeNameOne, Oracle's MAF, etc.), our company is considering leveraging our existing application (and years of experience with it) and porting it to an iPad platform.

 Has anyone done such effort? Is this even possible? Can CodeNameOne help with this? I am particularly interested in learning if a Swing GUI can actually be ported to iOS, or do we have to re-write the entire GUI using iOS libraries? Regardless of which tool we use, I don't expect this to be a press of a button and be up and running on iOS, but I'd like to know what are the paint points and areas that may prove to be challenging (short of a complete re-write).

Thanks for your responses in advance.
---JR

Shai Almog

unread,
Nov 7, 2014, 11:51:35 PM11/7/14
to codenameone...@googlegroups.com, juan.m...@gmail.com
Hi,
this should be relatively easy to accomplish with Codename One but you will need to do some work.

The Codename One API was based on Swing as a starting point so many of the API's will be instantly familiar to your team e.g. the layout managers are all there and you have List's with renderers etc.
See this basic introduction: http://www.codenameone.com/swing.html

In the past we even recommended people use an AWT GUI builder (not Swing since we don't have J prefix for component names) then change the package imports to get your application to work.

The big things you will need to refactor in your code are:
1. Very complex UI's - you just can't use those on a touch device.

2. JTable - while we have a Table class its far simpler than JTable which is quite hard to adapt conceptually to mobile devices.

3. Frames/Dialogs - we have Forms and Dialogs which are a bit different, naturally you don't open many Windows at once.

4. Desktopish concepts - tooltips, context menus etc. don't make much sense here.

juan.m...@gmail.com

unread,
Nov 11, 2014, 8:14:33 PM11/11/14
to codenameone...@googlegroups.com, juan.m...@gmail.com
Hello Shai,

 thank you very much for your reply. It was very helpful. In addition to the GUI code, what about the rest of the application code? Are there any paint point in cross-compiling non-GUI code? 

 We are using Java version 7, and for the most part, it is standard Java.

Regards,
--JR

Shai Almog

unread,
Nov 12, 2014, 12:26:34 AM11/12/14
to codenameone...@googlegroups.com, juan.m...@gmail.com
Hi,
we are mostly Java 5 level which isn't very far off. However, IO, Networking etc would need to be adapted since Java.net and java.file make no sense for devices.
Reply all
Reply to author
Forward
0 new messages