Hi,

I'm working with Jorge trying to get a native osg on Android.

The main problem that we found was the migration of OpenThreads, it's
not really complicated but there are some missing api in pthreads
(pthread_cancel as mentioned before) and some changes (sleep returns
void :O). We made the changes on CMake and OpenThreads to support this
changes but when we tried to build against a desktop environment again
then things didn't work :(. We wanted to send the modified files once
things get working, but maybe is time that other eyes get a look to
this.

Jorge, could you attach to this thread a bundle with all the changes
we made to get things compiling and working on android?

I'm attaching a simple (and little ugly) example of a viewer for
android, all made in native (except the minimal parts required in
Java). Currently we got things building against crystax-ndk-r4. This
example "worked" for my Samsung Galaxy S (android 2.1update1). The
viewer starts, and shows the nice blue osg screen! :) but I wasn't be
able to get draw any geometry (I built osg with gles2 support).

To compile it, you need the crystax ndk r4, and osg compiled against
this version. Then you need to modify the
osgviewerandroid/jni/Android.mk file to change the path of required
osg libraries for your system. To get the apk for android I do this
things.

android update project -p . -t 1  # -t is the target defined (android
list devices to get the list)
ndk-build
ant debug

If things work inside bin/ you will get the .apk

Greets,
Rafa.


2011/1/18 Robert Osfield <[email protected]>:
> Hi Jorge,
>
> I know little about the issues of Android platform, so read with
> interest in the various developments that yourself and others are
> working on, it does mean I can't yet contribute too pro-actively
> though.  I'll will try and chip in where I can.
>
> On Mon, Jan 17, 2011 at 10:37 PM, Jorge Izquierdo Ciges
> <[email protected]> wrote:
>> Pthreads. The Set functions are trivial and i don't think that could cause a
>> very big damage. But pthread_cancel is something different, because i've
>> seen that it's widely used. And we would need a suitable replacement to
>> don't let the thread go on.
>
> With the OSG usage of threads I have implemented co-operative exit of
> the thread loops using done flags, instead of relying upon
> Thread::cancel().   Given this, not having cancel() working as before
> may well not be that critical.
>
> Robert.
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
Rafael Gaitán Linares
Instituto de Automática e Informática Industrial  http://www.ai2.upv.es
http://gvsig3d.blogspot.com
Ciudad Politécnica de la Innovación
Universidad Politécnica de Valencia

Attachment: osgviewerandroid.tar.gz
Description: GNU Zip compressed data

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to