Cross-platform mobile development examples

Several of the templates installed by the Mobile development with C++ workload generate complete examples that you can use to learn from. Additionally, here are some example applications that you can download and try out in Visual Studio.

  • hello-jni Android Application Sample

    This sample is a port of the Android NDK hello-jni application. The sample demonstrates an end-to-end Java Native Interface "Hello World" app. It loads a string from a native method implemented in a shared library, and then displays it in the app.

  • TwoLibs Android Library Sample

    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.

  • test-libstdcpp Android Library Sample

    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.

    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.

    To build the sample, press F7, or on the menu bar, choose Build, Build Solution.

See also

Android NDK samples