如何开始使用 Android Studio C++ 开发

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32150500/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-28 14:05:51  来源:igfitidea点击:

How to get started with Android Studio C++ development

c++android-studioandroid-ndk

提问by proppy

I heard at Google I/O 15 that Android Studio has now C++ support, the official documentation for the NDKonly has instructions for Eclipse.

我在 Google I/O 15 上听说 Android Studio 现在有 C++ 支持,NDK的官方文档只有 Eclipse 的说明。

How does one get started with Android C++ development using Android Studio?

如何开始使用 Android Studio 进行 Android C++ 开发?

回答by proppy

There is detailed instructions on the Android NDK Previewsite.

Android NDK 预览站点上有详细说明。

The gist of it

它的要点

  • DownloadAndroid Studio 1.3+
  • Install the NDK bundle from Tools > Android > SDK ManagerNDK in android sdk manager
  • Import the hello-jn sample using File > Import Sample(Note: This sample is using the new gradle-experimentalplugin) import sample diaglog
  • Click Run > Edit Configurations...and andd a new Android Nativeconfiguration native run configuration
    (source: android.com)

  • Run and debug your application as usual

  • 下载Android Studio 1.3+
  • Tools > Android > SDK Manager安装 NDK 包android sdk 管理器中的 NDK
  • 使用File > Import Sample导入 hello-jn 示例(注意:此示例使用的是新gradle-experimental插件) 导入示例对话框
  • 单击Run > Edit Configurations...并添加一个新的Android Native配置 (来源:android.com本机运行配置

  • 像往常一样运行和调试您的应用程序

A few things to try from there:

从那里可以尝试一些事情: