-
Notifications
You must be signed in to change notification settings - Fork 590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to handle AssetManager using JavaCpp? #792
Comments
How are you including asset_manager.h? |
#include <android/asset_manager.h>
#include <android/asset_manager_jni.h> |
You'll also need to include it in Java |
Ok looks like I've been able to build by doing so:
I had to skip AAssetManager_fromJava otherwise it would have require to also include the whole jni.h file which seems to be so overkill? The c++ method I'm trying to call is a static one, so I think I will stick to the old way for this method only as it seems overkill to include all jni.h, what do you think? |
Well JavaCPP is based on JNI. To use those objects, use the |
Thanks for the pointer! |
There's a couple of examples here: |
I have a c++ library that needs access to the java Android
AssetManager
. (android.content.res.AssetManager)To pass it to the library, I am using a custom JNI that takes this AssetManager as a jobect and then converts it to the equivalent c++ class
AAssetManager
(defines in android/asset_manager.h) usingAAssetManager_fromJava(jobject*)
I was wondering how to handle this using javacpp?
I tried to do
infoMap.put(new Info("AAssetManager").javaNames("AssetManager").define())
but the generated NativeLibrary.java doesn't define the AssetManager class.
The text was updated successfully, but these errors were encountered: