Recent

Author Topic: OpenGL on android 2.2?  (Read 4738 times)

chronozphere

  • New Member
  • *
  • Posts: 41
OpenGL on android 2.2?
« on: November 24, 2011, 10:01:14 am »
Hey everybody,

Thanks to felipemdc we can now develop OpenGL applications for android 2.3 and up.

However, still a significant number of people are using 2.2, according to this chart: http://developer.android.com/resources/dashboard/platform-versions.html. So it would be interesting to make it work for them too.

As far as I know, NativeActivity can be used from android-8 and up (2.2 and up). However, the example also uses softfloat, which I could find any information about. My best guess is, that softfloat is what forces us to use 2.3 here.

Would it be possible to compile the opengl example that felipemdc made, without softfloat, and make it work on 2.2?

Thanks

Laksen

  • Hero Member
  • *****
  • Posts: 624
    • J-Software
Re: OpenGL on android 2.2?
« Reply #1 on: November 24, 2011, 10:04:58 am »
Softfloat means that it uses software emulated floating point calculations, which works on any ARM chip

As far as I can tell, what you need to do to work around the NativeActivity thing is to create a small Java program which does a simple loadLibrary("main.so") call

chronozphere

  • New Member
  • *
  • Posts: 41
Re: OpenGL on android 2.2?
« Reply #2 on: November 24, 2011, 10:11:36 am »
Thanks. So softfloat shouldnt be a problem. :)

http://developer.android.com/reference/android/app/NativeActivity.html

Code: [Select]
    <!-- This is the platform API where NativeActivity was introduced. -->
    <uses-sdk android:minSdkVersion="8" />

The above would suggest that NativeActivity would also work in froyo right?

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: OpenGL on android 2.2?
« Reply #3 on: November 24, 2011, 11:30:32 am »
It would be really great if someone could achieve this, because my personal phone is HTC Wildfire which can be updated only up to 2.2 =( And I bought it less then 1 year ago ...

But the OpenGL code will need changes, because the example uses EGL which is available in 2.3+

I'm not so good in OpenGL, but if anyone could make this work it would be excellent =)

If noone else can do that, I am tempted to simply buying a newer phone or flash my ROM with an unofficial build, because this would save me a lot of time

chronozphere

  • New Member
  • *
  • Posts: 41
Re: OpenGL on android 2.2?
« Reply #4 on: November 24, 2011, 11:40:24 am »
Ok, we'd need to find a EGL replacement.

I'm still not very sure about the minimal SDK version that will support NativeActivity. I previously mentioned a source claiming that it was android-8, but the ndk/docs/STABLE-APIS.html seems to tell me that it's available on android-9 and up.

I'm afraid that supporting 2.2 requires a lot of JAVA wrapper code. :(

Andru

  • Full Member
  • ***
  • Posts: 112
    • Homepage
Re: OpenGL on android 2.2?
« Reply #5 on: November 24, 2011, 04:19:44 pm »
Quote
I'm afraid that supporting 2.2 requires a lot of JAVA wrapper code.
Few lines only for initialization OpenGL ES 1.x... :) Everything else - just a definition of new JAVA functions and classes.