5 Replies - 8253 Views - Last Post: 31 December 2011 - 08:20 PM

#1 AlbuquerqueApache  Icon User is offline

  • D.I.C Addict

Reputation: 49
  • View blog
  • Posts: 523
  • Joined: 21-February 10

Is there a way to port Java SE jars to android?

Posted 12 December 2011 - 07:43 AM

I'm thinking the answer to this is probably no as I was reading that dalvik does not support Java SE or swing code. But hey, I can hope right?

This post has been edited by AlbuquerqueApache: 12 December 2011 - 07:43 AM

Is This A Good Question/Topic? 0
  • +

Replies To: Is there a way to port Java SE jars to android?

#2 cfoley  Icon User is offline

  • Cabbage
  • member icon

Reputation: 2069
  • View blog
  • Posts: 4,307
  • Joined: 11-December 07

Re: Is there a way to port Java SE jars to android?

Posted 12 December 2011 - 06:23 PM

Most of the source would compile OK. The bits you have to watch are the classes that call native code. You would also have to be careful of the licence. I know Java is open source, but I'm not sure what sort of restrictions the licence puts on it.
Was This Post Helpful? 0
  • +
  • -

#3 AlbuquerqueApache  Icon User is offline

  • D.I.C Addict

Reputation: 49
  • View blog
  • Posts: 523
  • Joined: 21-February 10

Re: Is there a way to port Java SE jars to android?

Posted 13 December 2011 - 08:54 AM

So do I need an Android compiler? (Sorry, I'm not well versed in the Android SDK)

Well, my Jar uses Swing, which I have heard is incompatible.
Was This Post Helpful? 0
  • +
  • -

#4 cfoley  Icon User is offline

  • Cabbage
  • member icon

Reputation: 2069
  • View blog
  • Posts: 4,307
  • Joined: 11-December 07

Re: Is there a way to port Java SE jars to android?

Posted 13 December 2011 - 09:40 AM

You can get the android SDK here: http://developer.and....com/index.html

Sounds like an ambitious project if you're not already an android developer. I would recommend rewriting your GUI for android. If you've kept it separate from your data and logic that shouldn't be too hard.

This post has been edited by cfoley: 13 December 2011 - 09:40 AM

Was This Post Helpful? 1
  • +
  • -

#5 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 7999
  • View blog
  • Posts: 13,698
  • Joined: 19-March 11

Re: Is there a way to port Java SE jars to android?

Posted 13 December 2011 - 12:25 PM

Quote

If you've kept it separate from your data and logic that shouldn't be too hard.


This is key. Android has a pretty sensible UI model, but it's nothing at all like the godawful mess that is Swing. However, it shouldn't matter at all: good design means that the logic of the program doesn't care about how it's presented, and the UI doesn't know how the data it's presenting was generated. If you follow this, you can present your application in Android, Swing, CLI, or whatever, and all you have to do is write the UI.
Was This Post Helpful? 1
  • +
  • -

#6 Dogstopper  Icon User is offline

  • The Ninjaducky
  • member icon



Reputation: 2876
  • View blog
  • Posts: 11,051
  • Joined: 15-July 08

Re: Is there a way to port Java SE jars to android?

Posted 31 December 2011 - 08:20 PM

Yah,

Swing....is about the worst GUI system I've ever worked with. Android's setup makes much more sense, whether you use the XML layout, the dynamic layout, or both. As for your question - no. The Dalvik version of Java does NOT include the Swing libraries.

For very specific information on which Java packages were included and which ones were rewritten, look here:
http://developer.and...e/packages.html
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1