xbmc/xbmc — pull request #2685 by theuni (2013-05-03 02:59:17+00:00)
Title: JNI Overhaul

I'm hoping this is the last JNI rewrite...

There are 2 parts to this:

1. A new lib has been created that abstracts away JNI entirely. Each android class is reimplemented and used in XBMC as if it's a native class.
This lib was written with the intention of being independent of XBMC. One of the main reasons for that is that it requires some c++11 voodoo. However, because we are very involved with Android at the toolchain level, this is not a problem as long as we don't infect other XBMC code with it. For this reason, it must be an island. Eventually (if/when it matures) I hope to move it outside of the XBMC codebase and give it an upstream.

2. Rewrite our android classes to use this lib. This has been done for XBMCApp, and should be done for our other JNI code once this goes in.

Most of the easy answers are provided by the README in the top commit.

The motivation behind this is the use of more native Android functionality. I have a few things in progress for Pivos including a network-manager client (via @davilla and @topfs2), power manager, being fully functional as a launcher, etc. All of these things required tons of JNI code, and it's just too error-prone to write by hand. After this abstraction, it's nice and tidy and very easy to work with. I think the diffs of XBMCApp will back that up :)