LWJGL3 and Android

A simple question (to which I cant find an answer since the LWJGL docs seems to be almost non-present). Does LWJGL3 applications can be run on Android? Is there a support for touch events, or perhaps accelerometer? Simply: what about the interoperability between LWJGL3 and Android devices? Could somebody elaborate on this topic?

[quote=“blobloblob,post:1,topic:56900”]
Not sure what you mean. LWJGL has a site, a forum, a wiki, github issues and ~75MB worth of javadoc.

[quote=“blobloblob,post:1,topic:56900”]
The next steps for LWJGL, after the 3.0.0 release which is coming soon, are:

  • ARM builds for devices like the Raspberry Pi.
  • Android support, if it makes sense.

For the second point, I recently bought an Nvidia Shield to explore if there’s a viable approach. I wouldn’t get too excited though, because one or more of the points below are quite likely to happen:

  • It will suck and there won’t be any support.
  • LWJGL for Android will be a different library than standard LWJGL (will have different bindings and different core API).
  • The minimum supported Android version will be (too) high.

check out LibGDX, which uses LWJGL3 (and 2 if you prefer) and builds to both desktop and android (and ios)
http://libgdx.badlogicgames.com

About the docs: right, there is JavaDoc, but I’ve had hard times figuring out of it if Android is supported; nowhere else I’ve found this information too.
If you ask me it would be perfect if LWJGL supported Android. I don’t want to use high-level library like LibGDX: I do not need most of it’s features and I do not like how it’s dependent on Gradle (which makes me wanna stab myself, when it comes to using it in my favorite java IDE - NetBeans). Still I like the simplicity of static GL API, which I found lacking in JOGL.

Though, thanks for a reply, good to know these things, especially from the author of the library.

[quote=“blobloblob,post:4,topic:56900”]
If you are willing to compromise, you may get the gl from glcontext

[quote=“orangepascal,post:3,topic:56900”]
Just to be clear: This isn’t a question of whether it’s possible to take a library that normally targets PCs and making it run on Android or other resource constrained devices. I’m sure you can do that with most, if not all, libraries. The real question is: what does it offer over what’s already available on the platform and will people use it?

With LWJGL, the above question can be made more specific:

  • LWJGL 3 has been designed for modern JVMs (i.e. Hotspot -server). All choices related to API design and performance-tuning have been made after testing on such JVMs. Are the same choices optimal on Android? (very likely not)
  • Android already has EGL/OpenGL ES bindings. It’s missing Vulkan atm, but it’s probably coming. Why would anyone use a 3rd-party library for that? Also, we’re talking about Java code calling GL/VK functions… does anyone even do that these days? I’m under the impression that most serious developers prefer using the NDK and going to native code for performance sensitive stuff.

@Spasi I’m not really sure if we’re talking about same thing, but for me the strength of 3rd party library is the abstraction over the display and input; no need to poll/listen/draw using platform specific APIs. I don’t know how people use the GL with relation to Java though it’s true I see most people use engines/libs like LibGDX or JME, not directly; never have seen anybody writing a native code to optimize stuff (but I’m not really in the so serious business).

@elect That seems to be a reasonable solution, to store the GL object in a static field somewhere when using JOGL and use it elsewhere. I actually did it once and if there will be no alternative I will probably have to resort to this though I’m still an enthusiast of LWJGL simplicity, where it’s appropriate.

There would be two ways to use LWJGL in Android:

  1. Use LWJGL for OpenGL ES or Vulkan and use Android APIs for display and input.
  2. Replace Android APIs with GLFW for display and input. Currently the problem with GLFW is that it won’t support touch events until version 3.3.