Java and other JRE languages based Addon's
#1
I've been thinking about writing a Python script that will bridge the xbmc native modules (xbmc,xbmcgui,xbmcplugin,xbmcaddon) to a jvm through JNI. I don't think it's that difficult - unless dynamically loading a library from Python is difficult - it looks like I can do it with "ctypes".

Doing this will allow the writing of addons using java or another jre based language (for example, groovy).

Is there any interest in having this?

Thanks
Jim
Reply
#2
good idea, but it won't work. the xbmc python bindings are NOT a python library, they are exported directly to the interpreter from c++ code.

we are definitely interested in extending the add-ons to handle more languages, but i do not think this is the way to go about. ideally, we'd export a clean C api, then bindings can be written for different languages. unfortunately this is quite a lot of work since python's tentacles goes deep into the code base.

another way to go about it is to drop some integrability, atleast in the first place, and write a json-rpc interface much like the current plugin api.
Reply
#3
spiff Wrote:good idea, but it won't work. the xbmc python bindings are NOT a python library, they are exported directly to the interpreter from c++ code.

Thanks spiff. Yes. That's why I called them "native" modules - java terminology - I'm not sure what the correct Python term would be. I just wrote a Python script to export the interface as PyDev "Predefined Completions" (http://forum.xbmc.org/showthread.php?tid=77378).

Maybe I'm missing something but I still think it can be done. You need to bootstrap the jvm from Python using JNI (like the java "loader" does - of course this assumes I can deploy a shared library with the plugin, which is not allowed by the rules) to get it to run in the same process space. Then bridge calls from the java side through Python.

Basically, if I can bridge Python and C I can bridge Python and java (though native calls using JNI).

Then again, there can be advantages to json-rpc (or maybe even SOAP or REST) bridge, like you say.

Maybe I'll play a little and see what I can do.
Reply
#4
AH, now i follow. i had it the other way around in my head, you loading the python modules from java. yes, this will work, not the prettiest solution but it will definitely work.
Reply
#5
OK,

I've been looking at the code and considering how to do this. I think you're right about the way I proposed being somewhat of a hack so I've been looking at refactoring the xbmc python built-in/native code. I'm considering giving it a try but I don't want to be wasting my time. As you say - it's fairly major surgery.

How do you handle non-team member xbmc developers that want to make such drastic changes to the codebase?
Reply
#6
usually we handle it through patches on trac.

this will be way too much for that though. my suggestion; clone our git somewhere and publish yours. that way we can follow your work in the git. a trac ticket may serve us good on the coordination of stuff.

irc is best if you need to discuss stuff with us.
Reply

Logout Mark Read Team Forum Stats Members Help
Java and other JRE languages based Addon's0