Skip to content

Commit a02a5cf

Browse files
olami-developersolami-developers
authored andcommitted
update android client sdk to 2.3.1
1 parent 1896edb commit a02a5cf

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

examples/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ android {
88
minSdkVersion 17
99
targetSdkVersion 25
1010
versionCode 1
11-
versionName "20171102"
11+
versionName "20171110"
1212

1313
archivesBaseName = "olami-android-hotword-examples"
1414

@@ -56,7 +56,8 @@ dependencies {
5656
compile 'com.android.support.constraint:constraint-layout:1.0.2'
5757
testCompile 'junit:junit:4.12'
5858

59-
compile project(':olami-android-hotword-detect-1.0.0.beta3')
59+
compile 'ai.olami:olami-android-client:2.3.1'
60+
compile project(':olami-android-hotword-detect-1.0.0.beta4')
6061
}
6162

6263
// Copy output files to '/bin' after build --------------

examples/src/main/java/ai/olami/android/example/HotwordDetectionActivity.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ public class HotwordDetectionActivity extends AppCompatActivity {
4545

4646
static final String TAG = "HotwordDetectActivity";
4747

48-
HotwordDetect mHotwordDetect = null;
49-
AudioRecord mAudioRecord = null;
48+
private HotwordDetect mHotwordDetect = null;
49+
private AudioRecord mAudioRecord = null;
5050

51-
TextView mDisplayText = null;
52-
Switch mHotwordDetectSwitch = null;
51+
private TextView mDisplayText = null;
52+
private Switch mHotwordDetectSwitch = null;
53+
private long mDetectedCount = 0;
5354

5455
private static final int REQUEST_EXTERNAL_PERMISSION = 1;
5556
private static final int REQUEST_MICROPHONE = 3;
@@ -83,6 +84,7 @@ protected void onResume() {
8384
createAudioRecord();
8485

8586
try {
87+
mDetectedCount = 0;
8688
startRecording();
8789
initializeHotwordDetection();
8890
startHotwordDetection();
@@ -229,10 +231,12 @@ public void onStartDetect() {
229231
public void onHotwordDetect(int hotwordID) {
230232
String str = getString(R.string.hotwordOnHotwordDetect);
231233

232-
SimpleDateFormat sdf = new SimpleDateFormat("yyyy MM/dd HH:mm ss");
234+
mDetectedCount++;
235+
236+
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm ss");
233237
sdf.setTimeZone(TimeZone.getTimeZone("GMT+8"));
234238
String deviceCurrentTime = sdf.format(new Date(System.currentTimeMillis()));
235-
str += "...\n"+ deviceCurrentTime;
239+
str += "\n >> [ " + mDetectedCount + " ] << " + deviceCurrentTime + "\n";
236240

237241
displayTextChangeHandler(str);
238242
Log.i(TAG, str);
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
configurations.maybeCreate("default")
2+
artifacts.add("default", file('olami-android-hotword-detect-1.0.0.beta4.aar'))
Binary file not shown.

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include ':examples', ':lib', ':olami-android-hotword-detect-1.0.0.beta3'
1+
include ':examples', ':lib', ':olami-android-hotword-detect-1.0.0.beta4'

0 commit comments

Comments
 (0)