diff --git a/binding/android/Rhino/rhino/build.gradle b/binding/android/Rhino/rhino/build.gradle index 7a40c1d70..a2710b634 100644 --- a/binding/android/Rhino/rhino/build.gradle +++ b/binding/android/Rhino/rhino/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' ext { PUBLISH_GROUP_ID = 'ai.picovoice' - PUBLISH_VERSION = '2.2.2' + PUBLISH_VERSION = '3.0.0' PUBLISH_ARTIFACT_ID = 'rhino-android' } diff --git a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/Rhino.java b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/Rhino.java index 0c3c37958..f489222cc 100644 --- a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/Rhino.java +++ b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/Rhino.java @@ -1,5 +1,5 @@ /* - Copyright 2018-2022 Picovoice Inc. + Copyright 2018-2023 Picovoice Inc. You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE" file accompanying this source. Unless required by applicable law or agreed to in writing, software distributed under the @@ -34,6 +34,7 @@ public class Rhino { private static String DEFAULT_MODEL_PATH; private static boolean isExtracted; + private static String _sdk = "android"; static { System.loadLibrary("pv_rhino"); @@ -42,6 +43,10 @@ public class Rhino { private long handle; private boolean isFinalized; + public static void setSdk(String sdk) { + Rhino._sdk = sdk; + } + /** * Constructor. * @@ -72,6 +77,8 @@ private Rhino(String accessKey, float sensitivity, float endpointDurationSec, boolean requireEndpoint) throws RhinoException { + RhinoNative.setSdk(Rhino._sdk); + handle = RhinoNative.init( accessKey, modelPath, @@ -121,6 +128,20 @@ public boolean process(short[] pcm) throws RhinoException { return isFinalized; } + /** + * Resets the internal state of Rhino. It should be called before the engine can be + * used to infer intent from a new stream of audio. + * + * @throws RhinoException if reset fails. + */ + public void reset() throws RhinoException { + if (handle == 0) { + throw new RhinoInvalidStateException("Attempted to call Rhino reset after delete."); + } + + RhinoNative.reset(handle); + } + /** * Gets inference result from Rhino. If the spoken command was understood, it includes the * specific intent name that was inferred, and (if applicable) slot keys and specific slot diff --git a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/RhinoManager.java b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/RhinoManager.java index 88b6f36b7..f55eb7feb 100644 --- a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/RhinoManager.java +++ b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/RhinoManager.java @@ -11,17 +11,8 @@ package ai.picovoice.rhino; import android.content.Context; -import android.media.AudioFormat; -import android.media.AudioRecord; -import android.media.MediaRecorder; -import android.os.Handler; -import android.os.Looper; -import android.os.Process; import android.util.Log; -import java.util.concurrent.Callable; -import java.util.concurrent.Executors; - import ai.picovoice.android.voiceprocessor.VoiceProcessor; import ai.picovoice.android.voiceprocessor.VoiceProcessorErrorListener; import ai.picovoice.android.voiceprocessor.VoiceProcessorException; diff --git a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/RhinoNative.java b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/RhinoNative.java index f391a8f7b..ebfc14b56 100644 --- a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/RhinoNative.java +++ b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/RhinoNative.java @@ -1,5 +1,5 @@ /* - Copyright 2022 Picovoice Inc. + Copyright 2022-2023 Picovoice Inc. You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE" file accompanying this source. @@ -20,6 +20,8 @@ class RhinoNative { static native String getVersion(); + static native void setSdk(String sdk); + static native long init( String accessKey, String modelPath, @@ -32,6 +34,8 @@ static native long init( static native boolean process(long object, short[] pcm) throws RhinoException; + static native void reset(long object) throws RhinoException; + static native RhinoInference getInference(long object) throws RhinoException; static native String getContextInfo(long object) throws RhinoException; diff --git a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoActivationException.java b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoActivationException.java index fe9a57b52..284c16b6a 100644 --- a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoActivationException.java +++ b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoActivationException.java @@ -1,5 +1,5 @@ /* - Copyright 2021 Picovoice Inc. + Copyright 2021-2023 Picovoice Inc. You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE" file accompanying this source. Unless required by applicable law or agreed to in writing, software distributed under the @@ -18,4 +18,8 @@ public RhinoActivationException(Throwable cause) { public RhinoActivationException(String message) { super(message); } + + public RhinoActivationException(String message, String[] messageStack) { + super(message, messageStack); + } } diff --git a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoActivationLimitException.java b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoActivationLimitException.java index 1a8caf34b..f6e4ef6eb 100644 --- a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoActivationLimitException.java +++ b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoActivationLimitException.java @@ -1,5 +1,5 @@ /* - Copyright 2021 Picovoice Inc. + Copyright 2021-2023 Picovoice Inc. You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE" file accompanying this source. Unless required by applicable law or agreed to in writing, software distributed under the @@ -18,4 +18,8 @@ public RhinoActivationLimitException(Throwable cause) { public RhinoActivationLimitException(String message) { super(message); } -} \ No newline at end of file + + public RhinoActivationLimitException(String message, String[] messageStack) { + super(message, messageStack); + } +} diff --git a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoActivationRefusedException.java b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoActivationRefusedException.java index 85402f3b4..6f18ae5cd 100644 --- a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoActivationRefusedException.java +++ b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoActivationRefusedException.java @@ -1,5 +1,5 @@ /* - Copyright 2021 Picovoice Inc. + Copyright 2021-2023 Picovoice Inc. You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE" file accompanying this source. Unless required by applicable law or agreed to in writing, software distributed under the @@ -18,4 +18,8 @@ public RhinoActivationRefusedException(Throwable cause) { public RhinoActivationRefusedException(String message) { super(message); } -} \ No newline at end of file + + public RhinoActivationRefusedException(String message, String[] messageStack) { + super(message, messageStack); + } +} diff --git a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoActivationThrottledException.java b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoActivationThrottledException.java index f8be2319a..49ec0e1a0 100644 --- a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoActivationThrottledException.java +++ b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoActivationThrottledException.java @@ -1,5 +1,5 @@ /* - Copyright 2021 Picovoice Inc. + Copyright 2021-2023 Picovoice Inc. You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE" file accompanying this source. Unless required by applicable law or agreed to in writing, software distributed under the @@ -18,4 +18,8 @@ public RhinoActivationThrottledException(Throwable cause) { public RhinoActivationThrottledException(String message) { super(message); } -} \ No newline at end of file + + public RhinoActivationThrottledException(String message, String[] messageStack) { + super(message, messageStack); + } +} diff --git a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoException.java b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoException.java index 452387c03..288db3b25 100644 --- a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoException.java +++ b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoException.java @@ -1,22 +1,54 @@ /* - Copyright 2018-2021 Picovoice Inc. + Copyright 2021-2023 Picovoice Inc. + You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE" file accompanying this source. + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ - package ai.picovoice.rhino; public class RhinoException extends Exception { - RhinoException(Throwable cause) { + private final String message; + private final String[] messageStack; + + public RhinoException(Throwable cause) { super(cause); + this.message = cause.getMessage(); + this.messageStack = null; } - RhinoException(String message) { + public RhinoException(String message) { super(message); + this.message = message; + this.messageStack = null; + } + + public RhinoException(String message, String[] messageStack) { + super(message); + this.message = message; + this.messageStack = messageStack; + } + + public String[] getMessageStack() { + return this.messageStack; + } + + @Override + public String getMessage() { + StringBuilder sb = new StringBuilder(message); + if (messageStack != null) { + if (messageStack.length > 0) { + sb.append(":"); + for (int i = 0; i < messageStack.length; i++) { + sb.append(String.format("\n [%d] %s", i, messageStack[i])); + } + } + } + return sb.toString(); } -} +} \ No newline at end of file diff --git a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoIOException.java b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoIOException.java index 92c788cee..67dc3e8eb 100644 --- a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoIOException.java +++ b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoIOException.java @@ -1,5 +1,5 @@ /* - Copyright 2021 Picovoice Inc. + Copyright 2021-2023 Picovoice Inc. You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE" file accompanying this source. Unless required by applicable law or agreed to in writing, software distributed under the @@ -18,4 +18,8 @@ public RhinoIOException(Throwable cause) { public RhinoIOException(String message) { super(message); } -} \ No newline at end of file + + public RhinoIOException(String message, String[] messageStack) { + super(message, messageStack); + } +} diff --git a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoInvalidArgumentException.java b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoInvalidArgumentException.java index de08e6a14..221ddf801 100644 --- a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoInvalidArgumentException.java +++ b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoInvalidArgumentException.java @@ -1,5 +1,5 @@ /* - Copyright 2021 Picovoice Inc. + Copyright 2021-2023 Picovoice Inc. You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE" file accompanying this source. Unless required by applicable law or agreed to in writing, software distributed under the @@ -18,4 +18,8 @@ public RhinoInvalidArgumentException(Throwable cause) { public RhinoInvalidArgumentException(String message) { super(message); } -} \ No newline at end of file + + public RhinoInvalidArgumentException(String message, String[] messageStack) { + super(message, messageStack); + } +} diff --git a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoInvalidStateException.java b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoInvalidStateException.java index db87da3b8..eff1c9aef 100644 --- a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoInvalidStateException.java +++ b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoInvalidStateException.java @@ -1,5 +1,5 @@ /* - Copyright 2021 Picovoice Inc. + Copyright 2021-2023 Picovoice Inc. You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE" file accompanying this source. Unless required by applicable law or agreed to in writing, software distributed under the @@ -18,4 +18,8 @@ public RhinoInvalidStateException(Throwable cause) { public RhinoInvalidStateException(String message) { super(message); } -} \ No newline at end of file + + public RhinoInvalidStateException(String message, String[] messageStack) { + super(message, messageStack); + } +} diff --git a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoKeyException.java b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoKeyException.java index 8c25c41d2..0722b12f9 100644 --- a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoKeyException.java +++ b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoKeyException.java @@ -1,5 +1,5 @@ /* - Copyright 2021 Picovoice Inc. + Copyright 2021-2023 Picovoice Inc. You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE" file accompanying this source. Unless required by applicable law or agreed to in writing, software distributed under the @@ -18,4 +18,8 @@ public RhinoKeyException(Throwable cause) { public RhinoKeyException(String message) { super(message); } -} \ No newline at end of file + + public RhinoKeyException(String message, String[] messageStack) { + super(message, messageStack); + } +} diff --git a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoMemoryException.java b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoMemoryException.java index b62593f66..59bf8ba0b 100644 --- a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoMemoryException.java +++ b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoMemoryException.java @@ -1,5 +1,5 @@ /* - Copyright 2021 Picovoice Inc. + Copyright 2021-2023 Picovoice Inc. You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE" file accompanying this source. Unless required by applicable law or agreed to in writing, software distributed under the @@ -18,4 +18,8 @@ public RhinoMemoryException(Throwable cause) { public RhinoMemoryException(String message) { super(message); } -} \ No newline at end of file + + public RhinoMemoryException(String message, String[] messageStack) { + super(message, messageStack); + } +} diff --git a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoRuntimeException.java b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoRuntimeException.java index 3ff990708..83206d4d9 100644 --- a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoRuntimeException.java +++ b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoRuntimeException.java @@ -1,5 +1,5 @@ /* - Copyright 2021 Picovoice Inc. + Copyright 2021-2023 Picovoice Inc. You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE" file accompanying this source. Unless required by applicable law or agreed to in writing, software distributed under the @@ -18,4 +18,8 @@ public RhinoRuntimeException(Throwable cause) { public RhinoRuntimeException(String message) { super(message); } -} \ No newline at end of file + + public RhinoRuntimeException(String message, String[] messageStack) { + super(message, messageStack); + } +} diff --git a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoStopIterationException.java b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoStopIterationException.java index f4ad55506..2341caba0 100644 --- a/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoStopIterationException.java +++ b/binding/android/Rhino/rhino/src/main/java/ai/picovoice/rhino/exception/RhinoStopIterationException.java @@ -1,5 +1,5 @@ /* - Copyright 2021 Picovoice Inc. + Copyright 2021-2023 Picovoice Inc. You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE" file accompanying this source. Unless required by applicable law or agreed to in writing, software distributed under the @@ -18,4 +18,8 @@ public RhinoStopIterationException(Throwable cause) { public RhinoStopIterationException(String message) { super(message); } -} \ No newline at end of file + + public RhinoStopIterationException(String message, String[] messageStack) { + super(message, messageStack); + } +} diff --git a/binding/android/RhinoTestApp/build.gradle b/binding/android/RhinoTestApp/build.gradle index bdc4b5806..e609e0a05 100644 --- a/binding/android/RhinoTestApp/build.gradle +++ b/binding/android/RhinoTestApp/build.gradle @@ -7,6 +7,9 @@ buildscript { repositories { google() mavenCentral() + maven { + url 'https://s01.oss.sonatype.org/content/repositories/aipicovoice-1267/' + } } dependencies { @@ -24,6 +27,9 @@ allprojects { repositories { google() mavenCentral() + maven { + url 'https://s01.oss.sonatype.org/content/repositories/aipicovoice-1267/' + } } } diff --git a/binding/android/RhinoTestApp/rhino-test-app/build.gradle b/binding/android/RhinoTestApp/rhino-test-app/build.gradle index da7f012a2..57947ec25 100644 --- a/binding/android/RhinoTestApp/rhino-test-app/build.gradle +++ b/binding/android/RhinoTestApp/rhino-test-app/build.gradle @@ -145,7 +145,7 @@ dependencies { implementation 'androidx.appcompat:appcompat:1.3.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'com.google.code.gson:gson:2.10' - implementation 'ai.picovoice:rhino-android:2.2.2' + implementation 'ai.picovoice:rhino-android:3.0.0' // Espresso UI Testing androidTestImplementation 'androidx.test.ext:junit:1.1.5' diff --git a/binding/android/RhinoTestApp/rhino-test-app/src/androidTest/java/ai/picovoice/rhino/testapp/BaseTest.java b/binding/android/RhinoTestApp/rhino-test-app/src/androidTest/java/ai/picovoice/rhino/testapp/BaseTest.java index 061dee3fd..20335d1cd 100644 --- a/binding/android/RhinoTestApp/rhino-test-app/src/androidTest/java/ai/picovoice/rhino/testapp/BaseTest.java +++ b/binding/android/RhinoTestApp/rhino-test-app/src/androidTest/java/ai/picovoice/rhino/testapp/BaseTest.java @@ -105,7 +105,9 @@ private void extractTestFile(String filepath) throws IOException { os.close(); } - RhinoInference processTestAudio(Rhino r, File testAudio) throws Exception { + boolean processFileHelper(Rhino r, File testAudio, int maxProcessCount) throws Exception { + int processed = 0; + FileInputStream audioInputStream = new FileInputStream(testAudio); byte[] rawData = new byte[r.getFrameLength() * 2]; @@ -123,8 +125,18 @@ RhinoInference processTestAudio(Rhino r, File testAudio) throws Exception { if (isFinalized) { break; } + if (maxProcessCount != -1 && processed >= maxProcessCount) { + break; + } + processed++; } } + + return isFinalized; + } + + RhinoInference processTestAudio(Rhino r, File testAudio) throws Exception { + boolean isFinalized = processFileHelper(r, testAudio, -1); assertTrue(isFinalized); return r.getInference(); diff --git a/binding/android/RhinoTestApp/rhino-test-app/src/androidTest/java/ai/picovoice/rhino/testapp/RhinoTest.java b/binding/android/RhinoTestApp/rhino-test-app/src/androidTest/java/ai/picovoice/rhino/testapp/RhinoTest.java index 6627bc55a..65a179207 100644 --- a/binding/android/RhinoTestApp/rhino-test-app/src/androidTest/java/ai/picovoice/rhino/testapp/RhinoTest.java +++ b/binding/android/RhinoTestApp/rhino-test-app/src/androidTest/java/ai/picovoice/rhino/testapp/RhinoTest.java @@ -1,5 +1,5 @@ /* - Copyright 2022 Picovoice Inc. + Copyright 2022-2023 Picovoice Inc. You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE" file accompanying this source. @@ -259,6 +259,57 @@ public void testInitWithNonAsciiModelName() throws RhinoException { assertTrue(r.getContextInformation() != null && !r.getContextInformation().equals("")); r.delete(); } + + @Test + public void testReset() throws Exception { + File contextPath = new File(testResourcesPath, "context_files/en/coffee_maker_android.rhn"); + + Rhino r = new Rhino.Builder() + .setAccessKey(accessKey) + .setContextPath(contextPath.getAbsolutePath()) + .build(appContext); + + File testAudio = new File(testResourcesPath, "audio_samples/test_within_context.wav"); + boolean isFinalized = processFileHelper(r, testAudio, 15); + assertFalse(isFinalized); + + r.reset(); + isFinalized = processFileHelper(r, testAudio, -1); + assertTrue(isFinalized); + + RhinoInference inference = r.getInference(); + assertTrue(inference.getIsUnderstood()); + r.delete(); + } + + @Test + public void testErrorStack() { + File contextPath = new File(testResourcesPath, "context_files/en/coffee_maker_android.rhn"); + + String[] error = {}; + try { + new Rhino.Builder() + .setAccessKey("invalid") + .setContextPath(contextPath.getAbsolutePath()) + .build(appContext); + } catch (RhinoException e) { + error = e.getMessageStack(); + } + + assertTrue(0 < error.length); + assertTrue(error.length <= 8); + + try { + new Rhino.Builder() + .setAccessKey("invalid") + .setContextPath(contextPath.getAbsolutePath()) + .build(appContext); + } catch (RhinoException e) { + for (int i = 0; i < error.length; i++) { + assertEquals(e.getMessageStack()[i], error[i]); + } + } + } } @RunWith(Parameterized.class) diff --git a/demo/android/Activity/build.gradle b/demo/android/Activity/build.gradle index bdc4b5806..e609e0a05 100644 --- a/demo/android/Activity/build.gradle +++ b/demo/android/Activity/build.gradle @@ -7,6 +7,9 @@ buildscript { repositories { google() mavenCentral() + maven { + url 'https://s01.oss.sonatype.org/content/repositories/aipicovoice-1267/' + } } dependencies { @@ -24,6 +27,9 @@ allprojects { repositories { google() mavenCentral() + maven { + url 'https://s01.oss.sonatype.org/content/repositories/aipicovoice-1267/' + } } } diff --git a/demo/android/Activity/rhino-activity-demo-app/build.gradle b/demo/android/Activity/rhino-activity-demo-app/build.gradle index f52f475d8..92e06aad4 100644 --- a/demo/android/Activity/rhino-activity-demo-app/build.gradle +++ b/demo/android/Activity/rhino-activity-demo-app/build.gradle @@ -11,11 +11,6 @@ android { targetSdkVersion defaultTargetSdkVersion versionCode 1 versionName "1.0" - testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' - - resValue 'string', 'pvTestingAccessKey', properties.getProperty("pvTestingAccessKey", "") - resValue 'string', 'numTestIterations', properties.getProperty("numTestIterations", "") - resValue 'string', 'performanceThresholdSec', properties.getProperty("performanceThresholdSec", "") } buildTypes { release { @@ -85,7 +80,7 @@ dependencies { implementation 'androidx.appcompat:appcompat:1.3.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'com.google.code.gson:gson:2.10' - implementation 'ai.picovoice:rhino-android:2.2.2' + implementation 'ai.picovoice:rhino-android:3.0.0' } afterEvaluate { diff --git a/demo/android/Activity/rhino-activity-demo-app/src/main/java/ai/picovoice/rhinodemo/MainActivity.java b/demo/android/Activity/rhino-activity-demo-app/src/main/java/ai/picovoice/rhinodemo/MainActivity.java index b87b1330c..9fcd4882a 100644 --- a/demo/android/Activity/rhino-activity-demo-app/src/main/java/ai/picovoice/rhinodemo/MainActivity.java +++ b/demo/android/Activity/rhino-activity-demo-app/src/main/java/ai/picovoice/rhinodemo/MainActivity.java @@ -119,11 +119,7 @@ private void initRhino() { Log.i("RhinoManager", rhinoManager.getContextInformation()); } catch (RhinoInvalidArgumentException e) { - onRhinoError( - String.format( - "%s\nMake sure your AccessKey '%s' is a valid access key.", - e.getMessage(), - ACCESS_KEY)); + onRhinoError(e.getMessage()); } catch (RhinoActivationException e) { onRhinoError("AccessKey activation error"); } catch (RhinoActivationLimitException e) { diff --git a/resources/.lint/java/suppress.xml b/resources/.lint/java/suppress.xml index 482a2d991..9b1148617 100644 --- a/resources/.lint/java/suppress.xml +++ b/resources/.lint/java/suppress.xml @@ -10,7 +10,7 @@ - +