• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Packages same in desktop, applet, Android environments

 
Oleg Shubin
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to design a game engine that would be able to run on desktop, as an applet and as an Android application. I know I cannot have the exactly same file in all three cases due to different formats (e.g. Android's Dalvik VM requires DEX files not supported by Oracle's JVM) but I can at least try to make code that, if compiled properly, could do the trick.

However, I am afraid that some libraries might not be available on all three platforms. Thus I plan to define interfaces in my engine and only use them in further development and make different platform-specific implementations of those interfaces. When the application is launched, the interface is hooked to a correct implementation, e.g. the graphics interface would have Swing, OpenGL and Android OpenGL implementations. However, according to this thread Android may not fully implement all of Java API packages.
What other packages may not be available on Android or in applet environment? What packages are guaranteed to be fully supported in all three cases?

Thanks in advance
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15644
48
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That sounds like a good plan.

On Android you indeed use the Java programming language to write your program and part of the API is the same as standard Java, but Android is not fully compatible with Java SE.

On the developer website for Android you can find everything you need to know to program for Android, including the API documentation. A big part of the standard Java packages is available (for example, java.lang, java.util, java.text etc.) but you'll just have to keep on compiling your code for standard Java as well as for Android as you're developing your app to find possible problems.
 
Norm Radder
Bartender
Posts: 1526
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The GUI for Java SE Swing is completely different from Andoid's GUI.  I rewrote some simple quiz programs that run on the PC to run on Android.  Most of the background classes and methods moved across without chances.  The GUI had to be completely rewritten.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic