Is it possible to declare an object of a native class (in c++) in java (android sdk)?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The only solution would be to create a JNI lib that would serve as a communication layer between your Java and C++ code.
That Lib would need to :
1- Contain methods that receive your needed Java Objects as JObject. (lookup this post for how to use the jobject : how to pass java class instance as a parameter to JNI method?
2- Request your C++ objects to your native code
3- Do whatever you need to do with both objects.
Hope it helps 😉
Cheers !