diff --git a/doc/03_软件需求规格说明书.docx b/doc/03_软件需求规格说明书.docx
new file mode 100644
index 0000000..ce7941a
Binary files /dev/null and b/doc/03_软件需求规格说明书.docx differ
diff --git a/doc/04_软件设计规格说明书.docx b/doc/04_软件设计规格说明书.docx
new file mode 100644
index 0000000..ef20f68
Binary files /dev/null and b/doc/04_软件设计规格说明书.docx differ
diff --git a/other/05_开发软件系统实践的汇报PPT.pptx b/other/05_开发软件系统实践的汇报PPT.pptx
new file mode 100644
index 0000000..c348782
Binary files /dev/null and b/other/05_开发软件系统实践的汇报PPT.pptx differ
diff --git a/other/06_软件开发项目的个人自评报告.xlsx b/other/06_软件开发项目的个人自评报告.xlsx
new file mode 100644
index 0000000..bf24919
Binary files /dev/null and b/other/06_软件开发项目的个人自评报告.xlsx differ
diff --git a/other/07_软件开发项目的团队自评报告.xlsx b/other/07_软件开发项目的团队自评报告.xlsx
new file mode 100644
index 0000000..92c81f3
Binary files /dev/null and b/other/07_软件开发项目的团队自评报告.xlsx differ
diff --git a/other/08_210340118商译丹-实践总结报告.docx b/other/08_210340118商译丹-实践总结报告.docx
new file mode 100644
index 0000000..05b0662
Binary files /dev/null and b/other/08_210340118商译丹-实践总结报告.docx differ
diff --git a/other/08_210340120唐志发-实践总结报告.docx b/other/08_210340120唐志发-实践总结报告.docx
new file mode 100644
index 0000000..cea41a0
Binary files /dev/null and b/other/08_210340120唐志发-实践总结报告.docx differ
diff --git a/other/08_210340147郭嘉怡-实践总结报告.docx b/other/08_210340147郭嘉怡-实践总结报告.docx
new file mode 100644
index 0000000..fdec456
Binary files /dev/null and b/other/08_210340147郭嘉怡-实践总结报告.docx differ
diff --git a/other/08_210340171颜茗-实践总结报告.docx b/other/08_210340171颜茗-实践总结报告.docx
new file mode 100644
index 0000000..2496268
Binary files /dev/null and b/other/08_210340171颜茗-实践总结报告.docx differ
diff --git a/other/08_210340175叶媚杰-实践总结报告.docx b/other/08_210340175叶媚杰-实践总结报告.docx
new file mode 100644
index 0000000..d48d0e9
Binary files /dev/null and b/other/08_210340175叶媚杰-实践总结报告.docx differ
diff --git a/other/09_系统演示视频.mp4 b/other/09_系统演示视频.mp4
new file mode 100644
index 0000000..ea82936
Binary files /dev/null and b/other/09_系统演示视频.mp4 differ
diff --git a/other/10_系统宣传海报.png b/other/10_系统宣传海报.png
new file mode 100644
index 0000000..35b1f0e
Binary files /dev/null and b/other/10_系统宣传海报.png differ
diff --git a/src/Fall-Detection-master/.gitignore b/src/Fall-Detection-master/.gitignore
new file mode 100644
index 0000000..39fb081
--- /dev/null
+++ b/src/Fall-Detection-master/.gitignore
@@ -0,0 +1,9 @@
+*.iml
+.gradle
+/local.properties
+/.idea/workspace.xml
+/.idea/libraries
+.DS_Store
+/build
+/captures
+.externalNativeBuild
diff --git a/src/Fall-Detection-master/.idea/.gitignore b/src/Fall-Detection-master/.idea/.gitignore
new file mode 100644
index 0000000..26d3352
--- /dev/null
+++ b/src/Fall-Detection-master/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/src/Fall-Detection-master/.idea/compiler.xml b/src/Fall-Detection-master/.idea/compiler.xml
new file mode 100644
index 0000000..fb7f4a8
--- /dev/null
+++ b/src/Fall-Detection-master/.idea/compiler.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Fall-Detection-master/.idea/gradle.xml b/src/Fall-Detection-master/.idea/gradle.xml
new file mode 100644
index 0000000..a2d7c21
--- /dev/null
+++ b/src/Fall-Detection-master/.idea/gradle.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Fall-Detection-master/.idea/jarRepositories.xml b/src/Fall-Detection-master/.idea/jarRepositories.xml
new file mode 100644
index 0000000..a5f05cd
--- /dev/null
+++ b/src/Fall-Detection-master/.idea/jarRepositories.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Fall-Detection-master/.idea/misc.xml b/src/Fall-Detection-master/.idea/misc.xml
new file mode 100644
index 0000000..bdd9278
--- /dev/null
+++ b/src/Fall-Detection-master/.idea/misc.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Fall-Detection-master/app/.gitignore b/src/Fall-Detection-master/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/src/Fall-Detection-master/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/src/Fall-Detection-master/app/app-release.apk b/src/Fall-Detection-master/app/app-release.apk
new file mode 100644
index 0000000..9ce51a6
Binary files /dev/null and b/src/Fall-Detection-master/app/app-release.apk differ
diff --git a/src/Fall-Detection-master/app/build.gradle b/src/Fall-Detection-master/app/build.gradle
new file mode 100644
index 0000000..99cded4
--- /dev/null
+++ b/src/Fall-Detection-master/app/build.gradle
@@ -0,0 +1,35 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 23
+ buildToolsVersion '25.0.2'
+
+ defaultConfig {
+ applicationId 'com.example.cauc.falldetecion'
+ minSdkVersion 23
+ targetSdkVersion 23
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+
+}
+
+dependencies {
+ api fileTree(include: ['*.jar'], dir: 'libs')
+ androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
+ exclude group: 'com.android.support', module: 'support-annotations'
+ })
+ api 'com.android.support:appcompat-v7:23.4.0'
+ testImplementation 'junit:junit:4.12'
+ api 'com.android.support:design:23.2.0'
+ api 'de.hdodenhof:circleimageview:2.1.0'
+ api 'com.github.zcweng:switch-button:0.0.3@aar'
+ api files('libs/AMap3DMap_4.1.3_AMapLocation_3.2.0_20161208.jar')
+}
diff --git a/src/Fall-Detection-master/app/libs/AMap3DMap_4.1.3_AMapLocation_3.2.0_20161208.jar b/src/Fall-Detection-master/app/libs/AMap3DMap_4.1.3_AMapLocation_3.2.0_20161208.jar
new file mode 100644
index 0000000..a038eb6
Binary files /dev/null and b/src/Fall-Detection-master/app/libs/AMap3DMap_4.1.3_AMapLocation_3.2.0_20161208.jar differ
diff --git a/src/Fall-Detection-master/app/proguard-rules.pro b/src/Fall-Detection-master/app/proguard-rules.pro
new file mode 100644
index 0000000..2d34300
--- /dev/null
+++ b/src/Fall-Detection-master/app/proguard-rules.pro
@@ -0,0 +1,16 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# You can edit the include path and order by changing the proguardFiles
+# directive in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# 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 *;
+#}
diff --git a/src/Fall-Detection-master/app/src/androidTest/java/com/example/cauc/falldetecion/ExampleInstrumentedTest.java b/src/Fall-Detection-master/app/src/androidTest/java/com/example/cauc/falldetecion/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..7884fc1
--- /dev/null
+++ b/src/Fall-Detection-master/app/src/androidTest/java/com/example/cauc/falldetecion/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.example.cauc.falldetecion;
+
+import android.content.Context;
+import android.support.test.InstrumentationRegistry;
+import android.support.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumentation test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() throws Exception {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getTargetContext();
+
+ assertEquals("com.example.wellxiang.falldetecion", appContext.getPackageName());
+ }
+}
diff --git a/src/Fall-Detection-master/app/src/main/AndroidManifest.xml b/src/Fall-Detection-master/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..20c3f68
--- /dev/null
+++ b/src/Fall-Detection-master/app/src/main/AndroidManifest.xml
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Fall-Detection-master/app/src/main/java/com/example/cauc/falldetecion/AlertDialogFragment.java b/src/Fall-Detection-master/app/src/main/java/com/example/cauc/falldetecion/AlertDialogFragment.java
new file mode 100644
index 0000000..7dcba8c
--- /dev/null
+++ b/src/Fall-Detection-master/app/src/main/java/com/example/cauc/falldetecion/AlertDialogFragment.java
@@ -0,0 +1,83 @@
+package com.example.cauc.falldetecion;
+
+import android.app.Dialog;
+import android.content.DialogInterface;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.support.annotation.NonNull;
+import android.support.v4.app.DialogFragment;
+import android.support.v7.app.AlertDialog;
+import android.util.Log;
+import android.view.WindowManager;
+import android.widget.TextView;
+
+import java.util.Timer;
+import java.util.TimerTask;
+
+
+public class AlertDialogFragment extends DialogFragment {
+ private TextView textView;
+ private AlertDialog.Builder builder;
+ private AlertDialog alertDialog;
+ private Timer timer;
+ private Handler handler;
+ @NonNull
+ @Override
+ public Dialog onCreateDialog(Bundle savedInstanceState) {
+ textView = new TextView(getContext());
+ builder = new AlertDialog.Builder(getActivity())
+ .setTitle("跌倒警报")
+ .setView(textView)
+ .setMessage("检测到跌倒发生,是否发出警报?")
+ .setIcon(R.drawable.ic_warning)
+ .setNegativeButton("取消", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ dismiss();
+ }
+ });
+ alertDialog = builder.create();
+ alertDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
+ alertDialog.setCanceledOnTouchOutside(false);
+ countDown();
+ handler = new Handler(){
+ @Override
+ public void handleMessage(Message msg) {
+ if(msg.what > 0){
+ Log.v("time", msg.what + "");
+ //动态显示倒计时
+ textView.setText(" " + msg.what + "秒后自动报警");
+ }else{
+ //倒计时结束自动关闭
+ if(alertDialog != null){
+ alertDialog.dismiss();
+ Log.d("Shawn","alertDialog.dismiss()");
+ }
+ timer.cancel();
+ Log.d("Shawn", "timer.cancel()");
+ }
+ }
+ };
+ return alertDialog;
+ }
+
+ private void countDown(){
+
+ Log.d("Shawn", "CountDown()");
+ timer = new Timer();
+ TimerTask timerTask = new TimerTask() {
+ int countTime = 8;
+ @Override
+ public void run() {
+ if (countTime > 0){
+ countTime --;
+ }
+ Message msg = handler.obtainMessage();
+ msg.what = countTime;
+ handler.sendMessage(msg);
+ }
+ };
+ timer.schedule(timerTask, 100, 1000);
+ }
+}
diff --git a/src/Fall-Detection-master/app/src/main/java/com/example/cauc/falldetecion/Fall.java b/src/Fall-Detection-master/app/src/main/java/com/example/cauc/falldetecion/Fall.java
new file mode 100644
index 0000000..86e1cb6
--- /dev/null
+++ b/src/Fall-Detection-master/app/src/main/java/com/example/cauc/falldetecion/Fall.java
@@ -0,0 +1,158 @@
+package com.example.cauc.falldetecion;
+
+
+import android.util.Log;
+
+
+public class Fall{
+
+ private float highThresholdValue;
+ private float lowThresholdValue;
+// private int SENSOR_RATE;
+ private boolean isFell;
+ public static float[] svmData;
+ public static float[] svmFilteringData;
+ public static int svmCount = 0;
+ public static final String TAG = "cauc";
+
+
+ public Fall(){
+ svmData = new float[150];
+ svmFilteringData = new float[150];
+ isFell = false;
+ }
+
+ /*
+ 设置阈值
+ */
+ public void setThresholdValue(float highThreshold, float lowThreshold){
+ this.highThresholdValue = highThreshold;
+ this.lowThresholdValue = lowThreshold;
+ Log.d(TAG, highThreshold + " " + lowThreshold);
+ }
+
+
+ /*
+ 设置传感器采样率
+ */
+// public void setSENSOR_RATE(int sensor_rate){
+// SENSOR_RATE = sensor_rate;
+// }
+ /*
+ 跌倒检测
+ */
+ public void fallDetection(){
+ Log.d(TAG, "Fall.fallDetection()");
+ new Thread(new Runnable() {
+ @Override
+ public void run() {
+ boolean running = true;
+ while(running){
+ //阈值法
+ for(int i = 0; i < svmFilteringData.length; i++){
+ if(svmFilteringData[i] <= lowThresholdValue){
+ if(i < svmFilteringData.length-10){
+ for (int j = i; j < i + 10; j++) {
+ if (svmFilteringData[j] >= highThresholdValue) {
+ running = false;
+ setFell(true);
+ }
+ }
+ }else {
+ for (int j = i; j < svmFilteringData.length; j++) {
+ if (svmFilteringData[j] >= highThresholdValue) {
+ running = false;
+ setFell(true);
+ }
+ }
+ for (int k = 0; k < (10-(svmFilteringData.length - i)); k++){
+ if (svmFilteringData[k] >= highThresholdValue) {
+ running = false;
+ setFell(true);
+ }
+ }
+ }
+ }
+ }
+
+ }
+ }
+ }).start();
+ }
+
+ /*
+ 3s内svm原始数据收集
+ */
+ public static void svmCollector(float svm){
+
+ if(svmCount < svmData.length){
+ svmData[svmCount] = svm;
+ }else{
+ svmCount = 0;
+ svmData[svmCount] = svm;
+ }
+ svmCount++;
+// Log.d(TAG, "Fall.svmCollector" + svmData[svmCount]);
+ }
+
+ /*
+ svm中值滤波
+ */
+ public static void setSvmFilteringData(){
+ //中值滤波取的三个值
+ float s1, s2, s3, temp;
+ //冒泡排序
+ for (int i = 0; i < svmFilteringData.length-1; i++){
+ if(i == 0){
+ s1 = svmData[i];
+ s2 = svmData[i + 1];
+ s3 = svmData[i + 2];
+ }else if(i < svmFilteringData.length-2){
+ s1 = svmData[i - 1];
+ s2 = svmData[i];
+ s3 = svmData[i + 1];
+ }else{
+ s1 = svmData[i - 1];
+ s2 = svmData[i];
+ s3 = svmData[0];
+ }
+ if(s1 > s2){
+ temp = s1;
+ s1 = s2;
+ s2 = temp;
+ }
+ if(s2 > s3){
+ temp = s2;
+ s2 = s3;
+ s3 = temp;
+ }
+ svmFilteringData[i] = s2;
+ Log.d(TAG, s1 + " " + s2 + " " + s3);
+// Log.d(TAG, "Fall.setSvmFilteringData" + svmFilteringData[i]);
+ }
+
+ }
+
+ public boolean isFell() {
+// Log.e(TAG, "isFELL" + isFell);
+ return isFell;
+
+ }
+
+ public void setFell(boolean fell) {
+ isFell = fell;
+// Log.e(TAG, "setFELL" + isFell);
+ }
+
+ public void cleanData(){
+ Log.d(TAG , "Fall.clean()");
+ for (int i = 0; i < svmData.length; i++){
+ svmData[i] = 0;
+ }
+ //中值滤波
+ for (int i = 0; i < svmFilteringData.length; i++){
+ svmFilteringData[i] = 0;
+ }
+ }
+}
+
diff --git a/src/Fall-Detection-master/app/src/main/java/com/example/cauc/falldetecion/FallDetectionService.java b/src/Fall-Detection-master/app/src/main/java/com/example/cauc/falldetecion/FallDetectionService.java
new file mode 100644
index 0000000..38f4041
--- /dev/null
+++ b/src/Fall-Detection-master/app/src/main/java/com/example/cauc/falldetecion/FallDetectionService.java
@@ -0,0 +1,213 @@
+package com.example.cauc.falldetecion;
+
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.app.Notification;
+import android.app.PendingIntent;
+import android.app.Service;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.graphics.BitmapFactory;
+import android.os.Handler;
+import android.os.IBinder;
+import android.os.Message;
+import android.support.v4.app.NotificationCompat;
+import android.support.v4.content.LocalBroadcastManager;
+import android.util.Log;
+import android.view.WindowManager;
+import android.widget.TextView;
+
+import java.util.Timer;
+import java.util.TimerTask;
+
+public class FallDetectionService extends Service {
+
+ private FallSensorManager fallSensorManager;
+ public Fall fall;
+ private final int FELL = 0;
+ private final int TIME = 1;
+ private boolean running = false;
+ private TextView countingView;
+ private Dialog dialog;
+ private Timer timer;
+ private final String TAG = "FallDetection";
+ private DetectThread detectThread;
+ private IntentFilter intentFilter;
+ private LocalBroadcastManager localBroadcastManager;
+ private FallLocalReceiver fallLocalReceiver;
+
+ public FallDetectionService() {
+ }
+
+ @Override
+ public IBinder onBind(Intent intent) {
+ // TODO: Return the communication channel to the service.
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ Log.d(TAG, "FallDetectionService.onCreate()");
+
+ fallSensorManager = new FallSensorManager(this);
+ fallSensorManager.initSensor();
+ fallSensorManager.registerSensor();
+ fall = new Fall();
+ fall.setThresholdValue(25,5);
+ running = true;
+ //在通知栏上显示服务运行
+ showInNotification();
+
+ localBroadcastManager = LocalBroadcastManager.getInstance(this);
+ intentFilter = new IntentFilter();
+ intentFilter.addAction("com.broadcast.FALL_LOCAL_BROADCAST");
+ fallLocalReceiver = new FallLocalReceiver();
+ localBroadcastManager.registerReceiver(fallLocalReceiver, intentFilter);
+ }
+
+
+
+ @Override
+ public int onStartCommand(Intent intent, int flags, int startId) {
+ Log.d(TAG, "FallDetectionService.onStartCommand");
+ detectThread = new DetectThread();
+ detectThread.start();
+ return super.onStartCommand(intent, flags, startId);
+ }
+
+ @Override
+ public void onDestroy() {
+ fallSensorManager.unregisterSensor();
+ localBroadcastManager.unregisterReceiver(fallLocalReceiver);
+ super.onDestroy();
+ }
+
+ //开一个线程用于检测跌倒
+ class DetectThread extends Thread{
+ @Override
+ public void run() {
+ fall.fallDetection();
+ Log.d(TAG, "DetectThread.start()");
+ while (running) {
+ if (fall.isFell()) {
+ Log.e(TAG, "跌倒了");
+ running = false;
+ Message msg = handler.obtainMessage();
+ msg.what = FELL;
+ handler.sendMessage(msg);
+ fall.setFell(false);
+ fall.cleanData();
+ stopSelf();
+
+ }
+ }
+ }
+ }
+
+ private Handler handler = new Handler(){
+ @Override
+ public void handleMessage(Message msg) {
+ switch(msg.what){
+ case FELL:
+ Log.e(TAG, "FELL");
+ //报警
+ showAlertDialog();
+ Intent intent = new Intent("com.broadcast.FALL_LOCAL_BROADCAST");
+ localBroadcastManager.sendBroadcast(intent);
+
+ break;
+
+ case TIME:
+ if(msg.arg1 > 0){
+ //动态显示倒计时
+ countingView.setText(" "
+ + msg.arg1 + "秒后自动报警");
+ }else{
+ //倒计时结束自动关闭
+ if(dialog != null){
+ dialog.dismiss();
+ }
+ timer.cancel();
+ }
+
+ break;
+ }
+
+ }
+ };
+
+ /*
+ 弹窗报警
+ */
+ private void showAlertDialog() {
+ countingView = new TextView(getApplicationContext());
+ AlertDialog.Builder builder = new AlertDialog.Builder(
+ getApplicationContext());
+ builder.setTitle("跌倒警报");
+ builder.setView(countingView);
+ builder.setMessage("检测到跌倒发生,是否发出警报?");
+ builder.setIcon(R.drawable.ic_warning);
+ builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ timer.cancel();
+ dialog.dismiss();
+ running = true;
+ Log.d(TAG, running + "");
+ detectThread.interrupt();
+ detectThread = null;
+ if(detectThread == null){
+ detectThread = new DetectThread();
+ detectThread.start();
+ }
+ }
+ });
+ dialog = builder.create();
+ dialog.setCanceledOnTouchOutside(false);
+ dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
+ countDown();
+ dialog.show();
+ Log.d(TAG, "dialog.create()");
+ }
+
+ /*
+ 倒计时
+ */
+ private void countDown() {
+ timer = new Timer();
+ TimerTask timerTask = new TimerTask() {
+ int countTime = 6;
+ @Override
+ public void run() {
+ if(countTime > 0){
+ countTime --;
+ }
+ Message msgTime = handler.obtainMessage();
+ msgTime.what = TIME;
+ msgTime.arg1 = countTime;
+ handler.sendMessage(msgTime);
+ }
+ };
+ timer.schedule(timerTask, 100, 1000);
+ }
+
+ /*
+ 在通知栏上显示服务运行
+ */
+ private void showInNotification() {
+ Intent intent = new Intent(this,MainActivity.class);
+ PendingIntent pi = PendingIntent.getActivity(this, 0, intent, 0);
+ Notification notification = new NotificationCompat.Builder(this)
+ .setContentTitle("老人跌到检测")
+ .setContentText("老人跌倒检测正在运行")
+ .setWhen(System.currentTimeMillis())
+ .setSmallIcon(R.drawable.ic_app)
+ .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.ic_app))
+ .setContentIntent(pi)
+ .build();
+ startForeground(1,notification);
+ }
+
+}
diff --git a/src/Fall-Detection-master/app/src/main/java/com/example/cauc/falldetecion/FallLocalReceiver.java b/src/Fall-Detection-master/app/src/main/java/com/example/cauc/falldetecion/FallLocalReceiver.java
new file mode 100644
index 0000000..816a5e7
--- /dev/null
+++ b/src/Fall-Detection-master/app/src/main/java/com/example/cauc/falldetecion/FallLocalReceiver.java
@@ -0,0 +1,329 @@
+package com.example.cauc.falldetecion;
+
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.location.Address;
+import android.location.Geocoder;
+import android.location.Location;
+import android.media.MediaPlayer;
+import android.net.Uri;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.os.Vibrator;
+import android.preference.PreferenceManager;
+import android.support.v7.app.AppCompatActivity;
+import android.telephony.SmsManager;
+import android.util.Log;
+import android.view.WindowManager;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import android.Manifest;
+import android.content.pm.PackageManager;
+import android.location.Address;
+import android.location.Geocoder;
+import android.location.Location;
+import android.location.LocationListener;
+import android.location.LocationManager;
+import android.os.Bundle;
+import android.speech.tts.TextToSpeech;
+import android.support.annotation.NonNull;
+import android.support.design.widget.NavigationView;
+import android.support.v4.app.ActivityCompat;
+import android.support.v7.app.ActionBar;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.Toolbar;
+import android.util.Log;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.CompoundButton;
+import android.widget.TextView;
+import android.widget.Toast;
+import android.widget.ToggleButton;
+
+import com.amap.api.location.AMapLocation;
+import com.amap.api.location.AMapLocationClient;
+import com.amap.api.location.AMapLocationClientOption;
+import com.amap.api.location.AMapLocationListener;
+
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+import java.util.Timer;
+import java.util.TimerTask;
+import android.speech.tts.TextToSpeech;
+import android.speech.tts.TextToSpeech.OnInitListener;
+public class FallLocalReceiver extends BroadcastReceiver implements AMapLocationListener,LocationListener {
+
+ private TextView countingView;
+ private Dialog dialog;
+ private Timer timer;
+ private SharedPreferences sharedPreferences;
+ private Vibrator vibrator;
+ private boolean isVibrate;
+ private MediaPlayer mediaPlayer;
+
+ private AMapLocationClient locationClient;
+ private AMapLocationClientOption locationClientOption;
+ public String locationAddress;
+ public String locationTime;
+ private Context context;
+ private final String TAG = "FallDetection";
+
+
+ public FallLocalReceiver() {
+ }
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ Log.d(TAG, "FallLocalReceiver.onReceive()");
+ this.context = context;
+ showAlertDialog();
+
+ sharedPreferences = PreferenceManager
+ .getDefaultSharedPreferences(context);
+ isVibrate = sharedPreferences.getBoolean("pre_key_vibrate", true);
+ if(isVibrate){
+ startVibrate();
+ }
+ startAlarm();
+ startLocation();
+
+
+ }
+
+
+ /*
+ 弹窗报警
+ */
+ private void showAlertDialog() {
+ countingView = new TextView(context);
+ AlertDialog.Builder builder = new AlertDialog.Builder(
+ context.getApplicationContext());
+ builder.setTitle("跌倒警报");
+ builder.setView(countingView);
+ builder.setMessage("检测到跌倒发生,是否发出警报?");
+ builder.setIcon(R.drawable.ic_warning);
+ builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ timer.cancel();
+ dialog.dismiss();
+ if(isVibrate){
+ stopVibrate();
+ }
+ stopAlarm();
+ Intent startIntent = new Intent(context, FallDetectionService.class);
+ context.startService(startIntent);
+ }
+ });
+ dialog = builder.create();
+ dialog.setCanceledOnTouchOutside(false);
+ dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
+ countDown();
+ dialog.show();
+ Log.d(TAG, "dialog.create()");
+ }
+
+ /*
+ 倒计时
+ */
+ private void countDown() {
+ timer = new Timer();
+ TimerTask timerTask = new TimerTask() {
+ int countTime = 10;
+ @Override
+ public void run() {
+ if(countTime > 0){
+ countTime --;
+ }
+ Message msgTime = handler.obtainMessage();
+ msgTime.arg1 = countTime;
+ handler.sendMessage(msgTime);
+ }
+ };
+ timer.schedule(timerTask, 50, 1000);
+ }
+ public Handler handler = new Handler(){
+ @Override
+ public void handleMessage(Message msg) {
+ super.handleMessage(msg);
+ if(msg.arg1 > 0){
+ //动态显示倒计时
+ countingView.setText(" "
+ + msg.arg1 + "秒后自动报警");
+ }else{
+ //倒计时结束自动关闭
+ if(dialog != null){
+ dialog.dismiss();
+ if(isVibrate){
+ stopVibrate();
+ }
+ stopAlarm();
+ sendSMS(locationAddress, locationTime);
+ }
+ timer.cancel();
+ }
+ }
+ };
+
+ /*
+ 开始震动
+ */
+ private void startVibrate(){
+ vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
+ long[] pattern = {100, 500, 100, 500};
+ vibrator.vibrate(pattern, 2);
+ }
+ /*
+ 停止震动
+ */
+ private void stopVibrate(){
+ vibrator.cancel();
+ }
+
+ /*
+ 开始播放铃声
+ */
+ private void startAlarm(){
+ String ringtone = sharedPreferences.getString("pre_key_alarm" , null);
+ Log.d(TAG, ringtone + "");
+ Uri ringtoneUri = Uri.parse(ringtone);
+
+ mediaPlayer = MediaPlayer.create(context, ringtoneUri);
+ mediaPlayer.setLooping(true);//设置循环
+ mediaPlayer.start();
+ }
+ /*
+ 停止播放铃声
+ */
+ private void stopAlarm(){
+ mediaPlayer.stop();
+ }
+ private void sendSMS(String address, String time){
+ //获取短信管理器
+ SmsManager smsManager = SmsManager.getDefault();
+ String name = sharedPreferences.getString("pre_key_name", null);
+ String phoneNum = sharedPreferences.getString("pre_key_phone", null);
+ String smsContent = time + name + "在"+address + "发生跌倒了!";
+ smsManager.sendTextMessage(phoneNum, null, smsContent ,null, null);
+ Toast.makeText(context, "短信已经发出", Toast.LENGTH_SHORT).show();
+ }
+
+ public class YourActivity extends AppCompatActivity implements OnInitListener {
+ private TextToSpeech textToSpeech;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ textToSpeech = new TextToSpeech(this, this);
+ }
+
+ @Override
+ public void onInit(int status) {
+ if (status == TextToSpeech.SUCCESS) {
+ // TTS引擎初始化成功,可以设置相关配置
+ int result = textToSpeech.setLanguage(Locale.CHINESE); // 设置语言为中文
+
+ if (result == TextToSpeech.LANG_MISSING_DATA || result == TextToSpeech.LANG_NOT_SUPPORTED) {
+ // 如果语言不支持或数据缺失,可以处理异常情况
+ }
+ } else {
+ // TTS引擎初始化失败,可以处理异常情况
+ }
+ }
+ }
+ private void startLocation(){
+ Log.d(TAG, "FallLocalReceiver.startLocation()");
+ locationClient = new AMapLocationClient(context);
+ //初始化定位参数
+ locationClientOption = new AMapLocationClientOption();
+ //设置定位模式为AMapLocationMode.Hight_Accuracy,高精度模式。
+ locationClientOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
+ //获取最近3s内精度最高的一次定位结果:
+ //设置setOnceLocationLatest(boolean b)接口为true,启动定位时SDK会返回最近3s内精度最高的一次定位结果。如果设置其为true,setOnceLocation(boolean b)接口也会被设置为true,反之不会,默认为false。
+ locationClientOption.setOnceLocationLatest(true);
+
+ //设置定位监听
+ locationClient.setLocationListener(this);
+ //启动定位
+ locationClient.startLocation();
+ }
+
+ public void onLocationChanged(Location location) {
+ // 当位置发生变化时,更新界面上的位置信息
+ double latitude = location.getLatitude();
+ double longitude = location.getLongitude();
+ // TODO: 在界面上显示位置信息
+ locationAddress = getFormattedAddress(latitude, longitude); // 获取格式化的位置地址
+ }
+
+ @Override
+ public void onStatusChanged(String s, int i, Bundle bundle) {
+ }
+
+ @Override
+ public void onProviderEnabled(String s) {
+ }
+
+ @Override
+ public void onProviderDisabled(String s) {
+ }
+
+
+ @Override
+ public void onLocationChanged(AMapLocation amapLocation) {
+ if (amapLocation != null) {
+ if (amapLocation.getErrorCode() == 0) {
+ //定位成功回调信息,设置相关消息
+ //locationAddress = amapLocation.getAddress();
+ SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ Date date = new Date(amapLocation.getTime());
+ locationTime = df.format(date);//定位时间
+ } else {
+ //显示错误信息ErrCode是错误码,errInfo是错误信息,详见错误码表。
+ Log.e("AmapError","location Error, ErrCode:"
+ + amapLocation.getErrorCode() + ", errInfo:"
+ + amapLocation.getErrorInfo());
+ }
+ }
+ }
+
+ private String getFormattedAddress(double latitude, double longitude) {
+ Geocoder geocoder = new Geocoder(context, Locale.getDefault());
+ List
addresses;
+ String address = "";
+
+ try {
+ addresses = geocoder.getFromLocation(latitude, longitude, 1);
+ if (addresses != null && addresses.size() > 0) {
+ Address returnedAddress = addresses.get(0);
+ StringBuilder sb = new StringBuilder();
+
+ for (int i = 0; i <= returnedAddress.getMaxAddressLineIndex(); i++) {
+ sb.append(returnedAddress.getAddressLine(i)).append("\n");
+ }
+
+ address = sb.toString();
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ // 处理异常情况
+ }
+
+ return address;
+ }
+
+
+}
diff --git a/src/Fall-Detection-master/app/src/main/java/com/example/cauc/falldetecion/FallSensorManager.java b/src/Fall-Detection-master/app/src/main/java/com/example/cauc/falldetecion/FallSensorManager.java
new file mode 100644
index 0000000..27530be
--- /dev/null
+++ b/src/Fall-Detection-master/app/src/main/java/com/example/cauc/falldetecion/FallSensorManager.java
@@ -0,0 +1,74 @@
+package com.example.cauc.falldetecion;
+
+import android.content.Context;
+import android.hardware.Sensor;
+import android.hardware.SensorEvent;
+import android.hardware.SensorEventListener;
+import android.hardware.SensorManager;
+import android.util.Log;
+
+import static android.content.Context.SENSOR_SERVICE;
+
+
+public class FallSensorManager {
+ private SensorManager sensorManager;
+ private Sensor accelerometer;
+ private Context context;
+ private float accX, accY, accZ;
+ private float svm;
+ public Fall fall;
+ private final String TAG = "FallDetection";
+
+ public FallSensorManager(Context context){
+ this.context = context;
+ fall = new Fall();
+ }
+ /*
+ 加载传感器
+ */
+ public void initSensor(){
+ //获取SensorManager,系统的传感器管理服务
+ sensorManager = (SensorManager) context.getSystemService(SENSOR_SERVICE);
+ //获取accelerometer加速度传感器
+ accelerometer = sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
+ Log.d(TAG, "FallSensorManager.initSensor()");
+ }
+
+ /*
+ 注册传感器
+ */
+ public void registerSensor(){
+ sensorManager.registerListener(sensorEventListener,
+ accelerometer, SensorManager.SENSOR_DELAY_GAME);
+ Log.d(TAG, "FallSensorManager.registerSensor()");
+ }
+ /*
+ 取消注册传感器
+ */
+ public void unregisterSensor(){
+ sensorManager.unregisterListener(sensorEventListener);
+ Log.d(TAG, "FallSensorManager.unregisterSensor");
+ }
+
+ public SensorEventListener sensorEventListener = new SensorEventListener() {
+ @Override
+ public void onSensorChanged(SensorEvent event) {
+ switch (event.sensor.getType()) {
+ case Sensor.TYPE_ACCELEROMETER:
+ accX = event.values[0];
+ accY = event.values[1];
+ accZ = event.values[2];
+ svm = (float) Math.sqrt(accX * accX + accY * accY + accZ * accZ);
+// Log.d(TAG,accX + " " + accY + " " + accZ );
+ Fall.svmCollector(svm);
+ Fall.setSvmFilteringData();
+ break;
+ }
+ }
+ @Override
+ public void onAccuracyChanged(Sensor sensor, int accuracy) {
+
+ }
+ };
+
+}
diff --git a/src/Fall-Detection-master/app/src/main/java/com/example/cauc/falldetecion/HomeFragment.java b/src/Fall-Detection-master/app/src/main/java/com/example/cauc/falldetecion/HomeFragment.java
new file mode 100644
index 0000000..04df951
--- /dev/null
+++ b/src/Fall-Detection-master/app/src/main/java/com/example/cauc/falldetecion/HomeFragment.java
@@ -0,0 +1,36 @@
+package com.example.cauc.falldetecion;
+
+import android.app.Fragment;
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import com.suke.widget.SwitchButton;
+
+public class HomeFragment extends Fragment {
+
+ private SwitchButton switchButton;
+
+ @Nullable
+ @Override
+ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ View view = inflater.inflate(R.layout.fragment_home,null);
+ switchButton = (SwitchButton) view.findViewById(R.id.switchButton);
+ switchButton.setOnCheckedChangeListener(new SwitchButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(SwitchButton view, boolean isChecked) {
+ if(view.isChecked()){
+ Intent startIntent = new Intent(getContext(), FallDetectionService.class);
+ getContext().startService(startIntent);
+ }else{
+ Intent stopIntent = new Intent(getContext(), FallDetectionService.class);
+ getContext().stopService(stopIntent);
+ }
+ }
+ });
+ return view;
+ }
+
+}
diff --git a/src/Fall-Detection-master/app/src/main/java/com/example/cauc/falldetecion/MainActivity.java b/src/Fall-Detection-master/app/src/main/java/com/example/cauc/falldetecion/MainActivity.java
new file mode 100644
index 0000000..f6ba210
--- /dev/null
+++ b/src/Fall-Detection-master/app/src/main/java/com/example/cauc/falldetecion/MainActivity.java
@@ -0,0 +1,215 @@
+package com.example.cauc.falldetecion;
+
+import android.app.FragmentTransaction;
+import android.content.Intent;
+import android.support.annotation.Nullable;
+import android.support.design.widget.NavigationView;
+import android.support.v4.view.GravityCompat;
+import android.support.v4.widget.DrawerLayout;
+import android.support.v7.app.ActionBar;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.support.v7.widget.Toolbar;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.os.Bundle;
+import android.speech.tts.TextToSpeech;
+import android.speech.tts.TextToSpeech.OnInitListener;
+import android.widget.Toast;
+
+import java.util.Locale;
+
+public class MainActivity extends AppCompatActivity implements TextToSpeech.OnInitListener {
+
+ private DrawerLayout mDrawerLayout;
+ private NavigationView mNavigationView;
+ private Toolbar mToolbar;
+// private ActionBarDrawerToggle mDrawerToggle;
+ private HomeFragment homeFragment;
+ private SettingsFragment settingsFragment;
+ private TextToSpeech textToSpeech;
+ private final int HOME = 1;
+ private final int SETTINGS = 2;
+ private final int ABOUT = 3;
+
+
+
+
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ textToSpeech = new TextToSpeech(this, this);
+ mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
+
+// mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, mToolbar, R.string.drawer_open,
+// R.string.drawer_close);
+// mDrawerToggle.syncState();
+// mDrawerLayout.addDrawerListener(mDrawerToggle);
+ mNavigationView = (NavigationView) findViewById(R.id.navigation_view);
+
+ mToolbar = (Toolbar) findViewById(R.id.toolbar);
+ //为activity窗口设置活动栏
+ setSupportActionBar(mToolbar);
+
+ final ActionBar actionBar = getSupportActionBar();
+ //设置导航图标
+ actionBar.setHomeAsUpIndicator(R.drawable.ic_menu);
+ actionBar.setDisplayHomeAsUpEnabled(true);
+
+ mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
+
+ mNavigationView = (NavigationView) findViewById(R.id.navigation_view);
+ if (mNavigationView != null) {
+ setupDrawerContent(mNavigationView);
+ }
+
+// switchToHome();
+ showFragment(HOME);
+
+ }
+
+ private void setupDrawerContent(NavigationView navigationView) {
+ //监听navigationView的项目选择
+ navigationView.setNavigationItemSelectedListener(
+ new NavigationView.OnNavigationItemSelectedListener() {
+ @Override
+ public boolean onNavigationItemSelected(MenuItem item) {
+ switch (item.getItemId()){
+ case R.id.navigation_item_home:
+// switchToHome();
+ showFragment(HOME);
+ mToolbar.setTitle(R.string.app_name);
+ break;
+ case R.id.navigation_item_place:
+ switchToPlace();
+ break;
+ case R.id.navigation_item_settings:
+// switchToSettings();
+ showFragment(SETTINGS);
+ mToolbar.setTitle(R.string.navigation_settings);
+ break;
+
+
+ }
+ item.setChecked(true);
+ mDrawerLayout.closeDrawers();
+ return true;
+ }
+ });
+ }
+
+// private void switchToHome() {
+// getSupportFragmentManager().beginTransaction().replace(R.id.frame_content, new HomeFragment()).commit();
+// mToolbar.setTitle(R.string.app_name);
+// }
+//
+ private void switchToPlace() {
+// getSupportFragmentManager().beginTransaction().replace(R.id.frame_content, new PlaceFragment()).commit();
+// mToolbar.setTitle(R.string.navigation_place);
+ mToolbar.setTitle(R.string.app_name);
+ startActivity(new Intent(this, MapActivity.class));
+
+ }
+//
+// private void switchToSettings() {
+// getSupportFragmentManager().beginTransaction().replace(R.id.frame_content, new SettingsFragment()).commit();
+// mToolbar.setTitle(R.string.navigation_settings);
+// }
+//
+// private void switchToAbout() {
+// getSupportFragmentManager().beginTransaction().replace(R.id.frame_content, new AboutFragment()).commit();
+// mToolbar.setTitle(R.string.navigation_about);
+//
+// }
+
+ public void showFragment(int index){
+ FragmentTransaction ft = getFragmentManager().beginTransaction();
+ //想要显示一个fragment,先隐藏所有fragment,防止重叠
+ hideFragment(ft);
+
+ switch (index){
+ case HOME:
+ if(homeFragment != null){
+ ft.show(homeFragment);
+ }else{
+ homeFragment = new HomeFragment();
+ ft.add(R.id.frame_content, homeFragment);
+ }
+ break;
+ case SETTINGS:
+ if(settingsFragment != null){
+ ft.show(settingsFragment);
+ }else{
+ settingsFragment = new SettingsFragment();
+ ft.add(R.id.frame_content, settingsFragment);
+ }
+ break;
+ }
+ ft.commit();
+ }
+ /*
+ 当fragment已被实例化,就隐藏起来
+ */
+ public void hideFragment(FragmentTransaction ft){
+ if(homeFragment != null){
+ ft.hide(homeFragment);
+ }
+ if(settingsFragment != null){
+ ft.hide(settingsFragment);
+ }
+
+
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu)
+ {
+ // Inflate the menu; this adds items to the action bar if it is present.
+ getMenuInflater().inflate(R.menu.menu_main, menu);
+ return true;
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item)
+ {
+ if(item.getItemId() == android.R.id.home)
+ {
+ mDrawerLayout.openDrawer(GravityCompat.START);
+ return true ;
+ }
+ if(item.getItemId() == R.id.id_menu_settings){
+ showFragment(SETTINGS);
+ }
+ return super.onOptionsItemSelected(item);
+ }
+
+
+ @Override
+ public void onInit(int status) {
+ if (status == TextToSpeech.SUCCESS) {
+ int result = textToSpeech.setLanguage(Locale.CHINESE);
+
+ if (result == TextToSpeech.LANG_MISSING_DATA || result == TextToSpeech.LANG_NOT_SUPPORTED) {
+ Toast.makeText(this, "TTS语音引擎不支持或缺少中文语音数据", Toast.LENGTH_LONG).show();
+ } else {
+ String welcomeMessage = "欢迎使用老人跌倒监测系统。";
+ textToSpeech.speak(welcomeMessage, TextToSpeech.QUEUE_FLUSH, null, null);
+ }
+ } else {
+ Toast.makeText(this, "TTS引擎初始化失败", Toast.LENGTH_LONG).show();
+ }
+ }
+
+ @Override
+ protected void onDestroy() {
+ if (textToSpeech != null) {
+ textToSpeech.stop();
+ textToSpeech.shutdown();
+ }
+ super.onDestroy();
+ }
+
+
+}
diff --git a/src/Fall-Detection-master/app/src/main/java/com/example/cauc/falldetecion/MapActivity.java b/src/Fall-Detection-master/app/src/main/java/com/example/cauc/falldetecion/MapActivity.java
new file mode 100644
index 0000000..4b3419c
--- /dev/null
+++ b/src/Fall-Detection-master/app/src/main/java/com/example/cauc/falldetecion/MapActivity.java
@@ -0,0 +1,384 @@
+package com.example.cauc.falldetecion;
+
+import android.Manifest;
+import android.content.pm.PackageManager;
+import android.location.Address;
+import android.location.Geocoder;
+import android.location.Location;
+import android.location.LocationListener;
+import android.location.LocationManager;
+import android.os.Bundle;
+import android.speech.tts.TextToSpeech;
+import android.support.annotation.NonNull;
+import android.support.design.widget.NavigationView;
+import android.support.v4.app.ActivityCompat;
+import android.support.v7.app.ActionBar;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.Toolbar;
+import android.util.Log;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.CompoundButton;
+import android.widget.TextView;
+import android.widget.Toast;
+import android.widget.ToggleButton;
+
+import com.amap.api.location.AMapLocation;
+import com.amap.api.location.AMapLocationClient;
+import com.amap.api.location.AMapLocationClientOption;
+import com.amap.api.location.AMapLocationListener;
+import com.amap.api.maps.AMap;
+import com.amap.api.maps.CameraUpdateFactory;
+import com.amap.api.maps.LocationSource;
+import com.amap.api.maps.MapView;
+import com.amap.api.maps.UiSettings;
+
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+
+
+public class MapActivity extends AppCompatActivity implements LocationSource, AMapLocationListener, TextToSpeech.OnInitListener, LocationListener {
+ private MapView mMapView;
+ private AMap aMap;
+ private LocationSource.OnLocationChangedListener mListener;
+ private AMapLocationClient mLocationClient;
+ private AMapLocationClientOption mLocationOption;
+ private UiSettings mUiSettings;
+ private static final int LOCATION_PERMISSION_REQUEST_CODE = 1;
+
+ private LocationManager locationManager;
+ private TextToSpeech textToSpeech;
+ private String locationAddress;
+ private ToggleButton tb;
+ private TextView textView;
+ private NavigationView mNavigationView;
+ private Toolbar mToolbar;
+ public String nowaddress;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ textToSpeech = new TextToSpeech(this, this);
+ setContentView(R.layout.map_activity);
+
+ textView = (TextView) findViewById(R.id.address);
+
+ mNavigationView = (NavigationView) findViewById(R.id.navigation_view);
+ mToolbar = (Toolbar) findViewById(R.id.toolbar);
+ mToolbar.setTitle(R.string.navigation_place);
+ //为activity窗口设置活动栏
+ setSupportActionBar(mToolbar);
+ final ActionBar actionBar = getSupportActionBar();
+ //设置返回图标
+ actionBar.setHomeAsUpIndicator(0);
+ actionBar.setDisplayHomeAsUpEnabled(true);
+ mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ onBackPressed();
+ }
+ });
+ // 检查定位权限
+ if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)
+ != PackageManager.PERMISSION_GRANTED) {
+ // 申请定位权限
+ ActivityCompat.requestPermissions(this,
+ new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
+ LOCATION_PERMISSION_REQUEST_CODE);
+ } else {
+ // 获取LocationManager实例
+ locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
+ // 获取TextToSpeech实例并设置初始化监听器
+ textToSpeech = new TextToSpeech(this, this);
+ // 开始监听位置变化
+ startLocationUpdates();
+ }
+
+
+ //获取地图控件引用
+ mMapView = (MapView) findViewById(R.id.map);
+ //在activity执行onCreate时执行mMapView.onCreate(savedInstanceState),创建地图
+ //实现地图生命周期管理
+ mMapView.onCreate(savedInstanceState);
+
+ //初始化AMap对象
+ aMap = mMapView.getMap();
+
+ // 设置定位监听,如果不设置此定位资源则定位按钮不可点击
+ aMap.setLocationSource(this);
+ // 设置为true表示显示定位层并可触发定位,false表示隐藏定位层并不可触发定位,默认是false
+ aMap.setMyLocationEnabled(true);
+
+ // 设置定位的类型为定位模式,有定位、跟随或地图根据面向方向旋转几种
+ aMap.setMyLocationType(AMap.LOCATION_TYPE_LOCATE);
+
+ //实例化UiSettings类
+ mUiSettings = aMap.getUiSettings();
+ //显示指南针
+ mUiSettings.setCompassEnabled(true);
+ // 显示默认的定位按钮
+ mUiSettings.setMyLocationButtonEnabled(true);
+ //显示比例尺控件
+ mUiSettings.setScaleControlsEnabled(true);
+
+
+ tb = (ToggleButton) findViewById(R.id.tb);
+ tb.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+ if (isChecked) {
+ //设置使用卫星地图
+ aMap.setMapType(AMap.MAP_TYPE_SATELLITE);
+ } else {
+ //设置使用普通地图
+ aMap.setMapType(AMap.MAP_TYPE_NORMAL);
+ }
+ }
+ });
+
+ }
+
+ private void startLocationUpdates() {
+ // 设置最小时间间隔和最小距离,这里设置为1000毫秒和1米
+ // 这样当位置发生变化时,会在接下来的1000毫秒内获取位置信息
+ if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
+ // TODO: Consider calling
+ // ActivityCompat#requestPermissions
+ // here to request the missing permissions, and then overriding
+ // public void onRequestPermissionsResult(int requestCode, String[] permissions,
+ // int[] grantResults)
+ // to handle the case where the user grants the permission. See the documentation
+ // for ActivityCompat#requestPermissions for more details.
+ return;
+ }
+ locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,
+ 10000, 10, this);
+ }
+ @Override
+ public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
+ @NonNull int[] grantResults) {
+ super.onRequestPermissionsResult(requestCode, permissions, grantResults);
+ if (requestCode == LOCATION_PERMISSION_REQUEST_CODE) {
+ // 检查定位权限授权结果
+ if (grantResults.length > 0 &&
+ grantResults[0] == PackageManager.PERMISSION_GRANTED) {
+ // 获取LocationManager实例
+ locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
+ // 开始监听位置变化
+ startLocationUpdates();
+ } else {
+ // 处理没有授权的情况
+ }
+ }
+ }
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ // Inflate the menu; this adds items to the action bar if it is present.
+ getMenuInflater().inflate(R.menu.menu_main, menu);
+ return true;
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ return super.onOptionsItemSelected(item);
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+ //在activity执行onResume时执行mMapView.onResume(),重新绘制加载地图
+ //实现地图生命周期管理
+ mMapView.onResume();
+
+ }
+
+ @Override
+ protected void onPause() {
+ super.onPause();
+ //在activity执行onPause时执行mMapView.onPause(),暂停地图的绘制
+ //实现地图生命周期管理
+ mMapView.onPause();
+ }
+ public void onLocationChanged(Location location) {
+ // 当位置发生变化时,更新界面上的位置信息
+ double latitude = location.getLatitude();
+ double longitude = location.getLongitude();
+ // TODO: 在界面上显示位置信息
+ locationAddress = getFormattedAddress(latitude, longitude); // 获取格式化的位置地址
+ //textView.setText(latitude+"\n"+longitude+locationAddress);
+ speakLocationInformation(); // 开始语音播报位置信息
+ }
+
+ private String getFormattedAddress(double latitude, double longitude) {
+ Geocoder geocoder = new Geocoder(this, Locale.getDefault());
+ List addresses;
+ String address = "";
+
+ try {
+ addresses = geocoder.getFromLocation(latitude, longitude, 1);
+ if (addresses != null && addresses.size() > 0) {
+ Address returnedAddress = addresses.get(0);
+ StringBuilder sb = new StringBuilder();
+
+ for (int i = 0; i <= returnedAddress.getMaxAddressLineIndex(); i++) {
+ sb.append(returnedAddress.getAddressLine(i)).append("\n");
+ }
+
+ address = sb.toString();
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ // 处理异常情况
+ }
+
+ return address;
+ }
+
+ private void speakLocationInformation() {
+ if (textToSpeech != null && textToSpeech.isSpeaking()) {
+ textToSpeech.stop();
+ }
+ if (textToSpeech != null) {
+ textToSpeech.speak("您现在位于" + locationAddress, TextToSpeech.QUEUE_FLUSH, null, null);
+ }
+ }
+
+ @Override
+ public void onStatusChanged(String provider, int status, Bundle extras) {
+ // 当位置提供者状态变化时,处理逻辑
+ }
+
+ @Override
+ public void onProviderEnabled(String provider) {
+ // 当位置提供者启用时,处理逻辑
+ }
+
+ @Override
+ public void onProviderDisabled(String provider) {
+ // 当位置提供者禁用时,处理逻辑
+ }
+
+ @Override
+ public void onInit(int status) {
+ if (status == TextToSpeech.SUCCESS) {
+ int result = textToSpeech.setLanguage(Locale.CHINESE);
+
+ if (result == TextToSpeech.LANG_MISSING_DATA || result == TextToSpeech.LANG_NOT_SUPPORTED) {
+ //Toast.makeText(this, "TTS语音引擎不支持或缺少中文语音数据", Toast.LENGTH_LONG).show();
+ } else {
+ speakLocationInformation(); // 当初始化成功后直接开始语音播报位置信息
+ }
+ } else {
+ Toast.makeText(this, "TTS引擎初始化失败", Toast.LENGTH_LONG).show();
+ }
+ }
+
+ @Override
+ protected void onDestroy() {
+ super.onDestroy();
+ // 停止位置监听
+ locationManager.removeUpdates(this);
+ // 释放TextToSpeech资源
+ if (textToSpeech != null) {
+ textToSpeech.stop();
+ textToSpeech.shutdown();
+ }
+ }
+
+ @Override
+ protected void onSaveInstanceState(Bundle outState) {
+ super.onSaveInstanceState(outState);
+ //在activity执行onSaveInstanceState时执行mMapView.onSaveInstanceState(outState),保存地图当前的状态
+ //实现地图生命周期管理
+ mMapView.onSaveInstanceState(outState);
+ }
+
+
+ /**
+ * 激活定位
+ */
+ @Override
+ public void activate(OnLocationChangedListener onLocationChangedListener) {
+ mListener = onLocationChangedListener;
+ if (mLocationClient == null) {
+ //初始化定位
+ mLocationClient = new AMapLocationClient(this);
+ //初始化定位参数
+ mLocationOption = new AMapLocationClientOption();
+ //设置定位回调监听
+ mLocationClient.setLocationListener(this);
+ //设置为高精度定位模式
+ mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
+ //设置定位参数
+ mLocationClient.setLocationOption(mLocationOption);
+ // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
+ // 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
+ // 在定位结束后,在合适的生命周期调用onDestroy()方法
+ // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
+ mLocationClient.startLocation();//启动定位
+ }
+ }
+
+ /**
+ * 停止定位
+ */
+ @Override
+ public void deactivate() {
+ mListener = null;
+ if (mLocationClient != null) {
+ mLocationClient.stopLocation();
+ mLocationClient.onDestroy();
+ }
+ mLocationClient = null;
+ }
+
+ @Override
+ public void onLocationChanged(AMapLocation aMapLocation) {
+
+ if (mListener != null && aMapLocation != null) {
+ if (aMapLocation != null
+ && aMapLocation.getErrorCode() == 0) {
+ mListener.onLocationChanged(aMapLocation);// 显示系统小蓝点
+ aMap.moveCamera(CameraUpdateFactory.zoomTo(16));//将地图的缩放级别调整到17级
+
+ //定位成功回调信息,设置相关消息
+ SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ Date date = new Date(aMapLocation.getTime());
+ String time = df.format(date);//定位时
+
+
+ StringBuffer address = new StringBuffer();
+ /*address.append(aMapLocation.getCountry()
+ + aMapLocation.getProvince()
+ + aMapLocation.getCity()
+ + aMapLocation.getDistrict()
+ + aMapLocation.getStreet()
+ + aMapLocation.getStreetNum());*/
+ address.append("纬度: "+ aMapLocation.getLatitude() + "\n");
+ address.append("经度: "+ aMapLocation.getLongitude() + "\n");
+ //如果option中设置isNeedAddress为false,则没有此结果,网络定位结果中会有地址信息,GPS定位不返回地址信息。
+ //address.append("地址: "+ aMapLocation.getAddress() + "\n");
+ //address.append("当前定位点的AOI信息: "+ aMapLocation.getAoiName() + "\n");
+ //address.append("当前室内定位的建筑物Id: "+ aMapLocation.getBuildingId() + "\n");
+ //address.append("当前室内定位的楼层: "+ aMapLocation.getFloor() + "\n");
+ Log.v("older", "address:" + time + address.toString());
+ textView.setText(time + "\n" + locationAddress+address.toString());
+ //39.11083224826389
+ // 经度: 117.35290635850694
+
+
+ } else {
+ String errText = "定位失败," + aMapLocation.getErrorCode()+ ": " + aMapLocation.getErrorInfo();
+ Log.e("AmapErr",errText);
+ }
+ }
+ }
+
+
+
+}
+
diff --git a/src/Fall-Detection-master/app/src/main/java/com/example/cauc/falldetecion/SettingsFragment.java b/src/Fall-Detection-master/app/src/main/java/com/example/cauc/falldetecion/SettingsFragment.java
new file mode 100644
index 0000000..beef8be
--- /dev/null
+++ b/src/Fall-Detection-master/app/src/main/java/com/example/cauc/falldetecion/SettingsFragment.java
@@ -0,0 +1,74 @@
+package com.example.cauc.falldetecion;
+
+
+import android.content.SharedPreferences;
+import android.os.Bundle;
+import android.preference.Preference;
+import android.preference.PreferenceFragment;
+import android.util.Log;
+
+
+public class SettingsFragment extends PreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener{
+ public static final String KEY_NAME = "pre_key_name";
+ public static final String KEY_SEX = "pre_key_sex";
+ public static final String KEY_AGE = "pre_key_age";
+ public static final String KEY_ALERT = "pre_key_alert";
+ public static final String KEY_VIBRATE = "pre_key_vibrate";
+ public static final String KEY_PHONE = "pre_key_phone";
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ addPreferencesFromResource(R.xml.preferences);
+
+ }
+
+ @Override
+ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
+ Log.d("FallDetection", "SettingsFragment.onsharedPreferenceChanged");
+// System.out.print("key是: " + key);
+ Log.d("FallDetection", key);
+// if(key.equals(KEY_AGE)){
+// Preference agePre = findPreference(key);
+// agePre.setSummary(sharedPreferences.getString(key, "请输入年龄"));
+// }
+ switch (key){
+ case KEY_NAME:
+ Preference namePre = findPreference(key);
+ namePre.setSummary(sharedPreferences.getString(key, ""));
+ break;
+ case KEY_SEX:
+ Preference sexPre = findPreference(key);
+ sexPre.setSummary(sharedPreferences.getString(key, ""));
+ break;
+ case KEY_AGE:
+ Preference agePre = findPreference(key);
+ agePre.setSummary(sharedPreferences.getString(key, ""));
+ break;
+ case KEY_ALERT:
+ Preference alertPre = findPreference(key);
+ alertPre.setSummary(sharedPreferences.getString(key, ""));
+ break;
+ case KEY_VIBRATE:
+ break;
+ case KEY_PHONE:
+ Preference phonePre = findPreference(key);
+ phonePre.setSummary(sharedPreferences.getString(key, ""));
+ break;
+ }
+ }
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ getPreferenceManager().getSharedPreferences()
+ .registerOnSharedPreferenceChangeListener(this);
+ }
+
+ @Override
+ public void onPause() {
+ getPreferenceManager().getSharedPreferences()
+ .unregisterOnSharedPreferenceChangeListener(this);
+ super.onPause();
+ }
+}
diff --git a/src/Fall-Detection-master/app/src/main/jniLibs/arm64-v8a/libgdinamapv4sdk752.so b/src/Fall-Detection-master/app/src/main/jniLibs/arm64-v8a/libgdinamapv4sdk752.so
new file mode 100644
index 0000000..14d9978
Binary files /dev/null and b/src/Fall-Detection-master/app/src/main/jniLibs/arm64-v8a/libgdinamapv4sdk752.so differ
diff --git a/src/Fall-Detection-master/app/src/main/jniLibs/arm64-v8a/libgdinamapv4sdk752ex.so b/src/Fall-Detection-master/app/src/main/jniLibs/arm64-v8a/libgdinamapv4sdk752ex.so
new file mode 100644
index 0000000..6bbcad8
Binary files /dev/null and b/src/Fall-Detection-master/app/src/main/jniLibs/arm64-v8a/libgdinamapv4sdk752ex.so differ
diff --git a/src/Fall-Detection-master/app/src/main/jniLibs/armeabi/libgdinamapv4sdk752.so b/src/Fall-Detection-master/app/src/main/jniLibs/armeabi/libgdinamapv4sdk752.so
new file mode 100644
index 0000000..496687d
Binary files /dev/null and b/src/Fall-Detection-master/app/src/main/jniLibs/armeabi/libgdinamapv4sdk752.so differ
diff --git a/src/Fall-Detection-master/app/src/main/jniLibs/armeabi/libgdinamapv4sdk752ex.so b/src/Fall-Detection-master/app/src/main/jniLibs/armeabi/libgdinamapv4sdk752ex.so
new file mode 100644
index 0000000..bad9c4b
Binary files /dev/null and b/src/Fall-Detection-master/app/src/main/jniLibs/armeabi/libgdinamapv4sdk752ex.so differ
diff --git a/src/Fall-Detection-master/app/src/main/res/drawable/about_content.jpg b/src/Fall-Detection-master/app/src/main/res/drawable/about_content.jpg
new file mode 100644
index 0000000..74053e8
Binary files /dev/null and b/src/Fall-Detection-master/app/src/main/res/drawable/about_content.jpg differ
diff --git a/src/Fall-Detection-master/app/src/main/res/drawable/about_content1.png b/src/Fall-Detection-master/app/src/main/res/drawable/about_content1.png
new file mode 100644
index 0000000..3f91d5a
Binary files /dev/null and b/src/Fall-Detection-master/app/src/main/res/drawable/about_content1.png differ
diff --git a/src/Fall-Detection-master/app/src/main/res/drawable/home_content.jpg b/src/Fall-Detection-master/app/src/main/res/drawable/home_content.jpg
new file mode 100644
index 0000000..2242c6c
Binary files /dev/null and b/src/Fall-Detection-master/app/src/main/res/drawable/home_content.jpg differ
diff --git a/src/Fall-Detection-master/app/src/main/res/drawable/ic_about.png b/src/Fall-Detection-master/app/src/main/res/drawable/ic_about.png
new file mode 100644
index 0000000..b1f1406
Binary files /dev/null and b/src/Fall-Detection-master/app/src/main/res/drawable/ic_about.png differ
diff --git a/src/Fall-Detection-master/app/src/main/res/drawable/ic_app.png b/src/Fall-Detection-master/app/src/main/res/drawable/ic_app.png
new file mode 100644
index 0000000..f673203
Binary files /dev/null and b/src/Fall-Detection-master/app/src/main/res/drawable/ic_app.png differ
diff --git a/src/Fall-Detection-master/app/src/main/res/drawable/ic_back.png b/src/Fall-Detection-master/app/src/main/res/drawable/ic_back.png
new file mode 100644
index 0000000..baaf7d9
Binary files /dev/null and b/src/Fall-Detection-master/app/src/main/res/drawable/ic_back.png differ
diff --git a/src/Fall-Detection-master/app/src/main/res/drawable/ic_drawer.png b/src/Fall-Detection-master/app/src/main/res/drawable/ic_drawer.png
new file mode 100644
index 0000000..c59f601
Binary files /dev/null and b/src/Fall-Detection-master/app/src/main/res/drawable/ic_drawer.png differ
diff --git a/src/Fall-Detection-master/app/src/main/res/drawable/ic_home.png b/src/Fall-Detection-master/app/src/main/res/drawable/ic_home.png
new file mode 100644
index 0000000..0a3799b
Binary files /dev/null and b/src/Fall-Detection-master/app/src/main/res/drawable/ic_home.png differ
diff --git a/src/Fall-Detection-master/app/src/main/res/drawable/ic_menu.png b/src/Fall-Detection-master/app/src/main/res/drawable/ic_menu.png
new file mode 100644
index 0000000..c62db8c
Binary files /dev/null and b/src/Fall-Detection-master/app/src/main/res/drawable/ic_menu.png differ
diff --git a/src/Fall-Detection-master/app/src/main/res/drawable/ic_place.png b/src/Fall-Detection-master/app/src/main/res/drawable/ic_place.png
new file mode 100644
index 0000000..c7bcd08
Binary files /dev/null and b/src/Fall-Detection-master/app/src/main/res/drawable/ic_place.png differ
diff --git a/src/Fall-Detection-master/app/src/main/res/drawable/ic_settings.png b/src/Fall-Detection-master/app/src/main/res/drawable/ic_settings.png
new file mode 100644
index 0000000..d973325
Binary files /dev/null and b/src/Fall-Detection-master/app/src/main/res/drawable/ic_settings.png differ
diff --git a/src/Fall-Detection-master/app/src/main/res/drawable/ic_warning.png b/src/Fall-Detection-master/app/src/main/res/drawable/ic_warning.png
new file mode 100644
index 0000000..c872b30
Binary files /dev/null and b/src/Fall-Detection-master/app/src/main/res/drawable/ic_warning.png differ
diff --git a/src/Fall-Detection-master/app/src/main/res/layout/activity_main.xml b/src/Fall-Detection-master/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..5ae79c3
--- /dev/null
+++ b/src/Fall-Detection-master/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Fall-Detection-master/app/src/main/res/layout/fragment_about.xml b/src/Fall-Detection-master/app/src/main/res/layout/fragment_about.xml
new file mode 100644
index 0000000..e07b5f7
--- /dev/null
+++ b/src/Fall-Detection-master/app/src/main/res/layout/fragment_about.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Fall-Detection-master/app/src/main/res/layout/fragment_home.xml b/src/Fall-Detection-master/app/src/main/res/layout/fragment_home.xml
new file mode 100644
index 0000000..387b075
--- /dev/null
+++ b/src/Fall-Detection-master/app/src/main/res/layout/fragment_home.xml
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Fall-Detection-master/app/src/main/res/layout/fragment_place.xml b/src/Fall-Detection-master/app/src/main/res/layout/fragment_place.xml
new file mode 100644
index 0000000..9308ba2
--- /dev/null
+++ b/src/Fall-Detection-master/app/src/main/res/layout/fragment_place.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Fall-Detection-master/app/src/main/res/layout/include_toolbar.xml b/src/Fall-Detection-master/app/src/main/res/layout/include_toolbar.xml
new file mode 100644
index 0000000..4753f66
--- /dev/null
+++ b/src/Fall-Detection-master/app/src/main/res/layout/include_toolbar.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Fall-Detection-master/app/src/main/res/layout/map_activity.xml b/src/Fall-Detection-master/app/src/main/res/layout/map_activity.xml
new file mode 100644
index 0000000..f834f77
--- /dev/null
+++ b/src/Fall-Detection-master/app/src/main/res/layout/map_activity.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Fall-Detection-master/app/src/main/res/layout/navigation_header.xml b/src/Fall-Detection-master/app/src/main/res/layout/navigation_header.xml
new file mode 100644
index 0000000..b468def
--- /dev/null
+++ b/src/Fall-Detection-master/app/src/main/res/layout/navigation_header.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Fall-Detection-master/app/src/main/res/menu/drawer.xml b/src/Fall-Detection-master/app/src/main/res/menu/drawer.xml
new file mode 100644
index 0000000..65f38d0
--- /dev/null
+++ b/src/Fall-Detection-master/app/src/main/res/menu/drawer.xml
@@ -0,0 +1,21 @@
+
+
\ No newline at end of file
diff --git a/src/Fall-Detection-master/app/src/main/res/menu/menu_main.xml b/src/Fall-Detection-master/app/src/main/res/menu/menu_main.xml
new file mode 100644
index 0000000..2090396
--- /dev/null
+++ b/src/Fall-Detection-master/app/src/main/res/menu/menu_main.xml
@@ -0,0 +1,6 @@
+
+
\ No newline at end of file
diff --git a/src/Fall-Detection-master/app/src/main/res/mipmap-hdpi/ic_launcher.png b/src/Fall-Detection-master/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..cde69bc
Binary files /dev/null and b/src/Fall-Detection-master/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/src/Fall-Detection-master/app/src/main/res/mipmap-mdpi/ic_launcher.png b/src/Fall-Detection-master/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..c133a0c
Binary files /dev/null and b/src/Fall-Detection-master/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/src/Fall-Detection-master/app/src/main/res/mipmap-mdpi/profile_image.png b/src/Fall-Detection-master/app/src/main/res/mipmap-mdpi/profile_image.png
new file mode 100644
index 0000000..680ad5a
Binary files /dev/null and b/src/Fall-Detection-master/app/src/main/res/mipmap-mdpi/profile_image.png differ
diff --git a/src/Fall-Detection-master/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/src/Fall-Detection-master/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..bfa42f0
Binary files /dev/null and b/src/Fall-Detection-master/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/src/Fall-Detection-master/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/src/Fall-Detection-master/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..324e72c
Binary files /dev/null and b/src/Fall-Detection-master/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/src/Fall-Detection-master/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/src/Fall-Detection-master/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..aee44e1
Binary files /dev/null and b/src/Fall-Detection-master/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/src/Fall-Detection-master/app/src/main/res/values-w820dp/dimens.xml b/src/Fall-Detection-master/app/src/main/res/values-w820dp/dimens.xml
new file mode 100644
index 0000000..63fc816
--- /dev/null
+++ b/src/Fall-Detection-master/app/src/main/res/values-w820dp/dimens.xml
@@ -0,0 +1,6 @@
+
+
+ 64dp
+
diff --git a/src/Fall-Detection-master/app/src/main/res/values/colors.xml b/src/Fall-Detection-master/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..eb78190
--- /dev/null
+++ b/src/Fall-Detection-master/app/src/main/res/values/colors.xml
@@ -0,0 +1,15 @@
+
+
+ #4C637A
+ #A2C6EA
+ #CDE6FA
+ #4C637A
+ #212121
+ #727272
+ #FFFFFF
+ #B6B6B6
+ #FFF5F5F5
+ #eeeeee
+ #C4CEB3】
+ #AFB79C
+
diff --git a/src/Fall-Detection-master/app/src/main/res/values/dimens.xml b/src/Fall-Detection-master/app/src/main/res/values/dimens.xml
new file mode 100644
index 0000000..47c8224
--- /dev/null
+++ b/src/Fall-Detection-master/app/src/main/res/values/dimens.xml
@@ -0,0 +1,5 @@
+
+
+ 16dp
+ 16dp
+
diff --git a/src/Fall-Detection-master/app/src/main/res/values/strings.xml b/src/Fall-Detection-master/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..42daa69
--- /dev/null
+++ b/src/Fall-Detection-master/app/src/main/res/values/strings.xml
@@ -0,0 +1,15 @@
+
+ 老人跌倒检测
+ 主页
+ 地图与位置
+ 设置
+ 关于
+ android.support.design.widget.AppBarLayout$ScrollingViewBehavior
+ open
+ close
+
+
+ - 男
+ - 女
+
+
diff --git a/src/Fall-Detection-master/app/src/main/res/values/styles.xml b/src/Fall-Detection-master/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..19046e5
--- /dev/null
+++ b/src/Fall-Detection-master/app/src/main/res/values/styles.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
diff --git a/src/Fall-Detection-master/app/src/main/res/xml/preferences.xml b/src/Fall-Detection-master/app/src/main/res/xml/preferences.xml
new file mode 100644
index 0000000..93ca1bd
--- /dev/null
+++ b/src/Fall-Detection-master/app/src/main/res/xml/preferences.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Fall-Detection-master/app/src/test/java/com/example/cauc/falldetecion/ExampleUnitTest.java b/src/Fall-Detection-master/app/src/test/java/com/example/cauc/falldetecion/ExampleUnitTest.java
new file mode 100644
index 0000000..6c58cfa
--- /dev/null
+++ b/src/Fall-Detection-master/app/src/test/java/com/example/cauc/falldetecion/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.example.cauc.falldetecion;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() throws Exception {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/src/Fall-Detection-master/build.gradle b/src/Fall-Detection-master/build.gradle
new file mode 100644
index 0000000..cc010b4
--- /dev/null
+++ b/src/Fall-Detection-master/build.gradle
@@ -0,0 +1,27 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+ repositories {
+ jcenter()
+ google()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:7.4.2'
+
+ }
+}
+
+ext {
+ defaultApplicationId = 'com.example.cauc.falldetecion'
+}
+
+allprojects {
+ repositories {
+ jcenter()
+ google()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/src/Fall-Detection-master/gradle.properties b/src/Fall-Detection-master/gradle.properties
new file mode 100644
index 0000000..aac7c9b
--- /dev/null
+++ b/src/Fall-Detection-master/gradle.properties
@@ -0,0 +1,17 @@
+# Project-wide Gradle settings.
+
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx1536m
+
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
diff --git a/src/Fall-Detection-master/gradle/wrapper/gradle-wrapper.jar b/src/Fall-Detection-master/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..13372ae
Binary files /dev/null and b/src/Fall-Detection-master/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/src/Fall-Detection-master/gradle/wrapper/gradle-wrapper.properties b/src/Fall-Detection-master/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..6def180
--- /dev/null
+++ b/src/Fall-Detection-master/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Thu Sep 14 17:41:20 CST 2023
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
diff --git a/src/Fall-Detection-master/gradlew b/src/Fall-Detection-master/gradlew
new file mode 100644
index 0000000..9d82f78
--- /dev/null
+++ b/src/Fall-Detection-master/gradlew
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/src/Fall-Detection-master/gradlew.bat b/src/Fall-Detection-master/gradlew.bat
new file mode 100644
index 0000000..8a0b282
--- /dev/null
+++ b/src/Fall-Detection-master/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/src/Fall-Detection-master/settings.gradle b/src/Fall-Detection-master/settings.gradle
new file mode 100644
index 0000000..e7b4def
--- /dev/null
+++ b/src/Fall-Detection-master/settings.gradle
@@ -0,0 +1 @@
+include ':app'