How do I correctly instantiate Android OpenGLES?

I’ve been working on porting my latest game over to Android, but I’m stuck on one VERY important detail. How do I correctly instantiate my openGLES environment?

I was using this example on the Android developer site:
http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/GLSurfaceViewActivity.html
but that only starts up the surface, and I’m not sure how to tie into it to run my openGL loop.
I’ve also heard that it’s best to run your logic updates and graphic updates as separate threads on Android devices… is this really true?

Does anyone have a tutorial or some sample code that would help me understand this better? A lot of the examples I’ve found thus far have only been for 2D games, and pretty poorly designed at that (they don’t even use a timer).

Any help would be appreciated! ;D

Here is some code that manages the OpenGL surface:
http://code.google.com/p/skorpios/source/browse/trunk/skorpios-android/src/com/esotericsoftware/skorpios/opengl/AndroidGLView.java
It is a modified / cleaned up version of some sample code (I forget the original class name). The game loop starts on line 171. It is a bit hairy since it has to manage creating and resizing the OpenGL surface. It also buffers key and touch events that happen on the UI thread and fires them on the game thread.

You might check out Skorpios:
http://code.google.com/p/skorpios/
It lets you develop an OpenGL app on the desktop and run it on your phone using the same codebase. Desktop development is much, much faster.

Thanks Nate! I’ll start reading through that code.

My desktop engine is already set. The main issue has been “dummying” it down for use on Android. My other issue is that I don’t actually own an Android phone, so I’m running everything in the virtual device created by the SDK. To tell you the truth, I’m not even sure why I’m porting it to Android in the first place, except that the game feels like something that would play well on a mobile device.