How to create an android app using c++ only in Android Studio?

Asked

Viewed 5,472 times

0

Just for learning purposes, is it possible to create an app using only c++(without JNI)? And if possible, what are the steps, have some example 'Helloword' somewhere?

From what I know some things in xml will be inevitable. (I’m sure?)

2 answers

3

I thought it wasn’t, but it’s actually possible, as long as it’s version 1.3 or higher.

You must go to the SDK Manager (Android Studio itself) and enter the SDK Tools tab. There you will find a package with the name Android NDK, and you should start installing it. This should already take considerable time, thanks to the package size.

As the creation and execution of apps is already a process a little more extensive, I leave here a link that explains in detail how to start projects with C++ in Android Studio.

  • Thanks! Although I’m behind pure c++ without JNI (I didn’t even mention )

-2

Without JNI would even be possible more would have to do hacks on the android operating system which would not be so simple since it is designed to be safe.

Moreover the JNI is only an API that provides some ready-made functions that are usually used for hardware access, it is like you program for linux, or other operating system, you will probably use some standard libraries such as the STD itself of C++ for example and also the operating system libraries, but how the android kernel is designed to be safe, although it is linux-based, you would need to redesign all the features that would be used by your current hardware, so after all, why reinvent the wheel if you already have all the hardware access ready ?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.