Page 1 of 26

Android Port

Posted: Sun Feb 07, 2010 3:11 pm
by ellis2323
Updated 28 september 2010
Hello, i'm trying to port Irrlicht on Android with the NDK r4b... I use the svn ogl-es branch.

Working:
- GUI
- Most examples

Not implemented: advanced material


I'm searching testers (or coders) for the provided apk.
It is reported that the demo apk is working:
- HTC G1 and Hero
- HTC Desire, Nexus One, Evo 4G, HTC Incredible
- Galaxy Spica (poor performance), Galaxy S
- Archos Gen8 tablets

Code is available on gitorious: Android Irrlicht..

http://gitorious.org/irrlichtandroid/

To test code:
- connect your device with USB cable (real device recommanded)
- install the NDK r4b
- go in android-ndk-r4b/sources/
- get the git repository with

Code: Select all

git clone git@gitorious.org:irrlichtandroid/irrlichtandroid.git

- go in irrlichtandroid/project and compile c++ sources with:

Code: Select all

../../../ndk-build
- compile java part, create the package and install on device:

Code: Select all

ant install
- please put sydney.md2 and sydney.bmp in /sdcard/Irrlicht

When you have problems:
- ndk-build clean: ndk-build have dependency problems (touch IVideoDriver.h and see no rebuild)
- adb logcat: read logs
- use -g in CFLAGS to have debug informations

Others:
- ndk-gdb is not working because of multi-thread
- many android phones have bad drivers. Andreno (GPU of Snapdragon) or PowerVR 5XX have good drivers
- When program is paused, OpenGL context is lost. Please reload all OpenGL status (textures, blending, depth test...)
- Please minimize opengl calls to have good performance. The key is batching.

To test demo apk:
download sydney.md2 et sydney.bmp and put these files in the Irrlicht/ directory of your sdcard.
download and launch the apk.
http://www.scigems.org/downloads/[/b]

Posted: Sun Feb 07, 2010 5:57 pm
by hybrid
Did you change anything in the Irrlicht sources? Do you use X11 window, or is there some other windoing mechanism?

Posted: Sun Feb 07, 2010 7:51 pm
by Kalango
YES! I was waiting for something like this, thank you! Hope the realease soon

Posted: Mon Feb 08, 2010 10:49 am
by pera
Hi, nice project.

I tried installing you application on G1 and Hero, but your MinSDK is set to 4 (1.6) and I have 1.5 installed on these two devices. Maybe you can set MinSDK to 3, since there is no much difference between 3 and 4.

I managed to install it on Motorola Milestone that is running Android 2.0
However, when I run it, I see Sidney stiff (not animated) and it moves away from camera rapidly until it becomes very small.... is that expected behavior? :)
EDIT: When app is run again, Sydney is still in the distance and moving away! I had to reinstall to see it again close.

I will try to build it from NDK later. I looked at the Java code, just initializing renderer, how do you plan to organize JNI layer? Are you going to provide full irrlicht API through JNI, so the Android programmer could write CreateDevice in Java, or...?

What did you have to change in irrlicht?

Apk for version Adnroid 1.5

Posted: Mon Feb 08, 2010 3:00 pm
by ellis2323
I have uploaded a new apk for Android 1.5.

behaviour expected

Posted: Mon Feb 08, 2010 5:42 pm
by ellis2323
Hi Pera,

all you see is normal... you must see only sydney without animation. I have ported the helloworld tutorial.

I will try to load a quake 3 level this evening.

Quake 3 map available

Posted: Mon Feb 08, 2010 10:54 pm
by ellis2323
i have added a new test:
- please install the quake3 map on /sdcard (root of your sdcard)
- install the irrlicht-quake3 apk

The framerate seems ok on Nexus One. On My poor G1, it is only 5fps

Posted: Tue Feb 09, 2010 6:42 am
by drphrozen
Seems to work on HTC Hero, a bit laggy but could not find the framerate. Also i had trouble compiling the example myself, everything seems to compile ok, but dies with a SEGV when deployed.. Also the trunk seems to be for 1.6 and above, but the Quake 3 demo worlds on my Hero (1.5), is this demos released?

Posted: Tue Feb 09, 2010 9:39 am
by pera
I use to get segv when proper media was not on SD card root and SD card available.

I use NDK 1.6

Posted: Tue Feb 09, 2010 9:52 am
by ellis2323
I use NDK 1.6 which is compatible with Android 1.5. My G1 is on Android 1.6 so i can't test correctly on 1.5.
For theses tests apk, there is no validation code so if you don't put correctly data in /sdcard, it crashes.

Ps: emulator doesn't work

Posted: Tue Feb 09, 2010 2:14 pm
by zet.dp.ua
Great work!
Sydney model works as expected on my samsung i5700 (android 1.5).

Java API for Irrlicht

Posted: Wed Feb 10, 2010 11:02 pm
by ellis2323
I suppose that i will use swig to generate java stub to pilot Irrlicht API.

Re: Java API for Irrlicht

Posted: Thu Feb 11, 2010 1:42 pm
by zet.dp.ua
ellis2323 wrote:I suppose that i will use swig to generate java stub to pilot Irrlicht API.
JNI calls can possibly kill performance at all.

Re: Java API for Irrlicht

Posted: Thu Feb 11, 2010 3:19 pm
by pera
zet.dp.ua wrote:
ellis2323 wrote:I suppose that i will use swig to generate java stub to pilot Irrlicht API.
JNI calls can possibly kill performance at all.
any other idea>?

Posted: Fri Feb 12, 2010 9:35 am
by zet.dp.ua
Write the game using c++ and use java layer only for handling system related operations (input, sensors, io, ...)