简体   繁体   English

在Visual Studio 2015 c ++中构建android native app

[英]build android native app in Visual Studio 2015 c++

I am trying to build an android native app in Visual Studio 2015 c++. 我正在尝试在Visual Studio 2015 c ++中构建一个Android本机应用程序。 I opened the visual studio project using the template which is Visual C++-> Cross Platform-> Native-activity Application(Android). 我使用的模板是Visual C ++->跨平台->本机活动应用程序(Android),打开了Visual Studio项目。 左侧是我打开的项目,而右侧是我找到的示例

I did android app before in android studio. 我之前在android studio中做了android应用。 I know that the project need layout xml as well as src but all those things come with open new project. 我知道该项目需要xml和src布局,但是所有这些东西都随新项目一起打开。 However, the project i opened is lack of src folder and layout xml. 但是,我打开的项目缺少src文件夹和布局xml。 In this case, am i need to add all these files myself? 在这种情况下,我需要自己添加所有这些文件吗? If not, how can i manipulate the GUI in app? 如果没有,我该如何在应用程序中操作GUI?

I actually new in native activity application. 我实际上是本机活动应用程序的新手。 Is it i set the GUI using java and type all the c++ coding in native activity? 我是否使用Java设置GUI并在本机活动中键入所有C ++编码? And what is the difference between this and jni? 和jni有什么区别?

You can use the NDK to write C++ code and you can either use the JNI to interface this code with a Java Android app or you can write a NativeActivity which provides the interface to application lifecycle events for your convenience. 您可以使用NDK编写C ++代码,也可以使用JNI将此代码与Java Android应用程序接口,也可以编写NativeActivity来提供应用程序生命周期事件的接口,以方便您。 For my example I will use the JNI approach and I will create the project using Android Studio.After creating a new Blank Activity app I had to set up a few things:... http://peted.azurewebsites.net/visual-studio-2015-preview-mobile-c/ 在我的示例中,我将使用JNI方法,并使用Android Studio创建项目。创建新的Blank Activity应用程序后,我必须设置一些内容:... http://peted.azurewebsites.net/visual-工作室2015年预览移动-C /

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

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