10.2NDK编译环境下载Android NDK的安装包DownloadtheAndroidNDKThe Android NDK is a companion tool to theAndroid SDK that lets youbuild performance-critical portions of yourapps inibuildactivities,handleuserinput,usehardwaresensors,accessapplicationresources,andmore,whenprogrammingin(packaged intoanapkfileandtheystill run insideofa virtual machineonthedevice.Thefundamental AndroidapplicationUsingnative codedoesnotresult in an automaticperformanceincrease,butalways increasesapplication complexity.if yAPls.youprobablydonotneedtheNDKReadWhatistheNDK?formoreinformationaboutwhattheNDKoffersandwhTheNDK is designed foruse only in conjunction with the Android SDK. If you have not already installed and setup the AnsPlatformPackageSizeMD5ChecksumWindows80361803bytesandroid-ndk-r7c-windows.zipe86184cdc4bf71d32fa9185fad8544e2MacOSX(intel)android-ndk-r7c-darwin-x86.tar.bz273836512bytes025f57feb5f32ed993a5fa7f5996477dLinux32/64-bit (x86)android-ndk-r7c-linux-x86.tarbz263432410bytesObc21b78823dcf6f86b988203626b1fe
10.2 NDK编译环境 ◼ 下载Android NDK的安装包
10.2NDK编译环境下载AndroidNDK的安装包口将下载的ZIP文件解压缩到用户的Android开发目录中作者将AndroidNDK解压到D:VAndroid目录中,ZIP文件中包含一层目录,因此AndroidNDK的最终路径为D:Androidl android-ndk-r7c
10.2 NDK编译环境 ◼ 下载Android NDK的安装包 ❑ 将下载的ZIP文件解压缩到用户的Android开发目录中, 作者将Android NDK解压到D:\Android目录中,ZIP文件 中包含一层目录,因此Android NDK的最终路径为 D:\Android\ android-ndk-r7c
10.2NDK编译环境为EcllipseAndroid工程添加一个Builder步骤一、创建或打开一个Android项目中步骤二、为该项目添加一个Builder福点击Project->Properties->Builders->New,新建立一个Builder。在弹出的对话框上面点击ProgramPropertiesforTestNDKDype filter textBulldersResourceConfigure the builders for the project:AndroidiAndroidResourceManagerNevAndroidLintPreferencesAndroid PreCompilerBuildersimport.JavaBuilderJavaBuitdPathAndroid Package BuilderJava Code StyleJava CompilerJava EditorChooseconfiguration typeJavadoc LocationProject ReferencesChoose an external tool type to create:Run/Debug SettingsTask RepositoryTask TagsCProgramWikiTextXML Syntax??OF
10.2 NDK编译环境 ◼ 为Ecllipse Android工程添加一个Builder ❑ 步骤一、创建或打开一个Android项目 ❑ 步骤二、为该项目添加一个Builder ◼ 点击Project->Properties->Builders->New,新建立一个Builder 。在弹出的对话框上面点击Program
10.2NDK编译环境在弹出的对话框【EditConfiguration】中,配置选项卡【Main :口Location中需要填入nkd-build.cmd的路径(NDK安装目录下)WorkingDiretcoty中需要填入Android的工程根目录。XEditConfigurationEdit launch configuration propertiesCreatea configuration thatwill run a program duringbuildsNameNDK_BuilderMainRefreshEnvironmentBuildOptionsLocation:D:/Android/android-ndk-r7elndk-build.cmdBrowseWorkspace.BrowseFile System.Variables..WorkingDirectoryD:/Androidandroid-ndk-r7cisamples/hello-iniBrowseWorkspace.BrowseFile System.Variables...Arguments:Variables
10.2 NDK编译环境 ◼ 在弹出的对话框【Edit Configuration】中,配置选项卡【 Main】: ❑ Location中需要填入nkd-build.cmd的路径(NDK安装目录下)。 ❑ Working Diretcoty中需要填入Android的工程根目录
10.2NDK编译环境在弹出的对话框【EditConfiguration】中,配置选项卡【Refreshl勾选“Refreshresourcesuponcompletion"司勾选“Theentireworkspace",勾选“Recuresivelyincludesub-folders”网Createa configuration that will run a program during buildsNDKBuildeName:RefreshEnvironmentBuildOptionsMaRefreshresourcesuponcompletion.OTheentireworkspacTheselectedresourceTheproject containing the selected resourceThefolder.containingthe selected resourceSpecificresourcesRecursivelyincludesub-folders
10.2 NDK编译环境 ◼ 在弹出的对话框【Edit Configuration】中,配置选项卡【 Refresh】: ❑ 勾选“Refresh resources upon completion”, ❑ 勾选“The entire workspace”, ❑ 勾选“Recuresively include sub-folders