Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Commit

Permalink
Latest Android Assistant updates (#1771)
Browse files Browse the repository at this point in the history
* blue background for users' requests in chat

* added demo feature to update widgets of 3rd party app

* added ISO 8601 timestamps to generated activity events

* pull from upstream (#11)

* Added initial readme for Android Assistant app (#1667)

* Virtual Assistant Client for Android - initial public commit

* updated .gitignore to ensure the /src/debug folder is not ignored

* implemented feedback from PR 1493

* code cleanup after merge

* fixes possible exception due to race condition

* fix: release created and stopped audio records

* added timeout event so that client app can notify user

* WIP adaptive card click events

* WIP adaptive card clicking

* finished implementation of adaptive card clicking

* Updated Location event so that the data is consumed properly

* additional IPA -> VA changes

* logcat logging of complete JSON data

* using suggested actions for adaptive card click

* undo incorrect commit

* added suggested actions feature

* updates to allow the service to receive connections from other apps

* small code updates + locationProvider threading fix

* finished feature to broadcast data to other apps

* added initial readme for Android app

* Update readme.md

* [Botskills] Add a new Known Issue of the CLI tool (#1665)

* Adapt luisgen commands to trailing backslashs

* Add issue in KnownIssues doc

* Add an example of the issue

* [DevOps] Disable builds in pull-request by default (#1661)

* Update YAML files in TypeScript and Csharp

* Update readme in both versions

* Minor changes in YAML files

* Minor changes in readme files

* Updated default comment with sections for bots/deployment scripts (#1669)

* News skill: adding trending articles, favorite topics, searching by market, searching by website  (#1660)

* Added trending articles, changing search market, search specific sites, choosing favorite topics

* Changes from comments

* fis newsLuis

* update publish scripts to fix skill deployment filenotfound issues with kudu (#1668)

* Create release-drafter.yml

* [TypeScript][Virtual Assistant/Skill samples] Migrate from TSLint to ESLint (#1673)

* Add ESLint to sample assistant

* Fix ESLint issues in sample-assistant

* Add ESLint to sample skill

* Fix ESLint issues in sample-skill

* Update dependencies

* Update templates

* Update generator

* [SkillsLib]remove http transport and related (#1676)

* remove http transport and related

* try to get RestoreAddtionalProjectSources working

* trigger build

* add package source for Skills test project

* Android app update: Ability to change view between Full Conversation and Conversation (#1681)

* Virtual Assistant Client for Android - initial public commit

* updated .gitignore to ensure the /src/debug folder is not ignored

* implemented feedback from PR 1493

* code cleanup after merge

* fixes possible exception due to race condition

* fix: release created and stopped audio records

* added timeout event so that client app can notify user

* WIP adaptive card click events

* WIP adaptive card clicking

* finished implementation of adaptive card clicking

* Updated Location event so that the data is consumed properly

* additional IPA -> VA changes

* logcat logging of complete JSON data

* using suggested actions for adaptive card click

* undo incorrect commit

* added suggested actions feature

* updates to allow the service to receive connections from other apps

* small code updates + locationProvider threading fix

* finished feature to broadcast data to other apps

* added initial readme for Android app

* Update readme.md

* added feature to show full conversation

* latest upstream changes (#8)

* Added initial readme for Android Assistant app (#1667)

* Virtual Assistant Client for Android - initial public commit

* updated .gitignore to ensure the /src/debug folder is not ignored

* implemented feedback from PR 1493

* code cleanup after merge

* fixes possible exception due to race condition

* fix: release created and stopped audio records

* added timeout event so that client app can notify user

* WIP adaptive card click events

* WIP adaptive card clicking

* finished implementation of adaptive card clicking

* Updated Location event so that the data is consumed properly

* additional IPA -> VA changes

* logcat logging of complete JSON data

* using suggested actions for adaptive card click

* undo incorrect commit

* added suggested actions feature

* updates to allow the service to receive connections from other apps

* small code updates + locationProvider threading fix

* finished feature to broadcast data to other apps

* added initial readme for Android app

* Update readme.md

* [Botskills] Add a new Known Issue of the CLI tool (#1665)

* Adapt luisgen commands to trailing backslashs

* Add issue in KnownIssues doc

* Add an example of the issue

* [DevOps] Disable builds in pull-request by default (#1661)

* Update YAML files in TypeScript and Csharp

* Update readme in both versions

* Minor changes in YAML files

* Minor changes in readme files

* Updated default comment with sections for bots/deployment scripts (#1669)

* News skill: adding trending articles, favorite topics, searching by market, searching by website  (#1660)

* Added trending articles, changing search market, search specific sites, choosing favorite topics

* Changes from comments

* fis newsLuis

* update publish scripts to fix skill deployment filenotfound issues with kudu (#1668)

* Create release-drafter.yml

* [TypeScript][Virtual Assistant/Skill samples] Migrate from TSLint to ESLint (#1673)

* Add ESLint to sample assistant

* Fix ESLint issues in sample-assistant

* Add ESLint to sample skill

* Fix ESLint issues in sample-skill

* Update dependencies

* Update templates

* Update generator

* [Botskills] Improve error messages (#1683)

* Improve error messages for more verbosity

* Continue improving error messages

* Finish improving error messages

* Improve error handling for authenticationUtils

* Revert changes to arguments arrays

* Add link to documentation when auth fails

* Allow ITriggers with nullable properties (#1685)

* [Botskills] Move location to tools folder (#1666)

* Move botskills cli tool to the tools root folder

* Update doc references

* Update yaml files

* Update package-lock file

* Update build.botskills.ts.ps1

* Update speechenablement.md

* [Botskills] Add re-publish warning (#1686)

* Add warning to republish VA after refresh

* Fix tests

* add flag to include nuget pkgs so nuspec can pick up packages needed (#1690)

* add flag to include nuget pkgs so nuspec can pick up packages needed

* force trigger build

* remove redundant space

* [VA] Updated deployment scripts to assign luis subscription key automatically (#1693)

* add luis sub key

* add azure account

* deploy updates

* deploy fix

* [Botskills] Update documentation (#1688)

* Update botskills documentation

* Remove style of botskills word

* Fix link reference

* Fix references to botskills documentation

* Fix typos

* Apply suggestions from code review

Co-Authored-By: David Favretto <[email protected]>

* Apply suggestions from code review

* upgrade versions of skills and solutions for templates (#1695)

* [TypeScript][BotBuilder-Libs] Migrate from TSLint to ESLint (#1696)

* Add ESLint to botbuilder-solutions

* Add ESLint to botbuilder-skills

* Update dependencies

* Fix ESLint issues in botbuilder-solutions

* Fix ESLint issues in botbuilder-skills

* upgrade skills to latest lib version (#1698)

* [Calendar] Add config for slot filling attribute skip (#1647)

* add slot filling default value config

* fix test cases

* add default value config of start date and duration

* add default content and location in common string

* update doc

* Update productivity-calendar.md

* Update productivity-email.md

* Update knownissues.md

* removing template projects from sln as msbuild on devops can't skip certain projects. (#1703)

* VA Deployment Updates (#1694)

* write full validation result to log

* handle spaces in path

* fixed publish with different bot name

* added luis region to all commands

* removed extra registration from skill (#1702)

* Fix broken link to botskills cli (#1708)

* move backgroundImage into column (#1711) (#1712)

They are used in ResponseManager.GetCardResponse as containerItems, so
backgroundImage should be kept in Column.

* [TypeScript][Botskills] Refactor in Mocks folder (#1706)

* Fix typos for errors

* Refactor mocks folder

* Remove unused dependencies in generator-botbuilder-assistant (#1707)

* Update README.md

* Update CODEOWNERS (#1709)

* removed timestamp from Activity events

* added Timezone feature. Fixes #1678

* removed unnecessary Directline constant

* updates:

1. new API sendTimeZoneEvent
2. Settings UI update
3. fixes bug in Synthesizer
4. bot will listen again when expectingInput is received

* Settings screen cleanup

* fix merge for these files with special chars

* Improved broadcasting to 3rd-party apps
  • Loading branch information
abiemann authored and ryanisgrig committed Jul 9, 2019
1 parent 9efd071 commit caa7597
Show file tree
Hide file tree
Showing 15 changed files with 165 additions and 240 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@
public class DefaultConfiguration {

// Replace below with your own subscription key
public static final String COGNITIVE_SERVICES_SUBSCRIPTION_KEY = "YOUR_KEY_HERE";//TODO
public static final String SPEECH_SERVICE_SUBSCRIPTION_KEY = "YOUR_KEY_HERE";//TODO

public static final String BOT_ID = "YOUR_BOT_ID_HERE";//TODO
public static final String DIRECT_LINE_SPEECH_SECRET_KEY = "YOUR_DIRECTLINE_SPEECH_KEY_HERE";//TODO

public static final String SPEECH_REGION = "westus2";
public static final String SPEECH_SERVICE_SUBSCRIPTION_KEY_REGION = "westus2";//TODO

public static final String VOICE_NAME = "Microsoft Server Speech Text to Speech Voice (en-US, JessaNeural)";

public static final String DIRECT_LINE_CONSTANT = "directline";
public static final String USER_NAME = "User";
public static final String USER_ID = "YOUR_USER_ID_HERE";//TODO
public static final String USER_FROM_ID = "YOUR_USER_FROM_ID_HERE";//TODO

public static final String LOCALE = "en-us";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,7 @@
</activity>

<activity
android:name=".activities.botconfiguration.BotConfigurationActivity"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />

<activity
android:name=".activities.configuration.AppConfigurationActivity"
android:name=".activities.settings.SettingsActivity"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
import com.microsoft.bot.builder.solutions.directlinespeech.model.Configuration;
import com.microsoft.bot.builder.solutions.virtualassistant.R;
import com.microsoft.bot.builder.solutions.virtualassistant.activities.BaseActivity;
import com.microsoft.bot.builder.solutions.virtualassistant.activities.botconfiguration.BotConfigurationActivity;
import com.microsoft.bot.builder.solutions.virtualassistant.activities.configuration.AppConfigurationActivity;
import com.microsoft.bot.builder.solutions.virtualassistant.activities.settings.SettingsActivity;
import com.microsoft.bot.builder.solutions.virtualassistant.activities.main.actionslist.ActionsAdapter;
import com.microsoft.bot.builder.solutions.virtualassistant.activities.main.actionslist.ActionsViewholder;
import com.microsoft.bot.builder.solutions.virtualassistant.activities.main.chatlist.ChatAdapter;
Expand Down Expand Up @@ -168,7 +167,6 @@ protected void onResume() {
// Unregister EventBus messages and SpeechService
@Override
public void onStop() {
Log.v("BaseActivity","onStop() finished");
EventBus.getDefault().unregister(this);
if (speechServiceBinder != null) {
unbindService(myConnection);
Expand Down Expand Up @@ -251,10 +249,7 @@ public boolean onNavigationItemSelected(MenuItem item) {

switch (id) {
case R.id.nav_menu_configuration:
startActivity(BotConfigurationActivity.getNewIntent(this));
break;
case R.id.nav_menu_app_configuration:
startActivity(AppConfigurationActivity.getNewIntent(this));
startActivity(SettingsActivity.getNewIntent(this));
break;
case R.id.nav_menu_reset_bot:
speechServiceBinder.resetBot();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
package com.microsoft.bot.builder.solutions.virtualassistant.activities.botconfiguration;
package com.microsoft.bot.builder.solutions.virtualassistant.activities.settings;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.RemoteException;
import android.support.annotation.Nullable;
import android.support.design.widget.TextInputEditText;
import android.util.Log;
import android.view.KeyEvent;
import android.view.inputmethod.EditorInfo;
import android.widget.ArrayAdapter;
import android.widget.Spinner;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.microsoft.bot.builder.solutions.directlinespeech.ConfigurationManager;
import com.microsoft.bot.builder.solutions.directlinespeech.model.Configuration;
import com.microsoft.bot.builder.solutions.virtualassistant.R;
import com.microsoft.bot.builder.solutions.virtualassistant.activities.BaseActivity;

import java.util.TimeZone;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
Expand All @@ -24,27 +32,29 @@
* Bot Configuration Activity - settings to change the connection to the Bot
* Note: settings are saved when OK is pressed
*/
public class BotConfigurationActivity extends BaseActivity {
public class SettingsActivity extends BaseActivity {

// VIEWS
@BindView(R.id.service_key) TextInputEditText serviceKey;
@BindView(R.id.service_region) TextInputEditText serviceRegion;
@BindView(R.id.bot_id) TextInputEditText botId;
@BindView(R.id.voice_name) TextInputEditText voiceName;
@BindView(R.id.user_id) TextInputEditText userId;
@BindView(R.id.locale) TextInputEditText locale;
@BindView(R.id.geolocation_lat) TextInputEditText locationLat;
@BindView(R.id.geolocation_lon) TextInputEditText locationLon;
@BindView(R.id.history_linecount) TextInputEditText historyLinecount;
@BindView(R.id.spinner_timezone) Spinner spinnerTimezone;

// CONSTANTS
private static final int CONTENT_VIEW = R.layout.activity_bot_configuration;
private static final int CONTENT_VIEW = R.layout.activity_settings;

// STATE
private Configuration configuration;
private ArrayAdapter tzAdapter;
private Gson gson;

public static Intent getNewIntent(Context context) {
return new Intent(context, BotConfigurationActivity.class);
return new Intent(context, SettingsActivity.class);
}

@Override
Expand All @@ -53,6 +63,7 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(CONTENT_VIEW);
ButterKnife.bind(this);
gson = new Gson();
initTimezoneAdapter();
}

@Override
Expand All @@ -77,7 +88,7 @@ protected void serviceConnected() {
showConfiguration();
}

@OnEditorAction({R.id.service_key, R.id.service_region, R.id.bot_id, R.id.voice_name, R.id.user_id, R.id.locale, R.id.geolocation_lat, R.id.geolocation_lon})
@OnEditorAction({R.id.history_linecount, R.id.service_key, R.id.service_region, R.id.bot_id, R.id.user_id, R.id.locale, R.id.geolocation_lat, R.id.geolocation_lon})
boolean onEditorAction(int actionId, KeyEvent key){
boolean handled = false;
if (actionId == EditorInfo.IME_ACTION_SEND || (key != null && key.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
Expand All @@ -99,18 +110,44 @@ public void onClickOk() {
finish();
}

private void initTimezoneAdapter() {

//populate spinner with all timezones
String[] idArray = TimeZone.getAvailableIDs();
tzAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item, idArray);
tzAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinnerTimezone.setAdapter(tzAdapter);
}

private void selectTimezone(@Nullable String tzId) {
if (tzId == null){
tzId = TimeZone.getDefault().getID();
}
for (int i = 0; i < tzAdapter.getCount(); i++) {
if (tzAdapter.getItem(i).equals(tzId)) {
spinnerTimezone.setSelection(i);
break;
}
}
}

private void showConfiguration(){
try {
final String json = speechServiceBinder.getConfiguration();
configuration = gson.fromJson(json, new TypeToken<Configuration>(){}.getType());
serviceKey.setText(configuration.serviceKey);
serviceRegion.setText(configuration.serviceRegion);
botId.setText(configuration.botId);
voiceName.setText(configuration.voiceName);
userId.setText(configuration.userId);
locale.setText(configuration.locale);
locationLat.setText(configuration.geolat);
locationLon.setText(configuration.geolon);

int iHistoryLinecount = configuration.historyLinecount==null?1:configuration.historyLinecount;
String historyLineCount = String.valueOf(iHistoryLinecount);
historyLinecount.setText(historyLineCount);

selectTimezone(configuration.currentTimezone);
} catch (RemoteException exception){
Log.e(LOGTAG, exception.getMessage());
}
Expand All @@ -121,11 +158,18 @@ private void saveConfiguration(){
configuration.serviceKey = serviceKey.getText().toString();
configuration.serviceRegion = serviceRegion.getText().toString();
configuration.botId = botId.getText().toString();
configuration.voiceName = voiceName.getText().toString();
configuration.userId = userId.getText().toString();
configuration.locale = locale.getText().toString();
configuration.geolat = locationLat.getText().toString();
configuration.geolon = locationLon.getText().toString();

// history linecount
configuration.historyLinecount = Integer.valueOf(historyLinecount.getText().toString());
if (configuration.historyLinecount == 0) configuration.historyLinecount = 1;//do not allow 0

// timezone
configuration.currentTimezone = (String)tzAdapter.getItem(spinnerTimezone.getSelectedItemPosition());

String json = gson.toJson(configuration);
speechServiceBinder.setConfiguration(json);
} catch (RemoteException exception){
Expand Down
Loading

0 comments on commit caa7597

Please sign in to comment.