how to initialize baresip in MainActivity in Android kotlin

44 Views Asked by At

I'm new to NDK. Previously I had imported the baresip library into my project, but I was confused about how to "call" baresip in my activity. previously I had initialized System.loadLibrary("baresip") in my MainActivity. However, I don't know what steps I should take next. Help me, please.... Thank You.

this is what my MainActivity looks like:

class MainActivity : AppCompatActivity() {
private lateinit var binding: ActivityMainBinding

override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivityMainBinding.inflate(layoutInflater)
        setContentView(binding.root)
}

init {
        if (!BaresipService.libraryLoaded) {
            Log.d("MainActivity", "Loading baresip library")
            System.loadLibrary("baresip")
            BaresipService.libraryLoaded = true
        }
    }
}
0

There are 0 best solutions below