Right now I have a native function which sort of does this:
Object o = new Object();
while (!o.done()) { o.compute(); }
return o.result();
This computing can take a while and I would want the UI in Android to be update with some kind of progress bar. So what I need is three different native functions, one for each step above. The problem I’m having is how to save the “native object” inbetween calls. Any tips?
Thanks
Your Android NDK C code statics act like statics do in normal application programming. As long as the current process (app) is running, your data will be preserved. If you have a method that will do a lot of processing, call it from a Java thread to work in the background like this: