Plugin SDK and JNI

This forum is currently in read-only mode.
From the Asset Store
Easily integrate Telegram Mini Apps SDK into your Construct 3 projects for building interactive apps and games.
  • Would it possible to use JNI with the plugin SDK to allow writing plugins with Java?

  • I don't know much about JNI. Does it require end-users to have the Java framework installed? If so, I'd decline because it'd cause really complicated dependencies for end-users. If we enable plugins to be written in Java, the .NET framework, Python etc, then end users could end up having to install all three of those separately to run a game - which they most likely won't bother with.

    C++ compiles to native code with essentially no dependencies, so it just works for everybody, generally.

  • Truth is, I don't know too much about JNI either, but school is approaching (we use Java there) and I need a project; I was thinking of doing this. I was posting to see if anyone had an opinion about the feasibility. However, if you think this would be bad for Construct I can see why. End users will probably need a JVM, but I imagine the vast majority of people have one even if they don't know they do.

  • I think most end users will have the JVM (if you use older Java features), so I wouldn't let that hold you back trying to do this. Also, C++ meshes with JNI much better than C.

    But I agree with Ashley that this probably would not be good to support officially, but as a school project it sounds interesting to attempt. Doesn't sound easy at all though.

  • Yeah, your school project could be along the lines of "Is it feasible to extend a C++ application using JNI?" Even if you conclude "no", you might get an interesting report and a good mark.

    The problem with JVMs (and .NET frameworks) I think is that you're caught between two difficult choices: either use an old framework everybody has, but then that doesn't have all the latest, greatest features. Or, use the latest framework - but then it's less likely everyone has it. I know this is true of the .NET framework, but I don't know about JVM. Plus, I wouldn't assume everybody has it installed in the first place - it's a lot of work to go to, to then find (say) 20% of people can't run it. Someone should look in to the actual stats first!

  • Someone should look in to the actual stats first!

    I think the number of users will be more like %90+, but I still don't think officially supporting JNI is a good idea. I believe most manufacturers HP, Dell, etc ship JVMs with their custom loads which most users will have. If you do a fresh install the JVM will not be installed.

    http://news.cnet.com/HP,-Dell-to-ship-J ... 15723.html

    http://www.highbeam.com/doc/1G1-108111914.html

  • I've been thinking about this, when Construct is installed it has a web installer for DirectX. A similar web installer exists for Java which means I should be able to write an installer (with NSIS or something) that will also download the JRE. Also, Java 1.6 (the latest version) was released almost 4 years ago, so adoption should be very high.

  • Also, Java 1.6 (the latest version) was released almost 4 years ago, so adoption should be very high.

    I agree. I really think nearly everyone will have Java installed. It is a much different case than say Python where you absolutely must package with your game. Also, the web installer is a great idea for those who don't have Java and you can determine automatically during install time whether or not to prompt to install Java. Now, just have to figure out how feasible JNI is with Construct.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • The project idea was turned down, it was considered inappropriate for second year, but I'm welcome to do it in third. I'm considering going ahead with it anyway, but if it looks like it'll be very difficult I'll probably wait for third year as I'll have to find something else to do this year.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)