Comment #6 on issue 222 by Port Piccolo2D APIs to Android

I think the concern is that Agile2D will not run on Android, as it has dependencies on java.awt.Color and java.awt.Shape, etc.

Honestly, the effort in porting the core Java code over is not that bad. The real question is whether the ported code is going to perform well on Android. The biggest issue is that you must not allocate ANY objects on the paint thread under Android if you want any sort of performance. See:

And Romain Guy has some tweets linked from there as well describing the issue. I think it just turns out that Dalvik does not do nearly a good a job of allocating/deallocating objects as Hotspot or others.

Combine these changes with the lack of a color object, some variations on matrices, etc... and it starts to look different enough to not be compatible.

If the core APIs were refactored not to have any dependencies on java.awt, Java2D, or Swing, as mentioned above, that would dramatically help things, but I worry that is a bit of a long term project. And I think it would be good to have a prototype version of the Android code running at least to do that. One concern is the whole 'never allocate on the paint thread' issue does have consequences for the overall API.

The code I have does a basic PCanvas and some simple PNodes. A few of the simpler example apps have been ported over. The challenge is that the internals are changing a lot as I move things over to avoid doing things like allocating objects on the paint thread.

Piccolo2D Developers Group:

Reply via email to