1

I have c/c++ source code that was built as shared library using AOSP environment. (Using mm command). That has 4 function: add, sub, multiple, divide. Now, I want to call these function from Android Application that uses UI. It means that I want to use native library in Android Application. So my question is do I call these functions directly from Android Application? and if so, How I can do that ?

Thank A lot.

Khemraj Sharma
  • 57,232
  • 27
  • 203
  • 212
DreamInBox
  • 174
  • 2
  • 12

1 Answers1

1

Android Applications are written in Java, or Kotlin, or whatever language that compiles to DEX (the bytecode that runs in Android JVM). You need JNI layer to connect to your C++ library. Hopefully, your language provides native methods that are implemented via JNI.

Alex Cohn
  • 56,089
  • 9
  • 113
  • 307