Skip to content

Commit

Permalink
SDK Release 1.4.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Danil Skachkov committed Apr 15, 2015
1 parent 2266664 commit 589db3a
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 90 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
*
***********************************************************************************************************************/

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
Expand Down Expand Up @@ -98,41 +98,32 @@ public void onResult(final AIResponse response) {
public void run() {
Log.d(TAG, "onResult");

if (response.isError()) {
resultTextView.setText("Error: " + response.getStatus().getErrorDetails());

Log.i(TAG, "Received error response");

// this is example how to get different parts of error description
Log.i(TAG, "Error details: " + response.getStatus().getErrorDetails());
Log.i(TAG, "Error type: " + response.getStatus().getErrorType());
} else {
resultTextView.setText(gson.toJson(response));
resultTextView.setText(gson.toJson(response));

Log.i(TAG, "Received success response");
Log.i(TAG, "Received success response");

// this is example how to get different parts of result object
Log.i(TAG, "Status code: " + response.getStatus().getCode());
Log.i(TAG, "Status type: " + response.getStatus().getErrorType());
// this is example how to get different parts of result object
Log.i(TAG, "Status code: " + response.getStatus().getCode());
Log.i(TAG, "Status type: " + response.getStatus().getErrorType());

Log.i(TAG, "Resolved query: " + response.getResult().getResolvedQuery());
Log.i(TAG, "Resolved query: " + response.getResult().getResolvedQuery());

Log.i(TAG, "Action: " + response.getResult().getAction());
Log.i(TAG, "Speech: " + response.getResult().getSpeech());
Log.i(TAG, "Action: " + response.getResult().getAction());
Log.i(TAG, "Speech: " + response.getResult().getSpeech());

if (response.getResult().getMetadata() != null) {
Log.i(TAG, "Intent id: " + response.getResult().getMetadata().getIntentId());
Log.i(TAG, "Intent name: " + response.getResult().getMetadata().getIntentName());
}
if (response.getResult().getMetadata() != null) {
Log.i(TAG, "Intent id: " + response.getResult().getMetadata().getIntentId());
Log.i(TAG, "Intent name: " + response.getResult().getMetadata().getIntentName());
}

if (response.getResult().getParameters() != null && !response.getResult().getParameters().isEmpty()) {
Log.i(TAG, "Parameters: ");
for (final Map.Entry<String, JsonElement> entry : response.getResult().getParameters().entrySet()){
Log.i(TAG, String.format("%s: %s", entry.getKey(), entry.getValue().toString()));
}
if (response.getResult().getParameters() != null && !response.getResult().getParameters().isEmpty()) {
Log.i(TAG, "Parameters: ");
for (final Map.Entry<String, JsonElement> entry : response.getResult().getParameters().entrySet()) {
Log.i(TAG, String.format("%s: %s", entry.getKey(), entry.getValue().toString()));
}
}
}

});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,41 +65,32 @@ public void onResult(final AIResponse response) {
public void run() {
Log.d(TAG, "onResult");

if (response.isError()) {
resultTextView.setText("Error: " + response.getStatus().getErrorDetails());
resultTextView.setText(GsonFactory.getGson().toJson(response));

Log.i(TAG, "Received error response");
Log.i(TAG, "Received success response");

// this is example how to get different parts of error description
Log.i(TAG, "Error details: " + response.getStatus().getErrorDetails());
Log.i(TAG, "Error type: " + response.getStatus().getErrorType());
} else {
resultTextView.setText(GsonFactory.getGson().toJson(response));
// this is example how to get different parts of result object
Log.i(TAG, "Status code: " + response.getStatus().getCode());
Log.i(TAG, "Status type: " + response.getStatus().getErrorType());

Log.i(TAG, "Received success response");
Log.i(TAG, "Resolved query: " + response.getResult().getResolvedQuery());

// this is example how to get different parts of result object
Log.i(TAG, "Status code: " + response.getStatus().getCode());
Log.i(TAG, "Status type: " + response.getStatus().getErrorType());
Log.i(TAG, "Action: " + response.getResult().getAction());
Log.i(TAG, "Speech: " + response.getResult().getSpeech());

Log.i(TAG, "Resolved query: " + response.getResult().getResolvedQuery());

Log.i(TAG, "Action: " + response.getResult().getAction());
Log.i(TAG, "Speech: " + response.getResult().getSpeech());

if (response.getResult().getMetadata() != null) {
Log.i(TAG, "Intent id: " + response.getResult().getMetadata().getIntentId());
Log.i(TAG, "Intent name: " + response.getResult().getMetadata().getIntentName());
}
if (response.getResult().getMetadata() != null) {
Log.i(TAG, "Intent id: " + response.getResult().getMetadata().getIntentId());
Log.i(TAG, "Intent name: " + response.getResult().getMetadata().getIntentName());
}

if (response.getResult().getParameters() != null && !response.getResult().getParameters().isEmpty()) {
Log.i(TAG, "Parameters: ");
for (final Map.Entry<String, JsonElement> entry : response.getResult().getParameters().entrySet()) {
Log.i(TAG, String.format("%s: %s", entry.getKey(), entry.getValue().toString()));
}
if (response.getResult().getParameters() != null && !response.getResult().getParameters().isEmpty()) {
Log.i(TAG, "Parameters: ");
for (final Map.Entry<String, JsonElement> entry : response.getResult().getParameters().entrySet()) {
Log.i(TAG, String.format("%s: %s", entry.getKey(), entry.getValue().toString()));
}
}
}

});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
*
***********************************************************************************************************************/

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.text.TextUtils;
import android.util.Log;
import android.view.Menu;
Expand Down Expand Up @@ -79,18 +79,18 @@ protected void onCreate(final Bundle savedInstanceState) {
contextTextView = (EditText) findViewById(R.id.contextTextView);
selectLanguageSpinner = (Spinner) findViewById(R.id.selectLanguageSpinner);

final LanguageConfig[] languages = new LanguageConfig[] {
new LanguageConfig("en","327bf2eb54904e508362f6fb528ce00a"),
new LanguageConfig("ru","adcb900f02594f4186420c082e44173e"),
new LanguageConfig("de","96807aac0e98426eaf684f4081b7e431"),
new LanguageConfig("pt","4c4a2277516041f6a1c909163ebfed39"),
final LanguageConfig[] languages = new LanguageConfig[]{
new LanguageConfig("en", "327bf2eb54904e508362f6fb528ce00a"),
new LanguageConfig("ru", "adcb900f02594f4186420c082e44173e"),
new LanguageConfig("de", "96807aac0e98426eaf684f4081b7e431"),
new LanguageConfig("pt", "4c4a2277516041f6a1c909163ebfed39"),
new LanguageConfig("pt-BR", "6076377eea9e4291854204795b55eee9"),
new LanguageConfig("es", "430d461ea8e64c09a4459560353a5b1d"),
new LanguageConfig("fr","d6434b3bf49d4a93a25679782619f39d"),
new LanguageConfig("it","4319f7aa1765468194d9761432e4db36"),
new LanguageConfig("fr", "d6434b3bf49d4a93a25679782619f39d"),
new LanguageConfig("it", "4319f7aa1765468194d9761432e4db36"),
new LanguageConfig("ja", "6cab6813dc8c416f92c3c2e2b4a7bc27"),
new LanguageConfig("ko", "b0219c024ee848eaa7cfb17dceb9934a"),
new LanguageConfig("zh-CN","2b575c06deb246d2abe4bf769eb3200b"),
new LanguageConfig("zh-CN", "2b575c06deb246d2abe4bf769eb3200b"),
new LanguageConfig("zh-HK", "00ef32d3e35f43178405c046a16f3843"),
new LanguageConfig("zh-TW", "dd7ebc8a02974155aeffec26b21b55cf"),
};
Expand Down Expand Up @@ -205,41 +205,32 @@ public void onResult(final AIResponse response) {
public void run() {
Log.d(TAG, "onResult");

if (response.isError()) {
resultTextView.setText("Error: " + response.getStatus().getErrorDetails());

Log.i(TAG, "Received error response");

// this is example how to get different parts of error description
Log.i(TAG, "Error details: " + response.getStatus().getErrorDetails());
Log.i(TAG, "Error type: " + response.getStatus().getErrorType());
} else {
resultTextView.setText(gson.toJson(response));
resultTextView.setText(gson.toJson(response));

Log.i(TAG, "Received success response");
Log.i(TAG, "Received success response");

// this is example how to get different parts of result object
Log.i(TAG, "Status code: " + response.getStatus().getCode());
Log.i(TAG, "Status type: " + response.getStatus().getErrorType());
// this is example how to get different parts of result object
Log.i(TAG, "Status code: " + response.getStatus().getCode());
Log.i(TAG, "Status type: " + response.getStatus().getErrorType());

Log.i(TAG, "Resolved query: " + response.getResult().getResolvedQuery());
Log.i(TAG, "Resolved query: " + response.getResult().getResolvedQuery());

Log.i(TAG, "Action: " + response.getResult().getAction());
Log.i(TAG, "Speech: " + response.getResult().getSpeech());
Log.i(TAG, "Action: " + response.getResult().getAction());
Log.i(TAG, "Speech: " + response.getResult().getSpeech());

if (response.getResult().getMetadata() != null) {
Log.i(TAG, "Intent id: " + response.getResult().getMetadata().getIntentId());
Log.i(TAG, "Intent name: " + response.getResult().getMetadata().getIntentName());
}
if (response.getResult().getMetadata() != null) {
Log.i(TAG, "Intent id: " + response.getResult().getMetadata().getIntentId());
Log.i(TAG, "Intent name: " + response.getResult().getMetadata().getIntentName());
}

if (response.getResult().getParameters() != null && !response.getResult().getParameters().isEmpty()) {
Log.i(TAG, "Parameters: ");
for (final Map.Entry<String, JsonElement> entry : response.getResult().getParameters().entrySet()){
Log.i(TAG, String.format("%s: %s", entry.getKey(), entry.getValue().toString()));
}
if (response.getResult().getParameters() != null && !response.getResult().getParameters().isEmpty()) {
Log.i(TAG, "Parameters: ");
for (final Map.Entry<String, JsonElement> entry : response.getResult().getParameters().entrySet()) {
Log.i(TAG, String.format("%s: %s", entry.getKey(), entry.getValue().toString()));
}
}
}

});
}

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

VERSION_NAME=1.4.6-SNAPSHOT
VERSION_CODE=16
VERSION_NAME=1.4.6
VERSION_CODE=17
GROUP=ai.api

POM_DESCRIPTION=API.AI Android SDK allows using voice commands and integration with dialog scenarios defined for a particular agent in API.AI.
Expand Down

0 comments on commit 589db3a

Please sign in to comment.