NDK console application

Dear all
I’m trying to create a “basic” Android 11 console application (no java wrapper application) just a plain C++ main function to genereate an executable. Hopefully is possible.

Looking inside JUCE seems that I do not need to declare a classical main(argc, argv) function. Please, which is the correct approach for starting my application?

Not sure this makes sense. All android apps are gui based??

Android has services which run in the background thus no UI but that is more complicated to create than a GUI app.

@sergiosmail Android uses .aabs for Google Play delivery. When your app is downloaded from the market, Google then assembles an apk for the correct OS bit type and other factors correct .so libs etc. to run on the device.

What’s the difference between AABs and APKs? App bundles are only for publishing and cannot be installed on Android devices. The Android package (APK) is Android’s installable, executable format for apps. App bundles must be processed by a distributor into APKs so that they can be installed on devices.

You need to understand how a project is structured and bootstrapped to understand how it really works.

1 Like

Thank you @leehu @TeotiGraphix

My application is running at the Android command line. It does not need any GUI. In the past (JUCE 1.50) it works, but now, I’m affraid, that it is not possible anymore with JUCE.

To be specific my application is reading data from net and exposing this data to the Android file system. It does not need any GUI therefore (very similar to a service as @TeotiGraphix says).

When I’ve started porting the application to the latest JUCE version, it seems that is not possible to use a plain c++ executable, and the only way is to create a Java wrapper APK and call JNI functions to my native C++ (in this case generating a library).

Still confused as to where you are doing this. I will just stick to what I said, there is no executable for Android, so you may be using the command line, but is it really a “command line application”.

Do you mean using command line on a PC/Mac with the device hooked up USB/Wifi?

maybe “NDK only” or “console application” or “service” might be a better description of what the OP is talking about. There is plenty of C/C++ native code running on an Android device. Also, I think if you really wanted, you could write a UI with NDK and opengl… none of this info helps with the OPs issue, but I thought I throw what little I know, since I have written C/C++ native Android code in the distant past.

1 Like

Clarifiying: the device is Orange pi. I’m running adb push + shell to upload and run the application. Finally I’ve been able to compile+link the app, but other issues araise.

Let me check if I’m able to fix it. If not I’ll contact you again, hopefully you can help me.

Ah Orange PI,. that makes more sense, I was coming from the direction of a Play/Market delivered app.

I have no experience with that system(bootstrap).