Skip to content

Commit 5c47867

Browse files
committed
android 连接器代码分离及优化
1、增加重连机制; 2、优化麦克风及蓝牙sco管理机制; 3、增加麦克风开关及服务器地址管理。
1 parent 2c7131e commit 5c47867

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1587
-2
lines changed

README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,24 @@
1-
# fay-android
2-
app会常驻手机后台,你可以随时随地保持与Fay数字人的沟通。
1+
# android 连接器
2+
android 连接器 app会常驻手机后台,你可以随时随地保持与Fay数字人(https://github.com/TheRamU/Fay)的沟通。
3+
4+
![image-20231225180134156](C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20231225180134156.png)
5+
6+
7+
8+
9+
10+
**使用说明**
11+
12+
1、工程使用android studio 开发,可以直接下载apk运行。
13+
14+
2、若需要让app在公网环境保持与Fay的互通,在Fay中配置ngrok.cc 的id,并在服务器地址栏填上分配域名及端口(无须填写协议)。
15+
16+
**更新说明**
17+
18+
2023.12.25:
19+
20+
1、增加重连机制;
21+
22+
2、优化麦克风及蓝牙sco管理机制;
23+
24+
3、增加麦克风开关及服务器地址管理。

fayConnectorDemo/.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild
14+
.cxx
15+
local.properties

fayConnectorDemo/.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fayConnectorDemo/.idea/compiler.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fayConnectorDemo/.idea/gradle.xml

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fayConnectorDemo/.idea/misc.xml

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fayConnectorDemo/app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

fayConnectorDemo/app/build.gradle

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
plugins {
2+
id 'com.android.application'
3+
}
4+
5+
android {
6+
compileSdk 32
7+
8+
defaultConfig {
9+
applicationId "com.yaheen.fayconnectordemo"
10+
minSdk 29
11+
targetSdk 32
12+
versionCode 1
13+
versionName "1.0"
14+
15+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
16+
}
17+
18+
buildTypes {
19+
release {
20+
minifyEnabled false
21+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
22+
}
23+
}
24+
compileOptions {
25+
sourceCompatibility JavaVersion.VERSION_1_8
26+
targetCompatibility JavaVersion.VERSION_1_8
27+
}
28+
}
29+
30+
dependencies {
31+
32+
implementation 'androidx.appcompat:appcompat:1.3.0'
33+
implementation 'com.google.android.material:material:1.4.0'
34+
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
35+
testImplementation 'junit:junit:4.13.2'
36+
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
37+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
38+
39+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.yaheen.fayconnectordemo;
2+
3+
import android.content.Context;
4+
5+
import androidx.test.platform.app.InstrumentationRegistry;
6+
import androidx.test.ext.junit.runners.AndroidJUnit4;
7+
8+
import org.junit.Test;
9+
import org.junit.runner.RunWith;
10+
11+
import static org.junit.Assert.*;
12+
13+
/**
14+
* Instrumented test, which will execute on an Android device.
15+
*
16+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
17+
*/
18+
@RunWith(AndroidJUnit4.class)
19+
public class ExampleInstrumentedTest {
20+
@Test
21+
public void useAppContext() {
22+
// Context of the app under test.
23+
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24+
assertEquals("com.yaheen.fayconnectordemo", appContext.getPackageName());
25+
}
26+
}

0 commit comments

Comments
 (0)