Kotlin

Initialize the client

NexmoClient is the main class used to interact with Android-Client-SDK. Prior to usage, you have to initialize the client by providing an instance of the Android Context class.

Locate the onCreate method in the MainActivity class and initialize NexmoClient using the builder:

override fun onCreate(savedInstanceState: Bundle?) {

    // ...

    NexmoClient.Builder().build(this)
}

NOTE: The above code will allow retrieving NexmoClient instance later by using NexmoClient.get().

NOTE: You can enable additional Logcat logging by using logLevel() method of the builder, for example, NexmoClient.Builder().logLevel(ILogger.eLogLevel.SENSITIVE).build(this)

If Android Studio can't find the reference to the NexmoClient class then you have to add the missing import. Roll over on the NexmoClient class, wait for window to appear and press Import (this action will be required in following steps as well).

Run Build > Make project to make sure project is compiling.