简体   繁体   English

我可以通过Visual C ++将C ++中的空项目转换为android应用吗?

[英]Can I convert an empty project in C++ to an android app through Visual C++?

Like I want to convert a C++ project that I made in VS to an android app. 就像我想将在VS中创建的C ++项目转换为android应用一样。 And I found out that there is a Visual C++ android development kit available in VS. 我发现VS中有一个Visual C ++ android开发工具包。 So will there be any need of using Java? 那么会有使用Java的需求吗? (as building an android app usually requires) (因为通常需要构建android应用)

You can indeed create a Visual Studio project that uses the Android NDK to build an Android app from pure C++ code. 您确实可以创建一个使用Android NDK从纯C ++代码构建Android应用程序的Visual Studio项目。 The C++ code is compiled into a library that a little bit of Java glue code calls into, and this combination, along with your resources, is packaged into an .APK that you can install. C ++代码被编译到一个库中,以供Java胶水代码调用,该组合以及您的资源被打包到一个.APK中,您可以进行安装。 You don't have to edit or otherwise modify the Java code at all; 您根本不需要编辑或修改Java代码; all your program logic can be in C++. 您所有的程序逻辑都可以使用C ++。

Technically speaking, you can't easily convert an existing VS project into an Android project, but you can copy your code into a new project that creates an Android app, or copy it into a shared code project that is picked up by a project that creates a library for Android that you can call from an app written in either Java or C++. 从技术上讲,您不能轻松地将现有的VS项目转换为Android项目,但可以将代码复制到创建Android应用程序的新项目中,或将其复制到由以下项目选择的共享代码项目中为Android创建一个库,您可以从用Java或C ++编写的应用程序中调用该库。 The project templates in VS give simple examples of doing each of these things. VS中的项目模板提供了执行这些操作的简单示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM