architetto francesco fantoni <hva - hermanitos verdes architetti>
2010-09-18 19:42:40 UTC
Some very early, lazy and useless notes and suggestions about a possible
port of shoebot to android.
With the development of the scripting layer for android going on
( http://code.google.com/p/android-scripting/ ) that brings a functional
python environment, I started to figure out whether it is going to be
possible someday to have shoebot working on google's mobile os.
Actually I can't imagine no real use or need, let's say it's just for
fun ;)
obviously cairo has not been ported to android, and probably never will
(way too heavy and complex),
and as shoebot is cairo based, a port would probably require the cairo
canvas to be replaced by something else.
It seems android uses skia ( http://code.google.com/p/skia/ ) as low
level library for 2D graphics, it is open source and I think it could
replicate the basic functions of cairo, but skia api is not even exposed
through NDK and, more important, at present it has no python bindings,
though it seems it is in their roadmap.
I suppose a lot of things would be rather hard to re-implement with skia
(e.g. fonts, images, etc.)
Another option I thought of could be openvg
( http://www.khronos.org/openvg/ ).
The most complete open source implementation I know of is ShivaVG
(http://sourceforge.net/projects/shivavg/). It's built on top of OpenGL,
and a port to android, though not yet existing, could be done using
OpenGL ES, and therefore being hardware accelerated, that's not bad.
I tried an attempt of porting it using android NDK, but the lack in GLES
of some GL attributes implies patching the code and rewriting parts of
it in order to use OpenGL ES, and obviously it's a task far too complex
for me.
There is a commercial openvg implementation called Amanith
(http://www.amanith.org/project.html). which has already an experimental
port to android
(http://comments.gmane.org/gmane.comp.handhelds.android.ndk/3657) that I
was able to run as simple test on my phone (but as I said it is
commercial).
The nice aspect is that it already exists a project that provides python
bindings for both ShivaVG and Amanith vg
(http://code.google.com/p/pyopenvg/) though I must admit I have not
tested it yet.
I'm sure there are other smarter or simpler possibilities for replacing
cairo on android that I didn't think of.
All of the shoebot gui of course would need a rewrite as well, as of
course there won't be a gtk environment, but simple gui with python is
already possible on android, so I suppose that as long as the scripting
layer is further developed, more complex python programs can really be a
possibility on android.
Other non-pure-python modules can be ported to android already (PIL
maybe?) but I must admit it's not a trivial task at all.
best, francesco
port of shoebot to android.
With the development of the scripting layer for android going on
( http://code.google.com/p/android-scripting/ ) that brings a functional
python environment, I started to figure out whether it is going to be
possible someday to have shoebot working on google's mobile os.
Actually I can't imagine no real use or need, let's say it's just for
fun ;)
obviously cairo has not been ported to android, and probably never will
(way too heavy and complex),
and as shoebot is cairo based, a port would probably require the cairo
canvas to be replaced by something else.
It seems android uses skia ( http://code.google.com/p/skia/ ) as low
level library for 2D graphics, it is open source and I think it could
replicate the basic functions of cairo, but skia api is not even exposed
through NDK and, more important, at present it has no python bindings,
though it seems it is in their roadmap.
I suppose a lot of things would be rather hard to re-implement with skia
(e.g. fonts, images, etc.)
Another option I thought of could be openvg
( http://www.khronos.org/openvg/ ).
The most complete open source implementation I know of is ShivaVG
(http://sourceforge.net/projects/shivavg/). It's built on top of OpenGL,
and a port to android, though not yet existing, could be done using
OpenGL ES, and therefore being hardware accelerated, that's not bad.
I tried an attempt of porting it using android NDK, but the lack in GLES
of some GL attributes implies patching the code and rewriting parts of
it in order to use OpenGL ES, and obviously it's a task far too complex
for me.
There is a commercial openvg implementation called Amanith
(http://www.amanith.org/project.html). which has already an experimental
port to android
(http://comments.gmane.org/gmane.comp.handhelds.android.ndk/3657) that I
was able to run as simple test on my phone (but as I said it is
commercial).
The nice aspect is that it already exists a project that provides python
bindings for both ShivaVG and Amanith vg
(http://code.google.com/p/pyopenvg/) though I must admit I have not
tested it yet.
I'm sure there are other smarter or simpler possibilities for replacing
cairo on android that I didn't think of.
All of the shoebot gui of course would need a rewrite as well, as of
course there won't be a gtk environment, but simple gui with python is
already possible on android, so I suppose that as long as the scripting
layer is further developed, more complex python programs can really be a
possibility on android.
Other non-pure-python modules can be ported to android already (PIL
maybe?) but I must admit it's not a trivial task at all.
best, francesco