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

Commit

Permalink
Virtual Assistant Client for Android - initial public commit (#1493)
Browse files Browse the repository at this point in the history
* Virtual Assistant Client for Android - initial public commit

* updated .gitignore to ensure the /src/debug folder is not ignored
  • Loading branch information
abiemann authored and darrenj committed Jun 6, 2019
1 parent c9ca8ad commit d936eb6
Show file tree
Hide file tree
Showing 190 changed files with 17,138 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -371,3 +371,4 @@ ASALocalRun/
*.lzma
*.cab
.DS_Store
/.project
13 changes: 13 additions & 0 deletions solutions/android/VirtualAssistantClient/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
2 changes: 2 additions & 0 deletions solutions/android/VirtualAssistantClient/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/build
!/src/debug
66 changes: 66 additions & 0 deletions solutions/android/VirtualAssistantClient/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 28
defaultConfig {
applicationId "com.microsoft.bot.builder.solutions.virtualassistant"
minSdkVersion 24
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

repositories {
mavenCentral()
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')

// Android Support
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'

// Butterknife
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

// for Events
implementation 'org.greenrobot:eventbus:3.1.1'

// for adaptive card rendering, see https://mvnrepository.com/artifact/io.adaptivecards/adaptivecards-android
implementation 'io.adaptivecards:adaptivecards-android:1.2.0-beta1'

// JSON
implementation "com.google.code.gson:gson:2.8.4"

// rxJava
implementation 'com.tbruyelle.rxpermissions:rxpermissions:0.7.0@aar'
implementation 'io.reactivex:rxandroid:1.2.1'
implementation 'io.reactivex:rxjava:1.1.6'

// Material Dialogs
implementation 'com.afollestad.material-dialogs:core:0.9.6.0'

// fused API
implementation "com.google.android.gms:play-services-location:16.0.0"
implementation "com.android.support:support-media-compat:28.0.0"
//fixes fused API outdated library
implementation "com.android.support:support-v4:28.0.0"//fixes fused API outdated library

// Direct Line Speech (local module)
implementation project(':directlinespeech')
}
21 changes: 21 additions & 0 deletions solutions/android/VirtualAssistantClient/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.microsoft.bot.builder.solutions.virtualassistant.activities.configuration;

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 BOT_ID = "YOUR_BOT_ID_HERE";//TODO

public static final String SPEECH_REGION = "westus2";

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 LOCALE = "en-us";

public static final String GEOLOCATION_LAT = "47.617305";
public static final String GEOLOCATION_LON = "-122.192217";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.microsoft.bot.builder.solutions.virtualassistant">
<!--
for an overview of permissions, see :
https://developer.android.com/guide/topics/permissions/overview
-->
<!-- NORMAL -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <!-- for ContextCompat.startForegroundService -->
<!-- DANGEROUS -->
<uses-permission android:name="android.permission.RECORD_AUDIO" /> <!-- FOR SPEECH COMMANDS -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<application
android:name=".MainApplication"
android:allowBackup="true"
android:fullBackupContent="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">

<!-- android:windowSoftInputMode="adjustPan" prevents keyboard from hiding TextInputEditText's -->
<activity
android:name=".activities.main.MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustPan|stateAlwaysHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity
android:name=".assistant.VoiceInteractionActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.VOICE" />
</intent-filter>
</activity>

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

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

<!-- WIDGETS -->
<receiver android:name=".widgets.WidgetTalkButton">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>

<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/widget_talk_button_info" />
</receiver>

<receiver android:name=".widgets.WidgetBotRequest">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>

<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/widget_bot_request_info" />
</receiver>

<receiver android:name=".widgets.WidgetBotResponse">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>

<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/widget_bot_response_info" />
</receiver>

<service
android:name=".service.SpeechService"
android:enabled="true"
android:exported="true" /> <!-- ASSISTANT -->

<service
android:name=".assistant.AssistantService"
android:permission="android.permission.BIND_VOICE_INTERACTION">
<meta-data
android:name="android.voice_interaction"
android:resource="@xml/assistant_service" />
<intent-filter>
<action android:name="android.service.voice.VoiceInteractionService" />
</intent-filter>
</service>

<service
android:name=".assistant.AssistantSessionService"
android:permission="android.permission.BIND_VOICE_INTERACTION" />

</application>

</manifest>
Binary file not shown.
Loading

0 comments on commit d936eb6

Please sign in to comment.