Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
ai.picovoice.rhinodemo.MainActivity Class Reference
Inheritance diagram for ai.picovoice.rhinodemo.MainActivity:
Inheritance graph
[legend]

Public Member Functions

void onClick (View view)
 
void onRequestPermissionsResult (int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults)
 
void showContextCheatSheet (View view)
 

Protected Member Functions

void onCreate (Bundle savedInstanceState)
 
void onDestroy ()
 

Private Member Functions

boolean hasRecordPermission ()
 
void initRhino ()
 
void onRhinoError (String errorMessage)
 
void requestRecordPermission ()
 

Private Attributes

final String ACCESS_KEY = "${YOUR_ACCESS_KEY_HERE}"
 
Button cheatSheetButton
 
Guideline errorGuideline
 
TextView errorTextView
 
TextView intentTextView
 
ToggleButton recordButton
 
RhinoManager rhinoManager
 
final RhinoManagerCallback rhinoManagerCallback
 
final RhinoManagerErrorCallback rhinoManagerErrorCallback
 

Detailed Description

Definition at line 39 of file rhino/demo/android/Activity/rhino-activity-demo-app/src/main/java/ai/picovoice/rhinodemo/MainActivity.java.

Member Function Documentation

◆ hasRecordPermission()

boolean ai.picovoice.rhinodemo.MainActivity.hasRecordPermission ( )
inlineprivate

◆ initRhino()

void ai.picovoice.rhinodemo.MainActivity.initRhino ( )
inlineprivate

◆ onClick()

void ai.picovoice.rhinodemo.MainActivity.onClick ( View  view)
inline

◆ onCreate()

void ai.picovoice.rhinodemo.MainActivity.onCreate ( Bundle  savedInstanceState)
inlineprotected

◆ onDestroy()

void ai.picovoice.rhinodemo.MainActivity.onDestroy ( )
inlineprotected

◆ onRequestPermissionsResult()

void ai.picovoice.rhinodemo.MainActivity.onRequestPermissionsResult ( int  requestCode,
@NonNull String[]  permissions,
@NonNull int[]  grantResults 
)
inline

◆ onRhinoError()

void ai.picovoice.rhinodemo.MainActivity.onRhinoError ( String  errorMessage)
inlineprivate

◆ requestRecordPermission()

void ai.picovoice.rhinodemo.MainActivity.requestRecordPermission ( )
inlineprivate

◆ showContextCheatSheet()

void ai.picovoice.rhinodemo.MainActivity.showContextCheatSheet ( View  view)
inline

Member Data Documentation

◆ ACCESS_KEY

final String ai.picovoice.rhinodemo.MainActivity.ACCESS_KEY = "${YOUR_ACCESS_KEY_HERE}"
private

◆ cheatSheetButton

Button ai.picovoice.rhinodemo.MainActivity.cheatSheetButton
private

◆ errorGuideline

Guideline ai.picovoice.rhinodemo.MainActivity.errorGuideline
private

◆ errorTextView

TextView ai.picovoice.rhinodemo.MainActivity.errorTextView
private

◆ intentTextView

TextView ai.picovoice.rhinodemo.MainActivity.intentTextView
private

◆ recordButton

ToggleButton ai.picovoice.rhinodemo.MainActivity.recordButton
private

◆ rhinoManager

RhinoManager ai.picovoice.rhinodemo.MainActivity.rhinoManager
private

◆ rhinoManagerCallback

final RhinoManagerCallback ai.picovoice.rhinodemo.MainActivity.rhinoManagerCallback
private
Initial value:
= new RhinoManagerCallback() {
@Override
public void invoke(final RhinoInference inference) {
runOnUiThread(new Runnable() {
@Override
public void run() {
recordButton.setEnabled(true);
recordButton.setText("START");
recordButton.toggle();
intentTextView.setText("\n {\n");
intentTextView.append(String.format(" \"isUnderstood\" : \"%b\",\n", inference.getIsUnderstood()));
if (inference.getIsUnderstood()) {
intentTextView.append(String.format(" \"intent\" : \"%s\",\n", inference.getIntent()));
final Map<String, String> slots = inference.getSlots();
if (slots.size() > 0) {
intentTextView.append(" \"slots\" : {\n");
for (String key : slots.keySet()) {
intentTextView.append(String.format(" \"%s\" : \"%s\",\n", key, slots.get(key)));
}
intentTextView.append(" }\n");
}
}
intentTextView.append(" }\n");
}
});
}
}

Definition at line 78 of file rhino/demo/android/Activity/rhino-activity-demo-app/src/main/java/ai/picovoice/rhinodemo/MainActivity.java.

◆ rhinoManagerErrorCallback

final RhinoManagerErrorCallback ai.picovoice.rhinodemo.MainActivity.rhinoManagerErrorCallback
private
Initial value:
= new RhinoManagerErrorCallback() {
@Override
public void invoke(final RhinoException error) {
runOnUiThread(new Runnable() {
@Override
public void run() {
onRhinoError(error.getMessage());
}
});
}
}

Definition at line 106 of file rhino/demo/android/Activity/rhino-activity-demo-app/src/main/java/ai/picovoice/rhinodemo/MainActivity.java.


The documentation for this class was generated from the following file:
run
void run(class_loader::ClassLoader *loader)
ai.picovoice.rhinodemo.MainActivity.onRhinoError
void onRhinoError(String errorMessage)
Definition: rhino/demo/android/Activity/rhino-activity-demo-app/src/main/java/ai/picovoice/rhinodemo/MainActivity.java:118
ai.picovoice.rhinodemo.MainActivity.intentTextView
TextView intentTextView
Definition: rhino/demo/android/Activity/rhino-activity-demo-app/src/main/java/ai/picovoice/rhinodemo/MainActivity.java:44
ai.picovoice.rhinodemo.MainActivity.recordButton
ToggleButton recordButton
Definition: rhino/demo/android/Activity/rhino-activity-demo-app/src/main/java/ai/picovoice/rhinodemo/MainActivity.java:42
error
static int error(vorb *f, enum STBVorbisError e)
Definition: porcupine/demo/c/dr_libs/tests/external/miniaudio/extras/stb_vorbis.c:896


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:15:20