Top 10 reasons to use Visual Studio for C++ Android Development!

Ankit Asthana

Visual Studio: C++ cross-platform mobile solution

Visual Studio (download here) is fast becoming a cross-platform C++ IDE. Our vision is for Visual Studio to become the IDE of choice for your cross-platform C++ code whether you are targeting, Windows (UWP), Android, iOS, Linux, Xbox, PlayStation, Marmalade or more. In the past year or so, we have enabled support for Android, iOS (in preview) targeting, improved integration with the popular cross-platform game engine Marmalade, introduced a new compiler toolset (Clang/C2) for improving code portability between Windows and non-Windows platforms. If you talk about the Android platform specifically which is what this post is really about, typically the use of C++ is common for applications which are computationally intensive such as games and physics simulations but many applications today are using C++ for its cross-platform nature to author a part or entirety of their application.

There are many examples of this phenomenon which is especially common for more sophisticated development shops out there.  Platform defining, cross-platform, new trendy applications such as Facebook Moments, Dropbox, Office, Skype, popular games (e.g. Fruit Ninja, Clash of Clans, EA Sports titles) are all written in cross-platform C++.  Talking more numbers if you take a look at the top 50 android applications a vast chunk of them (~75%) of them leverage C++. In today’s cross-platform world, if you want to optimize for fast iteration, app performance, and native look and feel. After weighing the alternatives out there most of these top development firms choose to write their UI in platform-specific code and the business logic in shared code using C++. 

With this in mind the native Visual Studio Android experience was released in early 2015 last year, and we have had pretty good reception and feedback from our customers. To provide you some highlights, our customers include Halfbrick Studios (makers of popular games such as Fruit Ninja, Jet Pack Joyride), Electronic Arts, Synergex, Autodesk and almost all internal Microsoft products such as Office, Bing, Minecraft, Hyperlapse and more. 

Image 1738 halfbrick          Popular game Fruit Ninja building with Visual Studio Android development experience

 So here are top ten reasons (in no particular order) on why Visual Studio is the right choice for your C++ Android development:

  1.  Easily acquire all your Android platform needs
  2.  Jump start your Android development with  C++ cross-platform templates and samples
  3.  One C++ IDE to target all mobile platforms  (iOS, Android, Windows and more)
  4.  Leverage powerful cross-platform coding tools 
  5.  Share your cross-platform C++ code easily
  6.  Fastest C++ builds with Incredibuild support 
  7.  The fastest and most robust debugging experience for your Android application
  8.  Leverage the best in Breed, free Android Emulator
  9.  Gather your application insights easily using HockeyApp 
10.  Visual Studio is the cross-platform mobile solution (Xamarin, Apache Cordova) and just not limited to cross-platform C++

Now that you have a rough overview, Let’s learn more about them in detail.

Top 10 reasons to use Visual Studio for C++ Android Development

#1. Easily acquire all your Android platform needs
Visual Studio acts as your one-stop shop for all your C++ Android development needs. This includes Android Development Kits (SDK, NDK), Apache Ant, Oracle Java JDK, Microsoft Android Emulator and the templates, samples we provide for providing you a quick start. In addition to this with the new live update mechanism in Visual Studio allows us to update your Android development environment on the fly as Google provides updates or we introduce new features for an improved development experience. 

   Image 1157 Acquisition

#2. Jump start your Android development with  C++ cross-platform templates and samples
Visual Studio gives you a head start by providing you a variety of templates and samples out-of-the-box. The templates provided today demonstrate how to build an Android Native Activity application, Android Java Native Interface (JNI) application, an Android application with C++ shared code also building an iOS and Windows application and more. 

Image 4064 templates

The Visual Studio Android samples today provide the NDK samples ported over to build and operate in Visual Studio. In the future we plan to also introduce other templates and samples for popular cross-platform C++ technologies and game-engines as well.

Image 0815 samples

 #3. One C++ IDE to target all mobile platforms
In addition to Android, Visual Studio also provides support for writing Windows and iOS applications. Developers can build for all these platforms using a single solution file, leverage the same world class code-authoring and debugging experience all within Visual Studio.

Image 0488 GameLib

#4. Leverage powerful cross-platform coding tools 
Visual Studio offers a rich coding experience for Android developers, whether they are authoring Java or C++ code. Yes! Visual Studio 2015 recently also introduced support for Java primarily to support Android developers who have a lot of C++ code but also have some Java code and had to use other editors for this portion of the code-base.

While the Java language service experience is still in it’s preview it provides a basic code-navigation and intellisense experience, here is a short video which provides an overview on how this experience plays out today. The C++ coding experience is complete and offers services for code-navigation, intellisense and even advanced refactoring features. All in all Visual Studio is a one-stop shop for a complete Android coding experience.

Image 7271 Java1

    Image 8546 quickinfo   Image 5852 Java3

#5. Share your cross-platform C++ code easily
Visual Studio is a platform and in addition to Android development also allows for developing applications for iOS, Linux, Windows, Xbox, PlayStation and more. If you are currently working on a cross-platform application with a major chunk of code in C++ and frustrated with the use of multiple IDE’s, toolchains, debuggers, build systems using Visual Studio is worth a shot. With using Visual Studio you can easily share and re-use your existing C++ source through our shared project component and ability to target multiple platforms.

To learn more, please refer how Half Brick makers of popular mobile games Fruit Ninja and Jetpack Joyride use Visual Studio for a C++ cross-platform mobile development experience

Image 2134 ShareCode

#6. World Class Android Native Application debugging experience
We started working on developing an Android development experience primarily to support internal Microsoft teams such as Office, Bing, Skype, Minecraft and others as at the time the Android development experience for C++ application was pretty tribal. Working with these large scale applications provided us the opportunity to fine tune for scalability, correctness and speed when debugging C++ code, we performed multiple optimizations to the GDB back-end debugger to make this possible. Furthermore the Android debugging experience in Visual Studio, is not limited to C++ and also supports Java debugging (here’s a short video which illustrates the newly enabled Java debugging experience).

The debugging experience today in Visual Studio also supports for debugging pre-built Android application via other IDE(s), other basic debugger capabilities (Breakpoints, stepping, watch, tracepoints, conditional breakpoints) and advanced features such as debugger visualizations (Natvis Support) and attaching to a running Android application as well! 

Image 3056 Debug
 #7. Fastest C/C++ Android Application builds
Microsoft Visual Studio partners with Xoreax Incredibuild to provide the fastest build experience out-of-the-box when you are building on your local machine by building parallelized build plans, performing dynamic resource management and providing a slew of diagnostic tools to understand and trouble shoot bottlenecks (Yes! All this is free). In addition to this by leveraging Incredibuild paid SKU developers can also set-up other accelerator agents to achieve multi-x build improvements over a distributed network. Here is an example below, of building the popular open-source ACE benchmark (Incredibuild enabled).

Natively the Visual Studio solution today supports Ant, Gradle and CMake. Support for Gradle was recently introduced in our latest offering.   

Image 5078 Incredibuild

#8. Deploy, test and debug Android Applications with fast, free and best-of-breed Android emulator
The Visual Studio Android development experience comes boxed with Microsoft’s very own emulator for Android for a fast edit-build-debug cycle. The Visual Studio Microsoft Android  emulator is Fast, x86, Hyper-V based  and provides support for simulating a range of sensors including accelerometer, screen orientation, SD card, battery, multi-touch, GPS, camera, audio and more!

Image 7635 emulator

#9.  Gather your application insights easily using HockeyApp 
Distribute your apps to testers through the web, allowing them to receive updates as they become available. Receive early feedback to make customer driven enhancements. Also gain insights from crashes to continuously improve the quality of your apps using HockeyApp.

Image 5383 insights

#10. Visual Studio is the cross-platform mobile solution (XamarinApache Cordova) and just not limited to cross-platform C++
While C++ might be the right way to go for your current application, you might consider other popular cross-platform mobile technologies for your other offerings. Don’t worry Visual Studio cross-platform support is not limited to C++ but also extends to other popular cross-platform mobile development technologies such as Xamarin which allows development of rich native apps using C#, hybrid apps with JavaScript using Apache Cordova and build 2D, 3D games using Unity in Visual Studio.  

Image 6813 Xam

Image 0131 Cor 

So why choose another Android C++ solution?

So download Visual Studio now and try out our C++ Android experience. We as a part of the Visual Studio development team believe this is the best solution for Android C++ applications and would love to know why would you choose any other solution out there. So reach out to us or leave us comments here to let us know what we are missing! For more news about Visual C++ please reach out to us at VCBlog.

Posted in C++


Discussion is closed.

Feedback usabilla icon