Background:
On the imagination website, I studied a powervr SDK for OpenGL ES 2.0.
Http://www.imgtec.com/powervr/insider/sdkdownloads/index.asp#GLES2
3D engine development can be performed across different platforms. Currently, popular Android and IOS
Register and download the SDK on the Android platform and study the two-day environment.
Applicable:
It is suitable for Android users who use ndk to develop OpenGL ES-related 3D applications in C ++.
Purpose
I have encountered many problems during the construction process. I am only providing document backup, and the readers can use it for their own purposes and will not communicate with each other.
This article is the original summary from the previous achievements and does not provide any source for downloading any files. Learn the following documents before reading. Indicate the source for reprinting.
Reference webpage
Android ndk Development Environment Configuration:
Http://blog.csdn.net/hzhxxx/archive/2010/07/21/5752627.aspx
Cygwin FAQ:
Http://cs.nyu.edu /~ Yap/prog/cygwin/faqs.html # environ
Use android in Eclipse:
Http://wiki.phonegap.com/w/page/16494774/Getting-started-with-Android-PhoneGap-in-Eclipse
1. Install JDK
Jdk-6u25-windows-i586.exe
(Not detected after the first installation)
2. Install the android SDK (JDK required)
Installer_r11-windows.exe
Installation directory on
E:/Android-SDK
3. Start the SDK Manager SDK
Manager.exe (Android SDK must be installed)
Download and install android
SDK platform 2.3.3 api10 and Android SDK platform-tools R5
4. Install Android ndk
Android-ndk-r5-windows.zip
Extract
E:/Android-ndk
5. Install cygwin_setup
Select the default download and Installation
And additional download and Installation
Make GCC package under devlep
Install to E:/cygwin
6. Install ant, which must be later than version 1.8
Apache-ant-1.8.2-bin.zip
Decompress the package to E:/apacheant.
6.1 install ipvs with built-in ant, but it seems that the version is only 1.7, So I press 6 to directly install
Eclipse-java-helios-SR2-win32.zip
Decompress the package to E:/eclipse.
6.2 install ADT, eclips required
ADT-10.0.1.zip
Decompress the package to the eclipse installation path. E:/eclipse merge folder
6.3 configure ADT
Open eclipse and set the SDK path in Windows> preferences> androidy.
Click Apply to check the available Android versions under the SDK. Steps 1, 2, 4 are required.
7. set E:/cygwin. bat
Optional
Home
-- Home in cygwin installation path
Ndk
-- Ndk installation path
SDK
-- SDK installation path
Demo
-- Test the program path. I tested the powervr Android SDK.
Ant
-- Ant installation path
"
@ Echo off
E:
Chdir E:/cygwin/bin
Set Home =/cygdrive/e/cygwin/home/
Set ndk =/cygdrive/e/Android-ndk
Set SDK =/cygdrive/e/Android-SDK
Set demo =/cygdrive/f/data collection/powervr/sdk_android/demos
Set ant =/cygdrive/e/apacheant
Bash -- login-I
"
8. Run the demo experiment of cygwin.
1) test make and GCC. If the following command is correct, make and GCC are installed successfully.
Make
-V
Gcc
-V
2) view variables, reference variables, and set variables
Printenv
Home
$ Ndk
(Add the symbol "$" before referencing ")
Export
Path =.: $ ndk (path is a series of paths connected)
3) switch the directory to CD dir
CD
$ Demo/navigation3d/ogles2/build/android
Dir
View files in the current directory
4) run the android update project setting command: Android
Update Project-P
Android commands cannot be found
-Bash: Android: Command not found
Commands not referenced or environment variables not set
$ SDK/tools/Android. bat
(Note: There is no direct Android command. I only find the Android. BAT file)
Update
The-p parameter is missing in the project.
$ SDK/tools/Android. bat
Update Project-P./(./is under the current directory, and CD is required to the current directory)
5) Use ndk to compile the C ++ code into the so file ndk-build, provided that the CD is under the compilation directory.
The problem that the ndk-build command cannot be found
-Bash: ndk-Build: Command not found
$ Ndk/ndk-build
Clean
$ Ndk/ndk-build
6) Use ant to package the so and java files into APK, ant debug
The ant command cannot be found.
$ ANT/bin/ant
Debug or use eclipse to right-click build. xml and run as with ant.
The problem that cannot be found by com. Android. Ant. setuptask: taskdef
Class com. Android. Ant. setuptask cannot be found
The premise is that the current Android project has updated the properties and generated local. properties, which sets the SDK directory.
For example, my local. properties file is:
SDK. dir = E: // Android-SDK
Or you have used the command to update: Android
Update Project-P
The ant version is too low.
The
Android ant-based build system requires ant 1.8.0 or later. Current version is
1.7.1
Install a later version of ant and run it in cygwin.
$ ANT/bin/ant debug
7) install Android 2.3 and include OpenGL
The APK file is tested on the elasticsearch 2.0 hardware-accelerated mobile phone (Samsung i9000) and runs normally.