1

Is it possible to make an Android application only in C++? I don't know Java. I've tried Visual Studio 2019 approach but I guess my computer isn't good enough for emulating Android phone.

3
  • 3
    You should be able to do that, though it's discuoraged. Also what's the "Visual Studio 2019 approach"? You usually use android studio. Also you don't need to emulate a phone you can just run your code on a real phone plugged into your computer. Commented Oct 15, 2020 at 10:32
  • You can make an "Android Native Activity App" in Visual Studio 2019 now and I think there isn't any option to plug your phone and work with that. Commented Oct 15, 2020 at 10:37
  • If it can spawn an emulator it can install stuff on your phone. That functionality is part of the Android SDK. Perhaps you forgot to enable developer mode first, so your phone isn't found. Commented Oct 15, 2020 at 12:22

1 Answer 1

5

You can write code for Android in C++, if you have the appropriate programming tools. You'll need a cross-compiler and linker for the appropriate architecture. These are readily available in Google's Native Development Kit:

https://developer.android.com/ndk/

I don't know if these tools can be used with Visual Studio -- I suspect it will be fiddly to set up.

The problem with programming in C or C++ for Android is that it's hard to integrate the application with the regular launcher and, even if you can do that, it's hard to provide a regular Android graphical user interface. Android simply does not provide a C API for the user interface.

I write/port a lot of command-line stuff for Android, so the lack of a graphical user interface doesn't bother me. However, most developers provide the user interface in Java and, if parts of the app needs to be in C or C++, it gets integrated with the app in the form of a native library.

Android Studio and similar tools know how to manage a project that has a mixture of C or C++ and Java code. Using well-established Android tools for developing complex, mixed-code apps like this is way simpler than trying to figure it all out yourself using a hodge-podge of tools from different places.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.