public class SoniTalkContext
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
ON_PERMISSION_LEVEL_DECLINED
Will be sent to the SoniTalkPermissionsResultReceiver when the user chose to "Decline" when
asked for the privacy level.
|
static int |
ON_REQUEST_DENIED
Will be sent to the SoniTalkPermissionsResultReceiver when the user denied a permission request
from the custom SoniTalk dialogs (L1/L2).
|
static int |
ON_REQUEST_GRANTED
Will be sent to the SoniTalkPermissionsResultReceiver when a request is granted, i.e.
|
static int |
ON_REQUEST_L0_DENIED
Will be sent to the SoniTalkPermissionsResultReceiver when the user denied a permission request
from the Android permission system (L0).
|
static int |
ON_SEND_JOB_FINISHED
Will be sent to the SoniTalkPermissionsResultReceiver when a "send job" is finished, i.e.
|
static int |
ON_SHOULD_SHOW_RATIONALE_FOR_ALLOW_ALWAYS
Will be sent to the SoniTalkPermissionsResultReceiver when the user should show a rationale
for the "Allow Always" (L0) SoniTalk permission.
|
Modifier and Type | Method and Description |
---|---|
SoniTalkDecoder |
getDecoder(int sampleRate,
SoniTalkConfig config) |
SoniTalkEncoder |
getEncoder(int sampleRate,
SoniTalkConfig config) |
SoniTalkEncoder |
getEncoder(SoniTalkConfig config) |
static SoniTalkContext |
getInstance(android.content.Context context,
SoniTalkPermissionsResultReceiver sdkListener)
Instantiate a SoniTalkContext, allowing to create Encoder, Decoder and Sender objects.
|
SoniTalkSender |
getSender() |
SoniTalkSender |
getSender(int sampleRate) |
public static final int ON_PERMISSION_LEVEL_DECLINED
public static final int ON_REQUEST_GRANTED
public static final int ON_REQUEST_DENIED
public static final int ON_SEND_JOB_FINISHED
public static final int ON_SHOULD_SHOW_RATIONALE_FOR_ALLOW_ALWAYS
public static final int ON_REQUEST_L0_DENIED
public static SoniTalkContext getInstance(android.content.Context context, SoniTalkPermissionsResultReceiver sdkListener)
context
- is used to get an application context.sdkListener
- ResultReceiver which will receive callbacks from SoniTalk. Please set
the handler according to which thread should execute the callbacks (often
the UI Thread if it handles UI components). Please call setReceiver and
pass an object that implements SoniTalkPermissionsResultReceiver.Receiver
interface in order to receive the callbacks (it can be an Activity, but
then do not forget to set it back to null in onStop or onPause to avoid
leaking your Activity on configuration changes).public SoniTalkDecoder getDecoder(int sampleRate, SoniTalkConfig config)
sampleRate
- is used to start the decoder with the correct sample rateconfig
- can be generated with the utility class ConfigFactory and
holds configurations for the decoderpublic SoniTalkEncoder getEncoder(SoniTalkConfig config)
config
- can be generated with the utility class ConfigFactory and
holds configurations for the encoderpublic SoniTalkEncoder getEncoder(int sampleRate, SoniTalkConfig config)
sampleRate
- is used to start the encoder with the correct sample rateconfig
- can be generated with the utility class ConfigFactory and
holds configurations for the encoderpublic SoniTalkSender getSender()
public SoniTalkSender getSender(int sampleRate)
sampleRate
- is used to get a sender with the correct sample rate