Skip to content

Commit 8a96a65

Browse files
authored
Merge pull request #5572 from corob-msft/cr-cpp-mdd-updates
Make C++ Android docs version agnostic
2 parents 5c193d2 + 8462104 commit 8a96a65

11 files changed

+245
-229
lines changed

docs/cross-platform/build-an-opengl-es-application-on-android-and-ios.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: "Build an OpenGL ES Application on Android and iOS | Microsoft Docs"
2+
title: "Build an OpenGL ES application on Android and iOS | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "09/17/2019"
4+
ms.date: "10/09/2019"
55
ms.technology: vs-ide-mobile
66
ms.topic: "conceptual"
77
dev_langs:
@@ -19,13 +19,13 @@ You can create Visual Studio solutions and projects for iOS apps and Android app
1919

2020
## Requirements
2121

22-
Before you can create an OpenGL ES app for iOS and Android, make sure you've met all system requirements. If you haven't already, install the Mobile Development with C++ workload in the Visual Studio Installer. To build for iOS, include the optional C++ iOS development tools. To build for Android, install the C++ Android development tools and the required third-party tools: Android NDK, Apache Ant, and Google Android Emulator. For better emulator performance on Intel platforms, we recommend you also install the Intel Hardware Accelerated Execution Manager (HAXM). Next, configure Intel HAXM and the Android Emulator to run on your system. For more information and detailed instructions, see [Install Visual C++ for cross-platform mobile development](../cross-platform/install-visual-cpp-for-cross-platform-mobile-development.md).
22+
Before you can create an OpenGL ES app for iOS and Android, make sure you've met all system requirements. If you haven't already, install the Mobile Development with C++ workload in the Visual Studio Installer. To get the OpenGL ES templates, and to build for iOS, include the optional C++ iOS development tools. To build for Android, install the C++ Android development tools and the required third-party tools: Android NDK, Apache Ant, and Google Android Emulator. For better emulator performance on Intel platforms, we recommend you also install the Intel Hardware Accelerated Execution Manager (HAXM). Next, configure Intel HAXM and the Android Emulator to run on your system. For more information and detailed instructions, see [Install cross-platform mobile development with C++](../cross-platform/install-visual-cpp-for-cross-platform-mobile-development.md).
2323

2424
To build and test the iOS app, you'll need a Mac computer, set up according to the installation instructions. For more information about how to set up for iOS development, see [Install and configure tools to build using iOS](../cross-platform/install-and-configure-tools-to-build-using-ios.md).
2525

2626
## Create a new OpenGLES Application project
2727

28-
In this tutorial, you first create a new OpenGL ES Application project. and then build and run the default app in the Visual Studio Emulator for Android. Next you build the app for iOS and run the app on an iOS device.
28+
In this tutorial, you first create a new OpenGL ES Application project. and then build and run the default app in an Android emulator. Next you build the app for iOS and run the app on an iOS device.
2929

3030
::: moniker range="vs-2017"
3131

@@ -69,7 +69,7 @@ The solution has two projects to build the apps for the Android and iOS platform
6969

7070
- `MyOpenGLESApp.Android.Packaging` creates the *.apk* file for deployment on an Android device or emulator. This file contains the resources and AndroidManifest.xml file where you set manifest properties. It also contains the *build.xml* file that controls the Ant build process. It's set as the startup project by default, so that it can be deployed and run directly from Visual Studio.
7171

72-
- **MyOpenGLESApp.iOS.Application** contains the resources and Objective-C glue code to create an iOS app that links to the C++ static library code in `MyOpenGLESApp.iOS.StaticLibrary`. This project creates a build package that is transferred to your Mac by Visual Studio and the remote agent. When you build this project, Visual Studio sends the files and commands to build and deploy your app on the Mac.
72+
- `MyOpenGLESApp.iOS.Application` contains the resources and Objective-C glue code to create an iOS app that links to the C++ static library code in `MyOpenGLESApp.iOS.StaticLibrary`. This project creates a build package that is transferred to your Mac by Visual Studio and the remote agent. When you build this project, Visual Studio sends the files and commands to build and deploy your app on the Mac.
7373

7474
## Build and run the Android app
7575

@@ -97,7 +97,7 @@ The solution created by the template sets the Android app as the default project
9797

9898
If you have installed other emulators or connected an Android device, you can choose them in the deployment target drop-down list. To run the app, the built Solution Platform must match the platform of the target device.
9999

100-
1. Press F5 to start debugging, or Shift+F5 to start without debugging.
100+
1. Press **F5** to start debugging, or **Shift**+**F5** to start without debugging.
101101

102102
Visual Studio starts the emulator, which takes several seconds to load and deploy your code. Here's how the app appears in the emulator:
103103

@@ -121,7 +121,7 @@ To deploy an iOS app to an iOS device, you must also set up automatic signing on
121121

122122
### To set up automatic signing on Xcode
123123

124-
1. If you haven't already, install [Xcode](https://developer.apple.com/xcode/downloads/) version 10.2.1 or later on your Mac.
124+
1. If you haven't already, install [Xcode](https://developer.apple.com/xcode/) on your Mac.
125125

126126
1. Open the Xcode app on your Mac.
127127

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Create an Android Native Activity App | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/04/2016"
4+
ms.date: "10/17/2019"
55
ms.technology: vs-ide-mobile
66
ms.topic: "conceptual"
77
dev_langs:
@@ -15,37 +15,53 @@ ms.workload:
1515
---
1616
# Create an Android Native Activity App
1717

18-
When you install the Visual C++ for Cross-Platform Mobile Development option, Visual Studio 2015 can be used to create fully functional Android Native Activity apps. The Android Native Development Kit (NDK) is a toolset that allows you to implement the majority of your Android app using pure C/C++ code. Some Java JNI code acts as glue to allow your C/C++ code to interact with Android. The Android NDK introduced the ability to create Native Activity apps with Android API Level 9. Native Activity code is popular for creating gaming and graphic intensive apps that use Unreal Engine or OpenGL. This topic will guide you through creation of a simple Native Activity app that uses OpenGL. Additional topics walk through the developer lifecycle of editing, building, debugging and deploying Native Activity code.
18+
When you install the cross-platform **Mobile development with C++** workload, Visual Studio can be used to create fully functional Android Native Activity apps. The Android Native Development Kit (NDK) is a toolset that allows you to implement the majority of your Android app using pure C/C++ code. Some Java JNI code acts as glue to allow your C/C++ code to interact with Android. The Android NDK introduced the ability to create Native Activity apps with Android API Level 9. Native Activity code is popular for creating gaming and graphic intensive apps that use Unreal Engine or OpenGL. This topic will guide you through creation of a simple Native Activity app that uses OpenGL. Additional topics walk through the developer lifecycle of editing, building, debugging and deploying Native Activity code.
1919

2020
## Requirements
2121

22-
Before you can create an Android Native Activity app, you must make sure you've met all system requirements, and installed the Visual C++ Mobile Development option in Visual Studio 2015. For more information, see [Install Visual C++ for Cross-Platform Mobile Development](../cross-platform/install-visual-cpp-for-cross-platform-mobile-development.md). Make sure that the required third-party tools and SDKs are included in the installation, and that the Microsoft Visual Studio Emulator for Android is installed.
22+
Before you can create an Android Native Activity app, you must make sure you've met all system requirements, and installed the **Mobile development with C++** workload in Visual Studio. For more information, see [Install cross-platform mobile development with C++](../cross-platform/install-visual-cpp-for-cross-platform-mobile-development.md). Make sure that the required third-party tools and SDKs are included in the installation, and that an Android emulator is installed.
2323

2424
## Create a new Native Activity project
2525

26-
In this tutorial, you'll first create a new Android Native Activity project and then build and run the default app in the Visual Studio Emulator for Android.
26+
In this tutorial, you'll first create a new Android Native Activity project and then build and run the default app in an Android emulator.
27+
28+
::: moniker range="vs-2017"
2729

2830
1. In Visual Studio, choose **File** > **New** > **Project**.
2931

30-
2. In the **New Project** dialog box, under **Templates**, choose **Visual C++** > **Cross Platform**, and then choose the **Native-Activity Application (Android)** template.
32+
1. In the **New Project** dialog box, under **Templates**, choose **Visual C++** > **Cross Platform**, and then choose the **Native-Activity Application (Android)** template.
33+
34+
1. Give the app a name like *MyAndroidApp*, and then choose **OK**.
35+
36+
![Create a Native Activity project](../cross-platform/media/cppmdd_newproject.PNG "CppMDD_NewProject")
37+
38+
Visual Studio creates the new solution and opens Solution Explorer.
39+
40+
![Native Activity project in Solution Explorer](../cross-platform/media/cppmdd_rc_na_solutionexp.PNG "CPPMDD_RC_NA_SolutionExp")
41+
42+
::: moniker-end
43+
44+
::: moniker range=">=vs-2019"
45+
46+
1. In Visual Studio, choose **File** > **New** > **Project**.
3147

32-
3. Give the app a name like `MyAndroidApp`, and then choose **OK**.
48+
1. In the **Create a new project** dialog box, select the **Native-Activity Application (Android)** template, and then choose **Next**.
3349

34-
![Create a Native Activity project](../cross-platform/media/cppmdd_newproject.PNG "CppMDD_NewProject")
50+
1. In the **Configure your new project** dialog box, enter a name like *MyAndroidApp* in **Project name**, and then choose **Create**.
3551

36-
Visual Studio creates the new solution and opens Solution Explorer.
52+
Visual Studio creates the new solution and opens Solution Explorer.
3753

38-
![Native Activity project in Solution Explorer](../cross-platform/media/cppmdd_rc_na_solutionexp.PNG "CPPMDD_RC_NA_SolutionExp")
54+
::: moniker-end
3955

40-
The new Android Native Activity app solution includes two projects:
56+
The new Android Native Activity app solution includes two projects:
4157

4258
- `MyAndroidApp.NativeActivity` contains the references and glue code for your app to run as a Native Activity on Android. The implementation of the entry points from the glue code are in *main.cpp*. Precompiled headers are in *pch.h*. This Native Activity app project is compiled into a shared library *.so* file which is picked up by the Packaging project.
4359

4460
- `MyAndroidApp.Packaging` creates the *.apk* file for deployment on an Android device or emulator. This contains the resources and *AndroidManifest.xml* file where you set manifest properties. It also contains the *build.xml* file that controls the Ant build process. It's set as the startup project by default, so that it can be deployed and run directly from Visual Studio.
4561

4662
## Build and run the default Android Native Activity app
4763

48-
Build and run the app generated by the template to verify your installation and setup. For this initial test, run the app on one of the device profiles installed by the Visual Studio Emulator for Android. If you prefer to test your app on another target, you can load the target emulator or connect the device to your computer.
64+
Build and run the app generated by the template to verify your installation and setup. For this initial test, run the app on one of the device profiles installed by the Android emulator. If you prefer to test your app on another target, you can load the target emulator or connect the device to your computer.
4965

5066
## To build and run the default Native Activity app
5167

@@ -55,22 +71,22 @@ Build and run the app generated by the template to verify your installation and
5571

5672
If the **Solution Platforms** list isn't showing, choose **Solution Platforms** from the **Add/Remove Buttons** list, and then choose your platform.
5773

58-
2. On the menu bar, choose **Build** > **Build Solution**.
74+
1. On the menu bar, choose **Build** > **Build Solution**.
5975

6076
The Output window displays the output of the build process for the two projects in the solution.
6177

62-
3. Choose one of the VS Emulator Android Phone (x86) profiles as your deployment target.
78+
1. Choose one of the Android emulator profiles as your deployment target.
6379

6480
If you have installed other emulators or connected an Android device, you can choose them in the deployment target dropdown list.
6581

66-
4. Press **F5** to start debugging, or Shift+F5 to start without debugging.
82+
1. Press **F5** to start debugging, or **Shift**+**F5** to start without debugging.
6783

68-
Here's what the default app looks like in the Visual Studio emulator for Android.
84+
Here's what the default app looks like in an Android emulator.
6985

70-
![The emulator running your app](../cross-platform/media/cppmdd_emulator_running_app.PNG "CppMDD_Emulator_Running_App")
86+
![The emulator running your app](../cross-platform/media/cppmdd_emulator_running_app.PNG "CppMDD_Emulator_Running_App")
7187

72-
Visual Studio starts the emulator, which takes a few seconds to load and deploy your code. Once your app has started, you can set breakpoints and use the debugger to step through code, examine locals, and watch values.
88+
Visual Studio starts the emulator, which takes a few seconds to load and deploy your code. Once your app has started, you can set breakpoints and use the debugger to step through code, examine locals, and watch values.
7389

74-
5. Press **Shift**+**F5** to stop debugging.
90+
1. Press **Shift**+**F5** to stop debugging.
7591

76-
The emulator is a separate process that continues to run. You can edit, compile, and deploy your code multiple times to the same emulator.
92+
The emulator is a separate process that continues to run. You can edit, compile, and deploy your code multiple times to the same emulator.

docs/cross-platform/cross-platform-mobile-development-examples.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: "Cross-Platform Mobile Development Examples | Microsoft Docs"
2+
title: "Cross-platform mobile development examples | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/04/2016"
4+
ms.date: "10/17/2019"
55
ms.technology: vs-ide-mobile
66
ms.topic: "conceptual"
77
dev_langs:
@@ -14,7 +14,8 @@ ms.workload:
1414
- "xplat-cplusplus"
1515
---
1616
# Cross-platform mobile development examples
17-
Several of the templates installed by Visual C++ for Cross-Platform Mobile Development generate complete examples that you can use to learn from. Additionally, the Windows Dev Center has several example applications that you can download and try out in Visual Studio.
17+
18+
Several of the templates installed by the **Mobile development with C++** workload generate complete examples that you can use to learn from. Additionally, the Windows Dev Center has several example applications that you can download and try out in Visual Studio.
1819

1920
- [hello-jni Android Application Sample](https://code.msdn.microsoft.com/hello-jni-Android-790ab73d)
2021

@@ -30,7 +31,7 @@ Several of the templates installed by Visual C++ for Cross-Platform Mobile Devel
3031

3132
- [TwoLibs Android Library Sample](https://code.msdn.microsoft.com/TwoLibs-Android-Library-6396e5c4)
3233

33-
This sample is a port of the Android NDK TwoLibs sample. It uses both a dynamically loaded shared library, and a static C++ Android native library, that implements a method called from a Java Native Interface app. This sample is a good starting point for developers to understand how to use static/dynamic shared libraries to build an end-to-end JNI Android application with Visual Studio 2015.
34+
This sample is a port of the Android NDK TwoLibs sample. It uses both a dynamically loaded shared library, and a static C++ Android native library, that implements a method called from a Java Native Interface app. This sample is a good starting point for developers to understand how to use static/dynamic shared libraries to build an end-to-end JNI Android application with Visual Studio.
3435

3536
- [Tea Pot Android Application Sample](https://code.msdn.microsoft.com/Tea-Pot-Android-Application-e7c05d73)
3637

@@ -42,7 +43,7 @@ Several of the templates installed by Visual C++ for Cross-Platform Mobile Devel
4243

4344
- [test-libstdcpp Android Library Sample](https://code.msdn.microsoft.com/test-libstdcpp-Android-00b548f5)
4445

45-
This sample is a port of the Android NDK test-libstdc++ sample, specifically for use with Visual Studio 2015. This sample is a good starting point for developers to understand how to use the Standard Library.
46+
This sample is a port of the Android NDK test-libstdc++ sample, specifically for use with Visual Studio. This sample is a good starting point for developers to understand how to use the Standard Library.
4647

4748
To open one of the examples in Visual Studio, download the zip file and open the **Properties** page of the downloaded file in Explorer. Choose the **Unblock** button then choose **OK**. Extract the contents of the zip file to a convenient location, then open the C++ folder in the extracted sample and open the solution file.
4849

0 commit comments

Comments
 (0)