Thread
#multiplatform
    z

    ZabGo

    2 years ago
    Hello, I am new to Kotlin Multiplatform. I want to make a mobile app in ios and android. I am trying to implement a third party library written in C/C++. I want to create the following function in androidMain :
    fun setContext(currentActivity: Activity){
    	connector.setUIContext(currentActivity) // this function is from the third party library
    }
    I wonder how I could access the type Activity. It looks it does not recognise it or the android api is not accessible. Do I need to add anything in the build.gradle.kts? Thanks for your help
    m

    magnumrocha

    2 years ago
    you should config the android target in your gradle file, to setup an android lib, just like you would config in a android gradle prroject
    z

    ZabGo

    2 years ago
    all right make sense. Thank you very much I'll do that then.
    z

    ZabGo

    2 years ago
    @Kris Wong thanks so much. That's exactly what I was looking for. I think you just saved me a lot of time 😃
    Kris Wong

    Kris Wong

    2 years ago
    that is the point indeed!