* Update: r3 of the Android NDK has been released with OpenGL ES 2.0 support get it here *
The Motorola Droid and the Nexus One are the first Android phones with graphics hardware that support OpenGL ES 2.0. Developers have not yet had access to the advanced graphics API in the latest Android SDK/NDK , but it looks like official support for ES 2.0 in the Android NDK is imminent as the latest NDK code in the Android Open Source Project includes the libraries needed to access the OpenGL ES 2.0 API. If you are impatient like I am and would like to dip your toes into the strange world of vertex and fragment shaders, here is a quick way of getting OpenGL ES 2.0 support up and running in the current release of the Android SDK. ( This has been tested on OS X and a Nexus One, I would imagine it would work with Linux and the Droid too, no idea about Windows)
The first step is to download the latest Android source code from AOSP. The project we are interested in is in: development/ndk. Copy the ndk directory wherever you want. The NDK is missing the platform specific ARM toolchain binaries so we are just going to get those from the 1.6 release of the NDK which you can find here. Copy the build/prebuilt/ directory of the 1.6 NDk to the build/ directory of the 2.0 NDK.
The next step is to run the host-setup.sh script in build/
sh build/host-setup.sh
After the set up script runs we are ready to build the sample hello-gl2 that conveniently comes with the new NDK. This project contains all the code you need to set up the application and native parts to support ES 2.0.
make APP=hello-gl2
This will compile all of the native code and copy the binary to the libs/ directory of the Android project.
After this is finished we can build and install the application found in apps/hello-gl2/project/ onto our Android 2.0+ device and see ES 2.0 in action!
Pretty awesome right? I will save actual OpenGL ES 2.0 walkthroughs for later as I go through the ES 2.0 book, but the source included in the hello-gl2 project should be enough to get you started. Obviously this is all unsupported and unofficial and you should more than likely not release apps using these APIs onto the market until the Official SDK is updated.
You certainly wouldn’t want to release a Live Wallpaper using this code because it would probably get 1 star as most users are unimpressed that you got ES 2.0 working


