Skip to content

Commit 41021ed

Browse files
author
Jay Lieske
committed
Create new SimpleSpeechUI examples for Android and iOS.
1 parent 852e74c commit 41021ed

40 files changed

+3305
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
4+
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
5+
<classpathentry kind="src" path="src"/>
6+
<classpathentry kind="src" path="gen"/>
7+
<classpathentry kind="output" path="bin/classes"/>
8+
</classpath>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.svn
2+
3+
# Mac ignores
4+
.DS_Store
5+
6+
# Rails ignores
7+
*.log
8+
tmp/
9+
10+
# Xcode ignores
11+
build/
12+
*.pbxuser
13+
*.mode2v3
14+
*.swp
15+
*~.nib
16+
*.pbxuser
17+
*.perspective
18+
*.perspectivev3
19+
20+
# Android ignores
21+
local.properties
22+
/bin
23+
/gen
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>SimpleSpeechUI</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.jdt.core.javabuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
<buildCommand>
24+
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
25+
<arguments>
26+
</arguments>
27+
</buildCommand>
28+
</buildSpec>
29+
<natures>
30+
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
31+
<nature>org.eclipse.jdt.core.javanature</nature>
32+
</natures>
33+
<filteredResources>
34+
<filter>
35+
<id>0</id>
36+
<name></name>
37+
<type>22</type>
38+
<matcher>
39+
<id>org.eclipse.ui.ide.multiFilter</id>
40+
<arguments>1.0-name-matches-true-false-.DS_Store</arguments>
41+
</matcher>
42+
</filter>
43+
</filteredResources>
44+
</projectDescription>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
encoding/<project>=UTF-8
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#Tue Feb 21 19:15:57 PST 2012
2+
eclipse.preferences.version=1
3+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
4+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
5+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6+
org.eclipse.jdt.core.compiler.compliance=1.6
7+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
8+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
9+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
10+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
11+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12+
org.eclipse.jdt.core.compiler.source=1.6
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="example.simplespeechui"
4+
android:versionCode="2"
5+
android:versionName="1.6" >
6+
7+
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8"/>
8+
<uses-permission android:name="android.permission.INTERNET"/>
9+
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
10+
11+
<application
12+
android:icon="@drawable/ic_launcher"
13+
android:label="@string/app_name"
14+
android:allowBackup="false">
15+
<activity android:name=".SimpleSpeechUIDemo"
16+
android:label="@string/app_title"
17+
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|fontScale">
18+
<intent-filter >
19+
<action android:name="android.intent.action.MAIN" />
20+
<category android:name="android.intent.category.LAUNCHER" />
21+
</intent-filter>
22+
</activity>
23+
</application>
24+
</manifest>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Licensed by AT&T under 'Software Development Kit Tools Agreement' 2012.
2+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com/sdk_agreement/
3+
Copyright 2012 AT&T Intellectual Property. All rights reserved.
4+
For more information contact developer.support@att.com http://developer.att.com
5+
6+
# SimpleSpeechUI example Android app for AT&T Speech SDK
7+
8+
This sample app includes Android source code and an Eclipse project to show how to call the AT&T Speech SDK from an application that wants a custom speech UI. The app displays a simple client-side mashup. Pressing a button initiates a speech interaction, a text area shows the recognition result, and a web view uses the recognized speech to search a website. The text area also shows the progress of the speech interaction, and the button changes to "stop" or "cancel" during the phases of the interaction.
9+
10+
## Setting up the project
11+
12+
The SimpleSpeechUI Eclipse project is already configured to link with the Speech SDK, but it needs a copy of the files from the Speech SDK distribution. Follow these steps to add the latest SpeechKit to the project.
13+
14+
1. If it's not present, create a `libs` subdirectory of this sample app.
15+
2. Unzip the AT&T Speech SDK for Android into its own folder.
16+
2. Copy the file `ATTSpeechKit.jar` into the `libs` subfolder.
17+
4. Expand the `libs` group within the Eclipse project window. You should see the ATTSpeechKit JAR there.
18+
19+
## Running the sample
20+
21+
Before building the sample app, you will need to add the configuration for your Speech API account: the URL of the service, your developer ID, and its password. Set those values in `SpeechConfig.java`. Before distributing your app to the public, make sure you add code to obfuscate those credentials.
22+
23+
## Understanding the sample
24+
25+
The main code of the sample app is in the `SimpleSpeechUIDemo` class. Look in the `setupSpeechService` method and `SpeechButtonListener` inner class for examples of setting up and starting a speech interaction. Look in the `SpeechResultListener`/`SpeechErrorListener` inner classes for handling recognition responses and errors. Look in the `SpeechStateListener` and `SpeechLevelListener` inner classes for examples of handling SpeechKit callbacks for a custom UI.
26+
27+
## Reusable OAuth code
28+
29+
An example of OAuth client credential validation is in the class `SpeechAuth`. You may use that class in your own applications, or you can use any other OAuth library. Look in `SimpleSpeechUIDemo.validateOAuth()` for an example of calling `SpeechAuth` to obtain an access token.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Ignore everything in this directory
2+
*
3+
4+
# Except this file
5+
!.gitignore
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<lint>
3+
<issue id="SetJavaScriptEnabled" severity="ignore" />
4+
<issue id="TypographyEllipsis" severity="informational" />
5+
</lint>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
-optimizationpasses 5
2+
-dontusemixedcaseclassnames
3+
-dontskipnonpubliclibraryclasses
4+
-dontpreverify
5+
-verbose
6+
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
7+
8+
-keep public class * extends android.app.Activity
9+
-keep public class * extends android.app.Application
10+
-keep public class * extends android.app.Service
11+
-keep public class * extends android.content.BroadcastReceiver
12+
-keep public class * extends android.content.ContentProvider
13+
-keep public class * extends android.app.backup.BackupAgentHelper
14+
-keep public class * extends android.preference.Preference
15+
-keep public class com.android.vending.licensing.ILicensingService
16+
17+
-keepclasseswithmembernames class * {
18+
native <methods>;
19+
}
20+
21+
-keepclasseswithmembers class * {
22+
public <init>(android.content.Context, android.util.AttributeSet);
23+
}
24+
25+
-keepclasseswithmembers class * {
26+
public <init>(android.content.Context, android.util.AttributeSet, int);
27+
}
28+
29+
-keepclassmembers class * extends android.app.Activity {
30+
public void *(android.view.View);
31+
}
32+
33+
-keepclassmembers enum * {
34+
public static **[] values();
35+
public static ** valueOf(java.lang.String);
36+
}
37+
38+
-keep class * implements android.os.Parcelable {
39+
public static final android.os.Parcelable$Creator *;
40+
}

0 commit comments

Comments
 (0)