• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps JNI issue, changes in c++ file not showing when running app

colinjava

Lurker
Hi, fairly new to android development here, but familiar with java.

Been trying to understand JNI as it offers extremely fast calculation over standard android/java.

The open source mandelbrot set app (uses JNI):
https://github.com/dbrant/mandelbrot-android

runs fine in android studio, [via simulator or through my pocophone]

When I make a tiny change to the jni/mandelbrot_wrap.c file, by changing
"drawing (%d)" to something different like "draw777ing (%d)", the change doesn't show in the output, it still says drawing (...)

Even when I make a fresh copy of the app, with a new name, and change the code using notepad, and then load it into android studio, it still outputs drawing (...)

I don't know what's going on, is the c++ file already compiled in the project somewhere, so that changes in the app are never reflected?

Please help if you can, thanks very much.
 
Ok, I understand it a bit better now after watching this...

You have to separately compile the c++ code using the NDK, before building the project with gradle.
I childishly thought I could just build the project with gradle and it would work.
 
Back
Top Bottom