Graphics Programs Reference
In-Depth Information
OpenGL Surface View
ES 2.0 applications can be easily developed for Android devices using the Android
SDK. The best part about creating such applications using this SDK is that there is
no need for any external library (something that can be quite burdensome for new ES
2.0 application developers on iPhone).
There is another way to create Android ES 2.0 applications—using the Android Nat-
ive Development Kit ( NDK ). In some cases, NDK can make ES 2.0 applications
faster than those made using SDK. NDK lets users code in native languages, such
as C and C++. This makes it possible to use popular libraries written using C/C++,
but only at the cost of increased complexity. Beginner ES 2.0 application developers
may find this difficult to deal with, which can ultimately make NDK counter-pro-
ductive. NDK is typically a tool for advanced Android developers, but be assured the
performance gap between most ES 2.0 applications created using SDK and NDK is
becoming negligible.
Note Do not use NDK simply because you like coding your applic-
ations in C/C++; use it only for cases in which performance is critic-
al to your application. Also, remember that Dalvik VM is becoming
faster, reducing the performance gap between SDK and NDK.
Determining OpenGL ES Version
To demonstrate the ease of developing ES 2.0 applications for Android devices, a
quick example is given here for creating an OpenGL surface view. This view is dif-
ferent from the XML view (UI layout) you have generally created for most Android
applications. ( Chapter 3 contains a detailed account of OpenGL surface view.)
Before I discuss this example, you need to determine the version of OpenGL ES on
your Android device. To do so, let's create a blank Activity :
1. In the Eclipse toolbar, click the icon to open wizard to create a new
Android project.
Search WWH ::

Custom Search