• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Packages same in desktop, applet, Android environments

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 5008
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic