Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Under Android NDK, can a native window be created without Java calls to retrieve the surface?

I am trying to develop an android app fully in native code using C++. The Android NDK api's are using a Java object. For example I saw the method:

int32_t ANativeWindow_getHeight(ANativeWindow* window);

But to create an ANativeWindow I need a Java Surface Object.

ANativeWindow* ANativeWindow_fromSurface(JNIEnv* env, jobject surface);

Is there any other way to get the details without using any java objects?

I do not want to use a Java callback.

like image 517
user2508941 Avatar asked Jan 23 '26 02:01

user2508941


1 Answers

This is not possible... After a long time I have realized it. The answer will be to use some third party libraries which will in turn provide the the api's via java call back. So call back is the only solution available.

like image 107
user2508941 Avatar answered Jan 25 '26 15:01

user2508941



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!