Instantiation

Before you can use the VoiceLayerClient in your app you will need to initialize it by providing your app name, your app key, and your app secret:

VoiceLayerConfiguration config = new VoiceLayerConfiguration(
    "app_name",
    "app_key",
    "app_secret_key"
);
VoiceLayerClient.Initialize(context, config);

or if you need to use a custom server URL:

VoiceLayerConfiguration config = new VoiceLayerConfiguration(
    "custom_server_url",
    "app_name",
    "app_key",
    "app_secret_key"
);
VoiceLayerClient.Initialize(context, config);

This initialization only needs to be done once when your application is first created. If you need to clear the current client configuration and use a new configuration you can reset the client by doing the following:

VoiceLayerClient.Reset();

If you attempt to retrieve an instance of the client without initializing it first, a run time exception will be thrown.

Retrieving an instance

Once the client has been initialized you can retrieve an instance of the client as follows:

VoiceLayerClient client = VoiceLayerClient.getInstance();