diff --git a/doc/驾驶员危险驾驶行为监测系统-软件需求规格说明书.docx b/doc/驾驶员危险驾驶行为监测系统-软件需求规格说明书-v2.0.docx
similarity index 96%
rename from doc/驾驶员危险驾驶行为监测系统-软件需求规格说明书.docx
rename to doc/驾驶员危险驾驶行为监测系统-软件需求规格说明书-v2.0.docx
index 20e29cc..ed83454 100644
Binary files a/doc/驾驶员危险驾驶行为监测系统-软件需求规格说明书.docx and b/doc/驾驶员危险驾驶行为监测系统-软件需求规格说明书-v2.0.docx differ
diff --git a/model/驾驶员危险驾驶行为监测系统-软件需求模型.vsdx b/model/驾驶员危险驾驶行为监测系统-软件需求模型.vsdx
index f2f8fd6..efd1ea7 100644
Binary files a/model/驾驶员危险驾驶行为监测系统-软件需求模型.vsdx and b/model/驾驶员危险驾驶行为监测系统-软件需求模型.vsdx differ
diff --git a/src/Driving_Reminder_Assistant/.DS_Store b/src/Driving_Reminder_Assistant/.DS_Store
new file mode 100644
index 0000000..91a1143
Binary files /dev/null and b/src/Driving_Reminder_Assistant/.DS_Store differ
diff --git a/src/Driving_Reminder_Assistant/.idea/caches/build_file_checksums.ser b/src/Driving_Reminder_Assistant/.idea/caches/build_file_checksums.ser
new file mode 100644
index 0000000..2f31573
Binary files /dev/null and b/src/Driving_Reminder_Assistant/.idea/caches/build_file_checksums.ser differ
diff --git a/src/Driving_Reminder_Assistant/.idea/caches/gradle_models.ser b/src/Driving_Reminder_Assistant/.idea/caches/gradle_models.ser
new file mode 100644
index 0000000..9f7f7a3
Binary files /dev/null and b/src/Driving_Reminder_Assistant/.idea/caches/gradle_models.ser differ
diff --git a/src/Driving_Reminder_Assistant/.idea/codeStyles/Project.xml b/src/Driving_Reminder_Assistant/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..fb22c1d
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/codeStyles/Project.xml
@@ -0,0 +1,164 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/dbnavigator.xml b/src/Driving_Reminder_Assistant/.idea/dbnavigator.xml
new file mode 100644
index 0000000..59b34bd
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/dbnavigator.xml
@@ -0,0 +1,458 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/encodings.xml b/src/Driving_Reminder_Assistant/.idea/encodings.xml
new file mode 100644
index 0000000..15a15b2
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/encodings.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/gradle.xml b/src/Driving_Reminder_Assistant/.idea/gradle.xml
new file mode 100644
index 0000000..5cd135a
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/gradle.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/inspectionProfiles/Project_Default.xml b/src/Driving_Reminder_Assistant/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..bd75133
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/jarRepositories.xml b/src/Driving_Reminder_Assistant/.idea/jarRepositories.xml
new file mode 100644
index 0000000..7d43662
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/jarRepositories.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle____app_libs_GetuiSDK4_3_5_6_jar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle____app_libs_GetuiSDK4_3_5_6_jar.xml
new file mode 100644
index 0000000..95806ed
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle____app_libs_GetuiSDK4_3_5_6_jar.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle____app_libs_json_simple_1_1_jar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle____app_libs_json_simple_1_1_jar.xml
new file mode 100644
index 0000000..3e1f32f
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle____app_libs_json_simple_1_1_jar.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_activity_activity_1_0_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_activity_activity_1_0_0_aar.xml
new file mode 100644
index 0000000..6eefbf0
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_activity_activity_1_0_0_aar.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_annotation_annotation_1_1_0_jar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_annotation_annotation_1_1_0_jar.xml
new file mode 100644
index 0000000..5b17db6
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_annotation_annotation_1_1_0_jar.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_appcompat_appcompat_1_2_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_appcompat_appcompat_1_2_0_aar.xml
new file mode 100644
index 0000000..9c798c3
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_appcompat_appcompat_1_2_0_aar.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_appcompat_appcompat_resources_1_2_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_appcompat_appcompat_resources_1_2_0_aar.xml
new file mode 100644
index 0000000..fc465ff
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_appcompat_appcompat_resources_1_2_0_aar.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_arch_core_core_common_2_1_0_jar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_arch_core_core_common_2_1_0_jar.xml
new file mode 100644
index 0000000..a7f501b
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_arch_core_core_common_2_1_0_jar.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_arch_core_core_runtime_2_0_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_arch_core_core_runtime_2_0_0_aar.xml
new file mode 100644
index 0000000..2c96872
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_arch_core_core_runtime_2_0_0_aar.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_asynclayoutinflater_asynclayoutinflater_1_0_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_asynclayoutinflater_asynclayoutinflater_1_0_0_aar.xml
new file mode 100644
index 0000000..f17e429
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_asynclayoutinflater_asynclayoutinflater_1_0_0_aar.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_collection_collection_1_1_0_jar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_collection_collection_1_1_0_jar.xml
new file mode 100644
index 0000000..ecb16c3
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_collection_collection_1_1_0_jar.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_coordinatorlayout_coordinatorlayout_1_0_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_coordinatorlayout_coordinatorlayout_1_0_0_aar.xml
new file mode 100644
index 0000000..9b16214
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_coordinatorlayout_coordinatorlayout_1_0_0_aar.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_core_core_1_3_1_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_core_core_1_3_1_aar.xml
new file mode 100644
index 0000000..75b6dfe
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_core_core_1_3_1_aar.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_cursoradapter_cursoradapter_1_0_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_cursoradapter_cursoradapter_1_0_0_aar.xml
new file mode 100644
index 0000000..c607671
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_cursoradapter_cursoradapter_1_0_0_aar.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_customview_customview_1_0_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_customview_customview_1_0_0_aar.xml
new file mode 100644
index 0000000..7f2a763
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_customview_customview_1_0_0_aar.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_documentfile_documentfile_1_0_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_documentfile_documentfile_1_0_0_aar.xml
new file mode 100644
index 0000000..1ce2c1c
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_documentfile_documentfile_1_0_0_aar.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_drawerlayout_drawerlayout_1_0_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_drawerlayout_drawerlayout_1_0_0_aar.xml
new file mode 100644
index 0000000..b1a5d6b
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_drawerlayout_drawerlayout_1_0_0_aar.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_fragment_fragment_1_1_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_fragment_fragment_1_1_0_aar.xml
new file mode 100644
index 0000000..1094179
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_fragment_fragment_1_1_0_aar.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_interpolator_interpolator_1_0_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_interpolator_interpolator_1_0_0_aar.xml
new file mode 100644
index 0000000..ace7cda
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_interpolator_interpolator_1_0_0_aar.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_ui_1_0_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_ui_1_0_0_aar.xml
new file mode 100644
index 0000000..efca013
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_ui_1_0_0_aar.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_utils_1_0_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_utils_1_0_0_aar.xml
new file mode 100644
index 0000000..7c861f2
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_utils_1_0_0_aar.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_legacy_legacy_support_v4_1_0_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_legacy_legacy_support_v4_1_0_0_aar.xml
new file mode 100644
index 0000000..6378610
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_legacy_legacy_support_v4_1_0_0_aar.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_common_2_1_0_jar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_common_2_1_0_jar.xml
new file mode 100644
index 0000000..8c4384c
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_common_2_1_0_jar.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_2_0_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_2_0_0_aar.xml
new file mode 100644
index 0000000..a9ccd5a
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_2_0_0_aar.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_core_2_0_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_core_2_0_0_aar.xml
new file mode 100644
index 0000000..15354c6
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_core_2_0_0_aar.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_runtime_2_1_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_runtime_2_1_0_aar.xml
new file mode 100644
index 0000000..898c5cf
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_runtime_2_1_0_aar.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_viewmodel_2_1_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_viewmodel_2_1_0_aar.xml
new file mode 100644
index 0000000..ea683f5
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_viewmodel_2_1_0_aar.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_loader_loader_1_0_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_loader_loader_1_0_0_aar.xml
new file mode 100644
index 0000000..01d9108
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_loader_loader_1_0_0_aar.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_localbroadcastmanager_localbroadcastmanager_1_0_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_localbroadcastmanager_localbroadcastmanager_1_0_0_aar.xml
new file mode 100644
index 0000000..92fd4f7
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_localbroadcastmanager_localbroadcastmanager_1_0_0_aar.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_media_media_1_0_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_media_media_1_0_0_aar.xml
new file mode 100644
index 0000000..5344daf
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_media_media_1_0_0_aar.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_print_print_1_0_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_print_print_1_0_0_aar.xml
new file mode 100644
index 0000000..2cb6e7e
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_print_print_1_0_0_aar.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_savedstate_savedstate_1_0_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_savedstate_savedstate_1_0_0_aar.xml
new file mode 100644
index 0000000..c1c6d73
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_savedstate_savedstate_1_0_0_aar.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_slidingpanelayout_slidingpanelayout_1_0_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_slidingpanelayout_slidingpanelayout_1_0_0_aar.xml
new file mode 100644
index 0000000..6cf25ca
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_slidingpanelayout_slidingpanelayout_1_0_0_aar.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_swiperefreshlayout_swiperefreshlayout_1_0_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_swiperefreshlayout_swiperefreshlayout_1_0_0_aar.xml
new file mode 100644
index 0000000..f62d0e2
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_swiperefreshlayout_swiperefreshlayout_1_0_0_aar.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_1_1_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_1_1_0_aar.xml
new file mode 100644
index 0000000..44bc4da
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_1_1_0_aar.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_animated_1_1_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_animated_1_1_0_aar.xml
new file mode 100644
index 0000000..9944b90
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_animated_1_1_0_aar.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_versionedparcelable_versionedparcelable_1_1_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_versionedparcelable_versionedparcelable_1_1_0_aar.xml
new file mode 100644
index 0000000..c1ce5f2
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_versionedparcelable_versionedparcelable_1_1_0_aar.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_viewpager_viewpager_1_0_0_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_viewpager_viewpager_1_0_0_aar.xml
new file mode 100644
index 0000000..1068052
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__androidx_viewpager_viewpager_1_0_0_aar.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__com_google_code_gson_gson_2_7_jar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__com_google_code_gson_gson_2_7_jar.xml
new file mode 100644
index 0000000..7ec4e00
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__com_google_code_gson_gson_2_7_jar.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__com_squareup_okhttp3_okhttp_3_8_1_jar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__com_squareup_okhttp3_okhttp_3_8_1_jar.xml
new file mode 100644
index 0000000..1379d59
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__com_squareup_okhttp3_okhttp_3_8_1_jar.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__com_squareup_okio_okio_1_13_0_jar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__com_squareup_okio_okio_1_13_0_jar.xml
new file mode 100644
index 0000000..8dbb787
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__com_squareup_okio_okio_1_13_0_jar.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__com_tengine_tenginekit_core_0_0_4_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__com_tengine_tenginekit_core_0_0_4_aar.xml
new file mode 100644
index 0000000..0f7ea08
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__com_tengine_tenginekit_core_0_0_4_aar.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__com_tengine_tenginekit_face_0_0_3_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__com_tengine_tenginekit_face_0_0_3_aar.xml
new file mode 100644
index 0000000..05351cd
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__com_tengine_tenginekit_face_0_0_3_aar.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__org_apache_http_legacy_android_28.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__org_apache_http_legacy_android_28.xml
new file mode 100644
index 0000000..85203f1
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__org_apache_http_legacy_android_28.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__org_tensorflow_tensorflow_android_1_13_1_aar.xml b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__org_tensorflow_tensorflow_android_1_13_1_aar.xml
new file mode 100644
index 0000000..9d661d1
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/libraries/Gradle__org_tensorflow_tensorflow_android_1_13_1_aar.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/markdown-navigator/profiles_settings.xml b/src/Driving_Reminder_Assistant/.idea/markdown-navigator/profiles_settings.xml
new file mode 100644
index 0000000..db06266
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/markdown-navigator/profiles_settings.xml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/misc.xml b/src/Driving_Reminder_Assistant/.idea/misc.xml
new file mode 100644
index 0000000..37a7509
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/modules.xml b/src/Driving_Reminder_Assistant/.idea/modules.xml
new file mode 100644
index 0000000..3c9856e
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/runConfigurations.xml b/src/Driving_Reminder_Assistant/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/sonarIssues.xml b/src/Driving_Reminder_Assistant/.idea/sonarIssues.xml
new file mode 100644
index 0000000..3130664
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/sonarIssues.xml
@@ -0,0 +1,629 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/test.txt b/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/0/2/02269b0647b479c6e7b81501f65fdb476937576c
similarity index 100%
rename from src/test.txt
rename to src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/0/2/02269b0647b479c6e7b81501f65fdb476937576c
diff --git a/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/0/3/03c3f1aa249e21b6530e9c4e02c719aece91b93f b/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/0/3/03c3f1aa249e21b6530e9c4e02c719aece91b93f
new file mode 100644
index 0000000..5631894
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/0/3/03c3f1aa249e21b6530e9c4e02c719aece91b93f
@@ -0,0 +1,191 @@
+
+F
+java:S3740"/Provide the parametrized type for this generic.(Ӑ
+Q java:S110&"Use isEmpty() to check whether the collection is empty or not.(觼
+U
+java:S1155">Use isEmpty() to check whether the collection is empty or not.(
+Z
+java:S1155">Use isEmpty() to check whether the collection is empty or not.(Җ
+O
+java:S4973O"9Use the "equals" method if value comparison was intended.(
+o
+java:S1488"YImmediately return this expression instead of assigning it to the temporary variable "m".(
+u
+java:S1488"YImmediately return this expression instead of assigning it to the temporary variable "h".(
+G
+java:S1128"1Remove this unused import 'android.app.Activity'.(
+v
+java:S1450("`Remove the "timing_backlayout" field and declare it as a local variable in the relevant methods.(
+w
+java:S14503"aRemove the "timing_edit_layout" field and declare it as a local variable in the relevant methods.(
+u
+java:S1450,"ZRemove the "timing_save" field and declare it as a local variable in the relevant methods.(
+}
+java:S1450,"bRemove the "timing_start_delete" field and declare it as a local variable in the relevant methods.(
+{
+java:S1450,"`Remove the "timing_start_save" field and declare it as a local variable in the relevant methods.(
+{
+java:S14504"fRemove the "tv_camera_timingaddplan" field and declare it as a local variable in the relevant methods.(5
+D
+java:S1659)".Declare "timing_textView2" on a separate line.(
+K
+java:S1659*"0Declare "timing_timePicker2" on a separate line.(
+C
+java:S1659+"(Declare "timing_id2" on a separate line.(נ
+C
+java:S1659+"(Declare "timing_id3" on a separate line.(נ
+C
+java:S1659+"(Declare "timing_id4" on a separate line.(נ
+C
+java:S1659+"(Declare "timing_id5" on a separate line.(נ
+C
+java:S1659+"(Declare "timing_id6" on a separate line.(נ
+C
+java:S1659+"(Declare "timing_id7" on a separate line.(נ
+J
+java:S1659,"/Declare "timing_start_save" on a separate line.(
+D
+java:S1659,")Declare "timing_save" on a separate line.(
+;
+java:S1659-"%Declare "endTime" on a separate line.(
+7
+java:S16591"!Declare "key" on a separate line.(
+E
+java:S1659")Declare "passEndTime" on a separate line.(
+q java:S116("\Rename this field "timing_backlayout" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+p java:S116)"[Rename this field "timing_textView1" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+p java:S116)"[Rename this field "timing_textView2" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+w java:S116*"]Rename this field "timing_timePicker1" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+w java:S116*"]Rename this field "timing_timePicker2" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+o java:S116+"URename this field "timing_id1" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(נ
+o java:S116+"URename this field "timing_id2" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(נ
+o java:S116+"URename this field "timing_id3" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(נ
+o java:S116+"URename this field "timing_id4" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(נ
+o java:S116+"URename this field "timing_id5" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(נ
+o java:S116+"URename this field "timing_id6" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(נ
+o java:S116+"URename this field "timing_id7" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(נ
+x java:S116,"^Rename this field "timing_start_delete" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+v java:S116,"\Rename this field "timing_start_save" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+p java:S116,"VRename this field "timing_save" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+r java:S1163"]Rename this field "timing_edit_layout" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+v java:S1164"bRename this field "tv_camera_timingaddplan" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(5
+M
+java:S11358"2Complete the task associated to this TODO comment.(
+M
+java:S1135B"2Complete the task associated to this TODO comment.(
+t
+java:S2293H"YReplace the type specification in this constructor call with the diamond operator ("<>").(
+M
+java:S1135L"2Complete the task associated to this TODO comment.(
+m
+java:S3776["RRefactor this method to reduce its Cognitive Complexity from 20 to the 15 allowed.(
+Q
+java:S1874u"6Remove this use of "setCurrentHour"; it is deprecated.(ܥ
+N
+java:S1874v"8Remove this use of "setCurrentMinute"; it is deprecated.(
+P
+java:S1854{":Remove this useless assignment to local variable "myHour".(
+R
+java:S1854z"").(
+n
+java:S3776"RRefactor this method to reduce its Cognitive Complexity from 43 to the 15 allowed.(
+N
+java:S1135"2Complete the task associated to this TODO comment.(
+M
+java:S1905"1Remove this unnecessary cast to "CompoundButton".(ţ
+G
+java:S1874"0Remove this use of "getColor"; it is deprecated.(ך
+G
+java:S1874"0Remove this use of "getColor"; it is deprecated.(ך
+L
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+L
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+G
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+G
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+L
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+L
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+L
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+L
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+G
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+G
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+L
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+L
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+R java:S125" java:S108b")Either remove or fill this block of code.(
+J
+java:S2864n"4Iterate over the "entrySet" instead of the "keySet".(
+J
+java:S1144l"4Remove this unused private "builderFormData" method.(
+L
+java:S1172X"1Remove this unused method parameter "methodType".(ʵ
+J
+java:S1444["/Make this "public static signature" field final(
+p
+java:S1104["UMake signature a static final constant or non-public and provide accessors if needed.(
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/1/1/110752c4ba94403fc54215ca7c91286cb8754ff3 b/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/1/1/110752c4ba94403fc54215ca7c91286cb8754ff3
new file mode 100644
index 0000000..703f4ec
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/1/1/110752c4ba94403fc54215ca7c91286cb8754ff3
@@ -0,0 +1,205 @@
+
+n java:S116B"YRename this field "defense_plan17" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ݦ
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Ҙ
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+r java:S116:"XRename this field "defense_plan9" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ʐ
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(dz
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+s java:S116F"YRename this field "defense_plan21" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ݢ
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(چ
+e java:S117r"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ϡ
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+s java:S1160"YRename this field "schedule_sat_2" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(̲
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(̲
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ܺ
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(˛
+n java:S116>"YRename this field "defense_plan13" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+s java:S116*"YRename this field "schedule_thu_2" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+k java:S116"VRename this field "ioout_level" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(±
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ֿ
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ı
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+o java:S116"URename this field "ioin_level" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Ȅ
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+c java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(M
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(鲀
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(dz
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ʸ
+m java:S116A"YRename this field "defense_plan16" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ܧB
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Ͱ
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ӓ
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(タ
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+n java:S116@"YRename this field "defense_plan15" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+s java:S116%"YRename this field "schedule_wed_1" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ڏ
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ظ
+c java:S100v"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Ř
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ȝ
+m java:S1167"XRename this field "defense_plan6" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+k java:S116"VRename this field "alarm_audio" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ǧdz
+s java:S116"YRename this field "schedule_sun_1" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ʓ
+n java:S116?"YRename this field "defense_plan14" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+k java:S117b"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+s java:S116+"YRename this field "schedule_fri_0" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(̯
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+c java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ժ
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ܱ
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ὢ
+t java:S116"ZRename this field "upload_interval" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Ͻ
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(У
+k java:S117z"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+r java:S1165"XRename this field "defense_plan4" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(У
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+k java:S116"VRename this field "input_armed" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(縸
+c java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(w
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+n java:S116!"YRename this field "schedule_tue_0" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Ф
+n java:S116-"YRename this field "schedule_fri_2" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ˉ
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(â
+c java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ܒI
+m java:S116C"YRename this field "defense_plan18" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ݍ
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Ù
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+r java:S1163"XRename this field "defense_plan2" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ظ
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(偟
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+n java:S116"YRename this field "schedule_sun_0" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ԑ
+n java:S116)"YRename this field "schedule_thu_1" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Ϧ
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ⳕ
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Ù
+n java:S116="YRename this field "defense_plan12" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+r java:S116"]Rename this field "motion_sensitivity" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ח
+s java:S116E"YRename this field "defense_plan20" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ܵ
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(±
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(چ
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+s java:S116D"YRename this field "defense_plan19" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+c java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(l
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ժ
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ܱ
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Ǟٹ
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Ͻ
+h java:S100z"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Ͱ
+m java:S1164"XRename this field "defense_plan3" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+n java:S116/"YRename this field "schedule_sat_1" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ܵ
+m java:S1162"XRename this field "defense_plan1" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+s java:S116("YRename this field "schedule_thu_0" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ͤ
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Ԥ
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+r java:S1168"XRename this field "defense_plan7" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ὢ
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ȝ
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ⳕ
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+f java:S117j"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ʸ
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Ҙ
+h java:S100n"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+n java:S116$"YRename this field "schedule_wed_0" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Њ͝
+s java:S116,"YRename this field "schedule_fri_1" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(퐌
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+n java:S116&"YRename this field "schedule_wed_2" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ߝ
+f java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(l
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+s java:S116."YRename this field "schedule_sat_0" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(̝
+c java:S100~"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ͯ
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Ф
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S116
"URename this field "alarm_temp" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(x
+o java:S116"ZRename this field "schedule_enable" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+l java:S116"WRename this field "motion_armed" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+n java:S116 "YRename this field "schedule_mon_2" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(缰
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(偟
+r java:S1166"XRename this field "defense_plan5" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+h java:S100^"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ˣ
+c java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ɭ#
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(˛
+n java:S116"YRename this field "schedule_mon_1" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+s java:S116"YRename this field "schedule_mon_0" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ġ
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(˵
+h java:S100f"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+r java:S1169"XRename this field "defense_plan8" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ʍ
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(˵
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(В
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ͯ
+b java:S100r"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ϡ
+m java:S116"YRename this field "schedule_sun_2" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+n java:S116#"YRename this field "schedule_tue_2" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ഄ
+s java:S116;"YRename this field "defense_plan10" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ת
+s java:S116""YRename this field "schedule_tue_1" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(哈
+n java:S116<"YRename this field "defense_plan11" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(㙏
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(̵
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+c java:S100j"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(퐌
+h java:S100b"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/1/1/115a87a31d0622776ad70fff591682ee78e14e94 b/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/1/1/115a87a31d0622776ad70fff591682ee78e14e94
new file mode 100644
index 0000000..e69de29
diff --git a/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/1/3/135888f4d4a39c69f44c7db80c508afd177a29f7 b/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/1/3/135888f4d4a39c69f44c7db80c508afd177a29f7
new file mode 100644
index 0000000..e69de29
diff --git a/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/1/3/13c34cbd03f926f4d5fdb3c3896bf9cafa8349cc b/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/1/3/13c34cbd03f926f4d5fdb3c3896bf9cafa8349cc
new file mode 100644
index 0000000..c93c7ed
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/1/3/13c34cbd03f926f4d5fdb3c3896bf9cafa8349cc
@@ -0,0 +1,14 @@
+
+n
+java:S1450%"XRemove the "startDate" field and declare it as a local variable in the relevant methods.(
+T java:S899R":Do something with the "boolean" value returned by "offer".(ʡ
+E
+java:S1068
+"/Remove this unused "surfaceView" private field.(
+\
+java:S2142B"FEither re-interrupt this method or rethrow the "InterruptedException".(䠹
+l
+java:S1450&"VRemove the "endDate" field and declare it as a local variable in the relevant methods.(
+V java:S125"Use isEmpty() to check whether the collection is empty or not.(觼
+U
+java:S1155">Use isEmpty() to check whether the collection is empty or not.(
+Z
+java:S1155">Use isEmpty() to check whether the collection is empty or not.(Җ
+O
+java:S4973T"9Use the "equals" method if value comparison was intended.(
+o
+java:S1488"YImmediately return this expression instead of assigning it to the temporary variable "m".(
+u
+java:S1488"YImmediately return this expression instead of assigning it to the temporary variable "h".(
+G
+java:S1128"1Remove this unused import 'android.app.Activity'.(
+v
+java:S1450-"`Remove the "timing_backlayout" field and declare it as a local variable in the relevant methods.(
+w
+java:S14508"aRemove the "timing_edit_layout" field and declare it as a local variable in the relevant methods.(
+u
+java:S14501"ZRemove the "timing_save" field and declare it as a local variable in the relevant methods.(
+}
+java:S14501"bRemove the "timing_start_delete" field and declare it as a local variable in the relevant methods.(
+{
+java:S14501"`Remove the "timing_start_save" field and declare it as a local variable in the relevant methods.(
+{
+java:S14509"fRemove the "tv_camera_timingaddplan" field and declare it as a local variable in the relevant methods.(5
+D
+java:S1659.".Declare "timing_textView2" on a separate line.(
+K
+java:S1659/"0Declare "timing_timePicker2" on a separate line.(
+C
+java:S16590"(Declare "timing_id2" on a separate line.(נ
+C
+java:S16590"(Declare "timing_id3" on a separate line.(נ
+C
+java:S16590"(Declare "timing_id4" on a separate line.(נ
+C
+java:S16590"(Declare "timing_id5" on a separate line.(נ
+C
+java:S16590"(Declare "timing_id6" on a separate line.(נ
+C
+java:S16590"(Declare "timing_id7" on a separate line.(נ
+J
+java:S16591"/Declare "timing_start_save" on a separate line.(
+D
+java:S16591")Declare "timing_save" on a separate line.(
+;
+java:S16592"%Declare "endTime" on a separate line.(
+7
+java:S16596"!Declare "key" on a separate line.(
+E
+java:S1659")Declare "passEndTime" on a separate line.(
+q java:S116-"\Rename this field "timing_backlayout" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+p java:S116."[Rename this field "timing_textView1" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+p java:S116."[Rename this field "timing_textView2" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+w java:S116/"]Rename this field "timing_timePicker1" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+w java:S116/"]Rename this field "timing_timePicker2" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+o java:S1160"URename this field "timing_id1" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(נ
+o java:S1160"URename this field "timing_id2" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(נ
+o java:S1160"URename this field "timing_id3" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(נ
+o java:S1160"URename this field "timing_id4" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(נ
+o java:S1160"URename this field "timing_id5" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(נ
+o java:S1160"URename this field "timing_id6" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(נ
+o java:S1160"URename this field "timing_id7" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(נ
+x java:S1161"^Rename this field "timing_start_delete" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+v java:S1161"\Rename this field "timing_start_save" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+p java:S1161"VRename this field "timing_save" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+r java:S1168"]Rename this field "timing_edit_layout" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+v java:S1169"bRename this field "tv_camera_timingaddplan" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(5
+M
+java:S1135="2Complete the task associated to this TODO comment.(
+M
+java:S1135G"2Complete the task associated to this TODO comment.(
+t
+java:S2293M"YReplace the type specification in this constructor call with the diamond operator ("<>").(
+M
+java:S1135Q"2Complete the task associated to this TODO comment.(
+m
+java:S3776`"RRefactor this method to reduce its Cognitive Complexity from 20 to the 15 allowed.(
+Q
+java:S1874z"6Remove this use of "setCurrentHour"; it is deprecated.(ܥ
+N
+java:S1874{"8Remove this use of "setCurrentMinute"; it is deprecated.(
+Q
+java:S1854":Remove this useless assignment to local variable "myHour".(
+R
+java:S1854"").(
+n
+java:S3776"RRefactor this method to reduce its Cognitive Complexity from 43 to the 15 allowed.(
+N
+java:S1135"2Complete the task associated to this TODO comment.(
+M
+java:S1905"1Remove this unnecessary cast to "CompoundButton".(ţ
+G
+java:S1874"0Remove this use of "getColor"; it is deprecated.(ך
+G
+java:S1874"0Remove this use of "getColor"; it is deprecated.(ך
+L
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+L
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+G
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+G
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+L
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+L
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+L
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+L
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+G
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+G
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+L
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+L
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+R java:S125"").(Y
+t
+java:S1450%"YRemove the "sureButton" field and declare it as a local variable in the relevant methods.(
+\
+java:S1126@"AReplace this if-then-else statement by a single return statement.(
+Q
+java:S1068#"6Remove this unused "pushBindDeviceBean" private field.(
+l java:S116&"RRename this field "et_time" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+[
+java:S1128"ERemove this unused import 'androidx.appcompat.app.AppCompatActivity'.(
+V java:S125k"").(ԣ
+u
+java:S2293"YReplace the type specification in this constructor call with the diamond operator ("<>").(빧
+` java:S112q"FDefine and throw a dedicated exception instead of using a generic one.(ܝ
+` java:S112y"FDefine and throw a dedicated exception instead of using a generic one.(ࡈ
+g
+java:S2095V"LUse try-with-resources or close this "BufferedReader" in a "finally" clause.(ߡ
+` java:S112u"FDefine and throw a dedicated exception instead of using a generic one.(
+
+java:S11497"eReplace the synchronized class "Vector" by an unsynchronized one such as "ArrayList" or "LinkedList".(ԣ
+V java:S125Y"").(l
+V java:S125-"
+java:S1185/"(Remove this method to simply inherit it.(Ъ
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(˞
+S java:S107"=Method has 31 parameters, which is greater than 7 authorized.(ж
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ᵞ
+
+java:S1104"nMake mLowPwerInterfaceForIndexCgiHelper a static final constant or non-public and provide accessors if needed.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Է
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+d java:S100
+"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+[
+java:S1444"DMake this "public static mLowPwerInterfaceForLightLevel" field final(Ψ
+X java:S107 "=Method has 10 parameters, which is greater than 7 authorized.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ʶ
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ɐ
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Φ
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ҡ
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ĕ
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(䕥
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+x
+java:S2234"aParameters to LowPwerCallBack have the same names but not the same order as the method arguments.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+
+java:S1186
+"Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ו
+i java:S100
+"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Ժ
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+S java:S107"=Method has 30 parameters, which is greater than 7 authorized.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(꘧
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(秹
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+S
+java:S1444"7Make this "public static mLowPwerInterface" field final(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(⒤
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Ղ
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ℷ
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ů
+B
+java:S1172"&Remove these unused method parameters.(ц
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(⒤
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+<
+java:S1172K"&Remove these unused method parameters.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ء
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ˡ
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+f java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ޒ
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ɐ
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(˞
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ɢ
+i java:S100
+"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(⾿
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Ղ
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+f java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ޒ
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ƕ
+e
+java:S1192"IDefine a constant instead of duplicating this literal "command=" 5 times.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(˞
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ж
+\
+java:S1854"@Remove this useless assignment to local variable "strGpioAlarm".(
+f java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(^
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+X java:S107 "=Method has 10 parameters, which is greater than 7 authorized.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+g java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ձ
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+V java:S107X"Remove this useless assignment to local variable "permission".(
+R java:S125"
+java:S1068_"(Remove this unused "mode" private field.(
+A
+java:S1068a"+Remove this unused "oldDist" private field.(Ɔ
+B
+java:S1068e"'Remove this unused "mid" private field.(
+D
+java:S1144"-Remove this unused private "midPoint" method.(
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/5/5/5513c790bd3b0f0b08d1beab8eefb2abfc5e8dcd b/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/5/5/5513c790bd3b0f0b08d1beab8eefb2abfc5e8dcd
new file mode 100644
index 0000000..c23e03e
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/5/5/5513c790bd3b0f0b08d1beab8eefb2abfc5e8dcd
@@ -0,0 +1,78 @@
+
+s java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ו8/
+K
+java:S10685".Remove this unused "cameraType" private field.(ŭ8/
+n java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ؽ8/
+W
+java:S10684"5Remove this unused "UPLOADTIMETOOLONG" private field.(8/
+m java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ޒ 8/
+
+java:S1186"Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.(/8/
+n java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(螇8/
+s java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(8/
+n java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(8/
+s java:S1162"RRename this field "TIMEOUT" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(µ8/
+n java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(8/
+m java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ޒ 8/
+} java:S1164"\Rename this field "UPLOADTIMETOOLONG" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(8/
+T
+java:S1128"2Remove this unused import 'android.text.Editable'.(8/
+s java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Л8/
+n java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(⒤8/
+n java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(8/
+U
+java:S1128"3Remove this unused import 'android.text.TextUtils'.(8/
+w java:S1163"VRename this field "ALERMPARAMS" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Ƴ8/
+s java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(8/
+R
+java:S1128"5Remove this unused import 'android.text.TextWatcher'.(8/
+] java:S125/"").(8/
+Z
+java:S2589"7Remove this expression which always evaluates to "true"(ֈӬ8/
+I
+java:S1659"+Declare "ptzDefaultSet" on a separate line.(8/
+I
+java:S1068",Remove this unused "IR_STATE" private field.( 8/
+Y
+java:S2696"6Make the enclosing method "static" or remove this set.(8/
+
+java:S1186"Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.(j8/
+h
+java:S1124"EReorder the modifiers to comply with the Java Language Specification.(8/
+s java:S116"QRename this field "BRIGHT" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ũ8/
+s java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(8/
+J
+java:S1659",Declare "ptzTake_photos" on a separate line.(8/
+u
+java:S1104"RMake isJpeg a static final constant or non-public and provide accessors if needed.(ʝ8/
+h
+java:S1854"ERemove this useless assignment to local variable "faceLandmarkInfos".(8/
+u
+java:S3776"RRefactor this method to reduce its Cognitive Complexity from 24 to the 15 allowed.(ښ8/
+s
+java:S3008"VRename this field "ScreenWidth" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Z8/
+}
+java:S1192 "ZDefine a constant instead of duplicating this literal "&loginuse=admin&loginpas=" 3 times.(8/
+9
+java:S3626
"Remove this redundant jump.(݅8/
+V
+java:S1874"3Remove this use of "getDrawable"; it is deprecated.(8/
+K
+java:S1144"-Remove this unused private "midPoint" method.(8/
+R
+java:S1068"/Remove this unused "showTopAnim" private field.(芦8/
+D
+java:S1170"!Make this final field static too.(ũ8/
+?
+java:S1116"Remove this empty statement.(8/
+n
+java:S3252"PUse static access with "android.view.ViewGroup$LayoutParams" for "WRAP_CONTENT".(8/
+P
+java:S1874"2Remove this use of "getSeconds"; it is deprecated.(͇8/
+d
+java:S2142
+"FEither re-interrupt this method or rethrow the "InterruptedException".(䠹8/
+p
+java:S3776"RRefactor this method to reduce its Cognitive Complexity from 26 to the 15 allowed.(8/
+[
+java:S1481"8Remove this unused "faceLandmark3dInfos" local variable.(8/
+U
+java:S1135
+"2Complete the task associated to this TODO comment.(8/
+P
+java:S1199"-Extract this nested code block into a method.(8/
+^ java:S125"").(ɤ8/
+Y java:S125"").(8/
+U
+java:S1874"2Remove this use of "getSeconds"; it is deprecated.(8/
+S
+java:S1874"0Remove this use of "getWidth"; it is deprecated.(8/
+u
+java:S3776"RRefactor this method to reduce its Cognitive Complexity from 21 to the 15 allowed.(8/
+k java:S100
"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ʔ8/
+s
+java:S3252"PUse static access with "android.view.ViewGroup$LayoutParams" for "WRAP_CONTENT".(̴8/
+d
+java:S1854"GRemove this useless assignment to local variable "faceLandmark3dInfos".(f8/
+s
+java:S3252
+"PUse static access with "android.view.ViewGroup$LayoutParams" for "WRAP_CONTENT".(8/
+U
+java:S1135"2Complete the task associated to this TODO comment.(8/
+N
+java:S1874"0Remove this use of "getColor"; it is deprecated.(8/
+|
+java:S1104"YMake reslutionlist a static final constant or non-public and provide accessors if needed.(ɤ8/
+Y
+java:S2696"6Make the enclosing method "static" or remove this set.(λ8/
+k java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(8/
+M
+java:S2093
"*Change this "try" to a try-with-resources.(8/
+U
+java:S1854"8Remove this useless assignment to local variable "rect".(ٸW8/
+S
+java:S1874"0Remove this use of "getWidth"; it is deprecated.(8/
+u
+java:S1450"WRemove the "drawable" field and declare it as a local variable in the relevant methods.(ݥ8/
+}
+java:S1450"ZRemove the "showTopAnim" field and declare it as a local variable in the relevant methods.(芦8/
+Z
+java:S1117"7Rename "x2" which hides the field declared at line 854.(8/
+p java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(8/
+R
+java:S1066"/Merge this if statement with the enclosing one.(8/
+q
+java:S1450"SRemove the "mode" field and declare it as a local variable in the relevant methods.(8/
+^ java:S125
"Use isEmpty() to check whether the collection is empty or not.(8/
+
+java:S1186"Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.(/8/
+y
+java:S1450"VRemove the "timeTwo" field and declare it as a local variable in the relevant methods.(8/
+u
+java:S3776"RRefactor this method to reduce its Cognitive Complexity from 49 to the 15 allowed.(8/
+I
+java:S1659"+Declare "ptzBrightness" on a separate line.(8/
+S
+java:S2696"6Make the enclosing method "static" or remove this set.(g8/
+?
+java:S1116"Remove this empty statement.(8/
+I
+java:S1068"+Remove this unused "oldDist" private field.(Ɔ8/
+Y
+java:S1117";Rename "matrix" which hides the field declared at line 914.(ݨ8/
+Y
+java:S1874"6Remove this use of "BitmapDrawable"; it is deprecated.(Ł8/
+k java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(8/
+]
+java:S1161":Add the "@Override" annotation above this method signature(8/
+^ java:S125"
+java:S1170"!Make this final field static too.( 8/
+U
+java:S1117"7Rename "x1" which hides the field declared at line 853.(8/
+x
+java:S1450"ZRemove the "ptzContrast" field and declare it as a local variable in the relevant methods.(8/
+j
+java:S1854"GRemove this useless assignment to local variable "faceLandmark3dInfos".(8/
+q
+java:S1871"NThis branch's code block is the same as the block for the branch on line 2854.(8Ҏ/
+R
+java:S1066"/Merge this if statement with the enclosing one.(8/
+Z
+java:S1854" java:S1082")Either remove or fill this block of code.(
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/8/2/82904c6777c7e5056541f9ca3eb69e668699df0f b/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/8/2/82904c6777c7e5056541f9ca3eb69e668699df0f
new file mode 100644
index 0000000..a8a52fe
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/8/2/82904c6777c7e5056541f9ca3eb69e668699df0f
@@ -0,0 +1,43 @@
+
+
+java:S1319"sThe type of the "sdtiming" object should be an interface such as "List" rather than the implementation "ArrayList".(
+2
+java:S1643]"Use a StringBuilder instead.(Ц
+2
+java:S1643d"Use a StringBuilder instead.(Ц
+2
+java:S1643k"Use a StringBuilder instead.(Ц
+2
+java:S1643r"Use a StringBuilder instead.(Ц
+2
+java:S1643y"Use a StringBuilder instead.(Ц
+3
+java:S1643"Use a StringBuilder instead.(Ц
+3
+java:S1643"Use a StringBuilder instead.(Ц
+o
+java:S1104"TMake sdtiming a static final constant or non-public and provide accessors if needed.(
+P
+java:S1128"5Remove this unused import 'android.widget.ImageView'.(
+H
+java:S1128
+"-Remove this unused import 'android.util.Log'.(Ԧز
+k
+java:S1450"URemove the "holder" field and declare it as a local variable in the relevant methods.(
+M
+java:S1135"2Complete the task associated to this TODO comment.(
+t
+java:S2293"YReplace the type specification in this constructor call with the diamond operator ("<>").(¸
+M
+java:S1135!"2Complete the task associated to this TODO comment.(
+M
+java:S1135'"2Complete the task associated to this TODO comment.(
+M
+java:S1135-"2Complete the task associated to this TODO comment.(
+M
+java:S11353"2Complete the task associated to this TODO comment.(
+Q java:S125K"").(ׅ
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/8/5/85b0da90763b9c341d29af07bc3609e5dd6cd00a b/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/8/5/85b0da90763b9c341d29af07bc3609e5dd6cd00a
new file mode 100644
index 0000000..0a37ea4
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/8/5/85b0da90763b9c341d29af07bc3609e5dd6cd00a
@@ -0,0 +1,27 @@
+
+Y
+java:S1444
">Make this "public static BAND_APP_PUSH_BY_DEVICES" field final(
+
+java:S1104
"dMake BAND_APP_PUSH_BY_DEVICES a static final constant or non-public and provide accessors if needed.(
+h
+java:S3008"RRename this field "GETINFO" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ݖ
+
+java:S3008"eRename this field "UNBAND_APP_PUSH_BY_DEVICES" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+[
+java:S1444"@Make this "public static UNBAND_APP_PUSH_BY_DEVICES" field final(
+~
+java:S3008
"cRename this field "BAND_APP_PUSH_BY_DEVICES" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+U
+java:S1118":Add a private constructor to hide the implicit public one.(
+q
+java:S3008"VRename this field "SETLANGUAGE" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+
+java:S1104"fMake UNBAND_APP_PUSH_BY_DEVICES a static final constant or non-public and provide accessors if needed.(
+L
+java:S1444"1Make this "public static SETLANGUAGE" field final(
+i
+java:S1104"SMake GETINFO a static final constant or non-public and provide accessors if needed.(ݖ
+C
+java:S1444"-Make this "public static GETINFO" field final(ݖ
+r
+java:S1104"WMake SETLANGUAGE a static final constant or non-public and provide accessors if needed.(
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/8/c/8c55c3ccc257e5907959013f99656e4c8ec3903e b/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/8/c/8c55c3ccc257e5907959013f99656e4c8ec3903e
new file mode 100644
index 0000000..e69de29
diff --git a/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/9/d/9db4dcfc654560dd64f46fd404141eefdb7fd1a5 b/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/9/d/9db4dcfc654560dd64f46fd404141eefdb7fd1a5
new file mode 100644
index 0000000..e69de29
diff --git a/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/a/c/ac8476112eaf217616d7457bc789bdaf85f2d5c8 b/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/a/c/ac8476112eaf217616d7457bc789bdaf85f2d5c8
new file mode 100644
index 0000000..57f8d0d
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/a/c/ac8476112eaf217616d7457bc789bdaf85f2d5c8
@@ -0,0 +1,192 @@
+
+F
+java:S3740"/Provide the parametrized type for this generic.(Ӑ
+V java:S110%"Use isEmpty() to check whether the collection is empty or not.(觼
+U
+java:S1155">Use isEmpty() to check whether the collection is empty or not.(
+Z
+java:S1155">Use isEmpty() to check whether the collection is empty or not.(Җ
+O
+java:S4973M"9Use the "equals" method if value comparison was intended.(
+o
+java:S1488"YImmediately return this expression instead of assigning it to the temporary variable "m".(
+u
+java:S1488"YImmediately return this expression instead of assigning it to the temporary variable "h".(
+G
+java:S1128"1Remove this unused import 'android.app.Activity'.(
+v
+java:S1450'"`Remove the "timing_backlayout" field and declare it as a local variable in the relevant methods.(
+w
+java:S14502"aRemove the "timing_edit_layout" field and declare it as a local variable in the relevant methods.(
+u
+java:S1450+"ZRemove the "timing_save" field and declare it as a local variable in the relevant methods.(
+}
+java:S1450+"bRemove the "timing_start_delete" field and declare it as a local variable in the relevant methods.(
+{
+java:S1450+"`Remove the "timing_start_save" field and declare it as a local variable in the relevant methods.(
+{
+java:S14503"fRemove the "tv_camera_timingaddplan" field and declare it as a local variable in the relevant methods.(5
+D
+java:S1659(".Declare "timing_textView2" on a separate line.(
+K
+java:S1659)"0Declare "timing_timePicker2" on a separate line.(
+C
+java:S1659*"(Declare "timing_id2" on a separate line.(נ
+C
+java:S1659*"(Declare "timing_id3" on a separate line.(נ
+C
+java:S1659*"(Declare "timing_id4" on a separate line.(נ
+C
+java:S1659*"(Declare "timing_id5" on a separate line.(נ
+C
+java:S1659*"(Declare "timing_id6" on a separate line.(נ
+C
+java:S1659*"(Declare "timing_id7" on a separate line.(נ
+J
+java:S1659+"/Declare "timing_start_save" on a separate line.(
+D
+java:S1659+")Declare "timing_save" on a separate line.(
+;
+java:S1659,"%Declare "endTime" on a separate line.(
+7
+java:S16590"!Declare "key" on a separate line.(
+E
+java:S1659")Declare "passEndTime" on a separate line.(
+q java:S116'"\Rename this field "timing_backlayout" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+p java:S116("[Rename this field "timing_textView1" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+p java:S116("[Rename this field "timing_textView2" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+w java:S116)"]Rename this field "timing_timePicker1" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+w java:S116)"]Rename this field "timing_timePicker2" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+o java:S116*"URename this field "timing_id1" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(נ
+o java:S116*"URename this field "timing_id2" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(נ
+o java:S116*"URename this field "timing_id3" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(נ
+o java:S116*"URename this field "timing_id4" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(נ
+o java:S116*"URename this field "timing_id5" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(נ
+o java:S116*"URename this field "timing_id6" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(נ
+o java:S116*"URename this field "timing_id7" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(נ
+x java:S116+"^Rename this field "timing_start_delete" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+v java:S116+"\Rename this field "timing_start_save" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+p java:S116+"VRename this field "timing_save" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+r java:S1162"]Rename this field "timing_edit_layout" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+v java:S1163"bRename this field "tv_camera_timingaddplan" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(5
+M
+java:S11357"2Complete the task associated to this TODO comment.(
+M
+java:S1135@"2Complete the task associated to this TODO comment.(
+t
+java:S2293F"YReplace the type specification in this constructor call with the diamond operator ("<>").(
+M
+java:S1135J"2Complete the task associated to this TODO comment.(
+m
+java:S3776Y"RRefactor this method to reduce its Cognitive Complexity from 20 to the 15 allowed.(
+Q
+java:S1874s"6Remove this use of "setCurrentHour"; it is deprecated.(ܥ
+N
+java:S1874t"8Remove this use of "setCurrentMinute"; it is deprecated.(
+P
+java:S1854y":Remove this useless assignment to local variable "myHour".(
+R
+java:S1854x"").(
+n
+java:S3776"RRefactor this method to reduce its Cognitive Complexity from 43 to the 15 allowed.(
+N
+java:S1135"2Complete the task associated to this TODO comment.(
+M
+java:S1905"1Remove this unnecessary cast to "CompoundButton".(ţ
+G
+java:S1874"0Remove this use of "getColor"; it is deprecated.(ך
+G
+java:S1874"0Remove this use of "getColor"; it is deprecated.(ך
+L
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+L
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+G
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+G
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+L
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+L
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+L
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+L
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+G
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+G
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+L
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+L
+java:S1874"0Remove this use of "getColor"; it is deprecated.(
+N
+java:S1135"2Complete the task associated to this TODO comment.(
+R java:S125"
+java:S1185B"(Remove this method to simply inherit it.(
+?
+java:S1659")Declare "alarm_Relat" on a separate line.(
+a java:S128e"LEnd this switch case with an unconditional break, return or throw statement.(
+M
+java:S1135J"2Complete the task associated to this TODO comment.(
+o
+java:S1450"YRemove the "cameraName" field and declare it as a local variable in the relevant methods.(
+<
+java:S1659"&Declare "sd_Relat" on a separate line.(
+M
+java:S1135""2Complete the task associated to this TODO comment.(
+@
+java:S1068"*Remove this unused "strDID" private field.(
+C
+java:S1068"-Remove this unused "cameraPwd" private field.(
+D
+java:S1068".Remove this unused "cameraName" private field.(
+h java:S116"SRename this field "sd_Relat" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S116"TRename this field "pwd_Relat" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+k java:S116"VRename this field "alarm_Relat" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+p
+java:S1450"ZRemove the "alarm_Relat" field and declare it as a local variable in the relevant methods.(
+m
+java:S1450"WRemove the "back_btn" field and declare it as a local variable in the relevant methods.(ȴ
+n
+java:S1450"XRemove the "cameraPwd" field and declare it as a local variable in the relevant methods.(
+M
+java:S1135C"2Complete the task associated to this TODO comment.(
+k
+java:S1450"URemove the "strDID" field and declare it as a local variable in the relevant methods.(
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/e/0/e03bc3148ee143059a683e01f85f480a2171362a b/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/e/0/e03bc3148ee143059a683e01f85f480a2171362a
new file mode 100644
index 0000000..c061f81
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/e/0/e03bc3148ee143059a683e01f85f480a2171362a
@@ -0,0 +1,4 @@
+
+P
+java:S1118
+":Add a private constructor to hide the implicit public one.(Х
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/e/4/e47f4c03ffff9e91dd8110623e9e0fd696292d6f b/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/e/4/e47f4c03ffff9e91dd8110623e9e0fd696292d6f
new file mode 100644
index 0000000..b930c8e
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/e/4/e47f4c03ffff9e91dd8110623e9e0fd696292d6f
@@ -0,0 +1,38 @@
+
+e
+java:S1192"IDefine a constant instead of duplicating this literal " where " 4 times.(
+m
+java:S1192@"RDefine a constant instead of duplicating this literal " text not null, " 10 times.(Ї
+d
+java:S1192>"NDefine a constant instead of duplicating this literal "create table " 5 times.(
+c
+java:S1192"GDefine a constant instead of duplicating this literal "' and " 6 times.(
+
+java:S1192V"eDefine a constant instead of duplicating this literal " integer primary key autoincrement, " 3 times.(
+_
+java:S1192"HDefine a constant instead of duplicating this literal "=? and " 6 times.(
+k
+java:S1192"ODefine a constant instead of duplicating this literal "select * from " 4 times.(
+T java:S106"9Replace this use of System.out or System.err by a logger.(
+
+java:S1130"hRemove the declaration of thrown exception 'android.database.SQLException' which is a runtime exception.(
+R
+java:S1854";Remove this useless assignment to local variable "delete2".(
+V
+java:S1854":Remove this useless assignment to local variable "delete".(
+Q
+java:S1854":Remove this useless assignment to local variable "count2".(̒
+Q
+java:S1854":Remove this useless assignment to local variable "count1".(핋
+~
+java:S1130"hRemove the declaration of thrown exception 'android.database.SQLException' which is a runtime exception.(z
+G
+java:S1172"+Remove this unused method parameter "type".(
+B
+java:S1481"+Remove this unused "count1" local variable.(핋
+B
+java:S1481"+Remove this unused "count2" local variable.(̒
+G
+java:S1481"+Remove this unused "delete" local variable.(
+C
+java:S1481",Remove this unused "delete2" local variable.(
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/e/9/e9159e120bf20ddae4697bb3f85bd0e6557a5ae7 b/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/e/9/e9159e120bf20ddae4697bb3f85bd0e6557a5ae7
new file mode 100644
index 0000000..b2f3759
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/e/9/e9159e120bf20ddae4697bb3f85bd0e6557a5ae7
@@ -0,0 +1,55 @@
+
+P
+java:S11618":Add the "@Override" annotation above this method signature(
+W java:S125"Rename "sensortype" which hides the field declared at line 39.(И
+Q
+java:S1161":Add the "@Override" annotation above this method signature(
+8
+java:S1116"Remove this empty statement.(
+N
+java:S1135"2Complete the task associated to this TODO comment.(
+T java:S106"9Replace this use of System.out or System.err by a logger.(
+A
+java:S1068!"+Remove this unused "tv_note" private field.(ڂ
+C
+java:S1144",Remove this unused private "reStart" method.(
+I
+java:S1144"2Remove this unused private "setSensorName" method.(
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/f/0/f07866736216be0ee2aba49e392191aeae700a35 b/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/f/0/f07866736216be0ee2aba49e392191aeae700a35
new file mode 100644
index 0000000..e69de29
diff --git a/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/f/4/f4a01d6a4fcb971362ec00a83903fd3902f52164 b/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/f/4/f4a01d6a4fcb971362ec00a83903fd3902f52164
new file mode 100644
index 0000000..e69de29
diff --git a/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/f/9/f98f2ac9d2c2c8d9fc73c7c347fa56dd627bd200 b/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/f/9/f98f2ac9d2c2c8d9fc73c7c347fa56dd627bd200
new file mode 100644
index 0000000..942c025
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/sonarlint/issuestore/f/9/f98f2ac9d2c2c8d9fc73c7c347fa56dd627bd200
@@ -0,0 +1,12 @@
+
+U
+java:S1135"2Complete the task associated to this TODO comment.(̐8/
+J
+java:S1172",Remove this unused method parameter "mSize".(8/
+d
+java:S2142"FEither re-interrupt this method or rethrow the "InterruptedException".(䠹8/
+f
+java:S2276"CReplace the call to "Thread.sleep(...)" with a call to "wait(...)".(8/
+^ java:S125"app/src/main/java/com/ipcamera/detect/SettingUserActivity.java,e\9\e9159e120bf20ddae4697bb3f85bd0e6557a5ae7
+e
+5app/src/main/java/com/ipcamera/detect/MyListView.java,b\5\b5bbb0f395b07555133eef31cb79afc9406d5f69
+l
+app/src/main/java/com/ipcamera/detect/utils/ContentCommon.java,1\3\13f7c5b0fe9c75dbbfe98fc36560bf495e6472c3
+j
+:app/src/main/java/com/ipcamera/detect/MessageActivity.java,3\2\32334f3aed5703c763dbef974f9b1a94b2ebff8b
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/.idea/workspace.xml b/src/Driving_Reminder_Assistant/.idea/workspace.xml
new file mode 100644
index 0000000..8f462af
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/.idea/workspace.xml
@@ -0,0 +1,362 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1574163157906
+
+
+ 1574163157906
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ file://$PROJECT_DIR$/app/src/main/java/com/ipcamera/demo/AddCameraActivity.java
+ 448
+
+
+
+ file://$PROJECT_DIR$/app/src/main/java/com/ipcamera/detect/PlayActivity.java
+ 2789
+
+
+
+ file://$PROJECT_DIR$/app/src/main/java/com/ipcamera/detect/PlayActivity.java
+ 2596
+
+
+
+ file://$PROJECT_DIR$/app/src/main/java/com/ipcamera/detect/PlayActivity.java
+ 2850
+
+
+
+ file://$PROJECT_DIR$/app/src/main/java/com/ipcamera/demo/AddCameraActivity.java
+ 380
+
+
+
+ file://$PROJECT_DIR$/app/src/main/java/com/ipcamera/detect/PlayActivity.java
+ 1686
+
+
+
+
+
+
+
+
+
+
+ 1.8
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/.DS_Store b/src/Driving_Reminder_Assistant/app/.DS_Store
new file mode 100644
index 0000000..93eb4b3
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/.DS_Store differ
diff --git a/src/Driving_Reminder_Assistant/app/build.gradle b/src/Driving_Reminder_Assistant/app/build.gradle
new file mode 100644
index 0000000..b4aee5f
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/build.gradle
@@ -0,0 +1,70 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 28
+ buildToolsVersion "28.0.3"
+ useLibrary 'org.apache.http.legacy'
+ aaptOptions.cruncherEnabled = false
+ aaptOptions.useNewCruncher = false
+ defaultConfig {
+ applicationId "com.ipcamer.detect"
+ minSdkVersion 19
+ targetSdkVersion 28
+ manifestPlaceholders = [
+ GETUI_APP_ID : "9e8ate29YR6eb948bVlTk4",
+ GETUI_APP_KEY : "bThEinZWlVA3yEHhhtHwH1",
+ GETUI_APP_SECRET: "JQmHj8QvmL776e5qwRgUz8"
+ ]
+
+ ndk {
+ abiFilters "armeabi", "armeabi-v7a","arm64-v8a"
+ }
+ }
+ aaptOptions {
+ cruncherEnabled = false
+ useNewCruncher = false
+ }
+
+ buildTypes {
+ release {
+ lintOptions {
+ checkReleaseBuilds false
+ abortOnError false
+ }
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
+ }
+ }
+ productFlavors {
+ }
+
+ packagingOptions {
+ exclude 'META-INF/LICENSE.txt'
+ exclude 'META-INF/NOTICE.txt'
+ }
+}
+
+repositories {
+ maven {
+ url 'https://google.bintray.com/tensorflow'
+ }
+}
+
+dependencies {
+ // implementation fileTree(include: ['*.jar'], dir: 'libs')
+ implementation 'com.tengine.tenginekit:core:0.0.4'
+ implementation 'com.tengine.tenginekit:face:0.0.3'
+
+ implementation 'androidx.annotation:annotation:1.0.0'
+ implementation 'androidx.legacy:legacy-support-v4:1.0.0'
+ implementation 'androidx.appcompat:appcompat:1.0.0'
+ implementation 'com.squareup.okhttp3:okhttp:3.8.1'
+ implementation 'com.google.code.gson:gson:2.7'
+ implementation 'org.tensorflow:tensorflow-android:+'
+ compile files('libs/GetuiSDK4.3.5.6.jar')
+ compile files('libs/json_simple-1.1.jar')
+ //compile files('libs/okhttp-3.8.1.jar')
+ //compile files('libs/okio-1.13.0.jar')
+ //compile 'org.tensorflow:tensorflow-lite:+'
+
+}
diff --git a/src/Driving_Reminder_Assistant/app/libs/.DS_Store b/src/Driving_Reminder_Assistant/app/libs/.DS_Store
new file mode 100644
index 0000000..5008ddf
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/libs/.DS_Store differ
diff --git a/src/Driving_Reminder_Assistant/app/libs/GetuiSDK4.3.5.6.jar b/src/Driving_Reminder_Assistant/app/libs/GetuiSDK4.3.5.6.jar
new file mode 100644
index 0000000..e846cb1
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/libs/GetuiSDK4.3.5.6.jar differ
diff --git a/src/Driving_Reminder_Assistant/app/libs/json_simple-1.1.jar b/src/Driving_Reminder_Assistant/app/libs/json_simple-1.1.jar
new file mode 100644
index 0000000..f395f41
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/libs/json_simple-1.1.jar differ
diff --git a/src/Driving_Reminder_Assistant/app/libs/okhttp-3.8.1.jar b/src/Driving_Reminder_Assistant/app/libs/okhttp-3.8.1.jar
new file mode 100644
index 0000000..aaaf982
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/libs/okhttp-3.8.1.jar differ
diff --git a/src/Driving_Reminder_Assistant/app/libs/okio-1.13.0.jar b/src/Driving_Reminder_Assistant/app/libs/okio-1.13.0.jar
new file mode 100644
index 0000000..f5dd48b
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/libs/okio-1.13.0.jar differ
diff --git a/src/Driving_Reminder_Assistant/app/release/.DS_Store b/src/Driving_Reminder_Assistant/app/release/.DS_Store
new file mode 100644
index 0000000..5008ddf
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/release/.DS_Store differ
diff --git a/src/Driving_Reminder_Assistant/app/release/output.json b/src/Driving_Reminder_Assistant/app/release/output.json
new file mode 100644
index 0000000..c429e31
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/release/output.json
@@ -0,0 +1 @@
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/.DS_Store b/src/Driving_Reminder_Assistant/app/src/.DS_Store
new file mode 100644
index 0000000..226fdea
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/.DS_Store differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/.DS_Store b/src/Driving_Reminder_Assistant/app/src/main/.DS_Store
new file mode 100644
index 0000000..e7d2e64
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/.DS_Store differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/AndroidManifest.xml b/src/Driving_Reminder_Assistant/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..30e94cd
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/AndroidManifest.xml
@@ -0,0 +1,119 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/BUILD b/src/Driving_Reminder_Assistant/app/src/main/BUILD
new file mode 100644
index 0000000..654fa9d
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/BUILD
@@ -0,0 +1,41 @@
+package(default_visibility = ["//visibility:private"])
+
+licenses(["notice"]) # Apache 2.0
+
+android_binary(
+ name = "TfLiteCameraDemo",
+ srcs = glob(["java/**/*.java"]),
+ assets = [
+ "@tflite_mobilenet//:labels.txt",
+ "@tflite_mobilenet//:mobilenet_quant_v1_224.tflite",
+ ],
+ assets_dir = "",
+ custom_package = "com.example.android.tflitecamerademo",
+ manifest = "AndroidManifest.xml",
+ nocompress_extensions = [
+ ".tflite",
+ ],
+ resource_files = glob(["res/**"]),
+ # In some platforms we don't have an Android SDK/NDK and this target
+ # can't be built. We need to prevent the build system from trying to
+ # use the target in that case.
+ tags = ["manual"],
+ deps = [
+ "//tensorflow/contrib/lite/java:tensorflowlite",
+ "//tensorflow/contrib/lite/java/src/testhelper/java/org/tensorflow/lite:testhelper",
+ "@androidsdk//com.android.support:support-v13-25.2.0",
+ "@androidsdk//com.android.support:support-v4-25.2.0",
+ ],
+)
+
+filegroup(
+ name = "all_files",
+ srcs = glob(
+ ["**/*"],
+ exclude = [
+ "**/METADATA",
+ "**/OWNERS",
+ ],
+ ),
+ visibility = ["//tensorflow:__subpackages__"],
+)
diff --git a/src/Driving_Reminder_Assistant/app/src/main/assets/64model2.pb b/src/Driving_Reminder_Assistant/app/src/main/assets/64model2.pb
new file mode 100644
index 0000000..5dd8248
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/assets/64model2.pb differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/assets/BUILD b/src/Driving_Reminder_Assistant/app/src/main/assets/BUILD
new file mode 100644
index 0000000..dd0cd6c
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/assets/BUILD
@@ -0,0 +1,24 @@
+package(default_visibility = ["//visibility:private"])
+
+licenses(["notice"]) # Apache 2.0
+
+exports_files(
+ glob(
+ ["**/*"],
+ exclude = [
+ "BUILD",
+ ],
+ ),
+)
+
+filegroup(
+ name = "all_files",
+ srcs = glob(
+ ["**/*"],
+ exclude = [
+ "**/METADATA",
+ "**/OWNERS",
+ ],
+ ),
+ visibility = ["//tensorflow:__subpackages__"],
+)
diff --git a/src/Driving_Reminder_Assistant/app/src/main/assets/car_and_line.pb b/src/Driving_Reminder_Assistant/app/src/main/assets/car_and_line.pb
new file mode 100644
index 0000000..9b2b8c2
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/assets/car_and_line.pb differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/assets/coco_labels_list.txt b/src/Driving_Reminder_Assistant/app/src/main/assets/coco_labels_list.txt
new file mode 100644
index 0000000..58b4665
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/assets/coco_labels_list.txt
@@ -0,0 +1,91 @@
+???
+openeyes
+closeeyes
+phone
+smoke
+safety_belt
+other
+train
+truck
+boat
+traffic light
+fire hydrant
+???
+stop sign
+parking meter
+bench
+bird
+cat
+dog
+horse
+sheep
+cow
+elephant
+bear
+zebra
+giraffe
+???
+backpack
+umbrella
+???
+???
+handbag
+tie
+suitcase
+frisbee
+skis
+snowboard
+sports ball
+kite
+baseball bat
+baseball glove
+skateboard
+surfboard
+tennis racket
+bottle
+???
+wine glass
+cup
+fork
+knife
+spoon
+bowl
+banana
+apple
+sandwich
+orange
+broccoli
+carrot
+hot dog
+pizza
+donut
+cake
+chair
+couch
+potted plant
+bed
+???
+dining table
+???
+???
+toilet
+???
+tv
+laptop
+mouse
+remote
+keyboard
+cell phone
+microwave
+oven
+toaster
+sink
+refrigerator
+???
+book
+clock
+vase
+scissors
+teddy bear
+hair drier
+toothbrush
diff --git a/src/Driving_Reminder_Assistant/app/src/main/assets/frozen_inference_graph_v6.pb b/src/Driving_Reminder_Assistant/app/src/main/assets/frozen_inference_graph_v6.pb
new file mode 100644
index 0000000..9a6d831
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/assets/frozen_inference_graph_v6.pb differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/assets/graph_opt.pb b/src/Driving_Reminder_Assistant/app/src/main/assets/graph_opt.pb
new file mode 100644
index 0000000..7969ace
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/assets/graph_opt.pb differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/assets/labels.txt b/src/Driving_Reminder_Assistant/app/src/main/assets/labels.txt
new file mode 100644
index 0000000..fe81123
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/assets/labels.txt
@@ -0,0 +1,1001 @@
+background
+tench
+goldfish
+great white shark
+tiger shark
+hammerhead
+electric ray
+stingray
+cock
+hen
+ostrich
+brambling
+goldfinch
+house finch
+junco
+indigo bunting
+robin
+bulbul
+jay
+magpie
+chickadee
+water ouzel
+kite
+bald eagle
+vulture
+great grey owl
+European fire salamander
+common newt
+eft
+spotted salamander
+axolotl
+bullfrog
+tree frog
+tailed frog
+loggerhead
+leatherback turtle
+mud turtle
+terrapin
+box turtle
+banded gecko
+common iguana
+American chameleon
+whiptail
+agama
+frilled lizard
+alligator lizard
+Gila monster
+green lizard
+African chameleon
+Komodo dragon
+African crocodile
+American alligator
+triceratops
+thunder snake
+ringneck snake
+hognose snake
+green snake
+king snake
+garter snake
+water snake
+vine snake
+night snake
+boa constrictor
+rock python
+Indian cobra
+green mamba
+sea snake
+horned viper
+diamondback
+sidewinder
+trilobite
+harvestman
+scorpion
+black and gold garden spider
+barn spider
+garden spider
+black widow
+tarantula
+wolf spider
+tick
+centipede
+black grouse
+ptarmigan
+ruffed grouse
+prairie chicken
+peacock
+quail
+partridge
+African grey
+macaw
+sulphur-crested cockatoo
+lorikeet
+coucal
+bee eater
+hornbill
+hummingbird
+jacamar
+toucan
+drake
+red-breasted merganser
+goose
+black swan
+tusker
+echidna
+platypus
+wallaby
+koala
+wombat
+jellyfish
+sea anemone
+brain coral
+flatworm
+nematode
+conch
+snail
+slug
+sea slug
+chiton
+chambered nautilus
+Dungeness crab
+rock crab
+fiddler crab
+king crab
+American lobster
+spiny lobster
+crayfish
+hermit crab
+isopod
+white stork
+black stork
+spoonbill
+flamingo
+little blue heron
+American egret
+bittern
+crane
+limpkin
+European gallinule
+American coot
+bustard
+ruddy turnstone
+red-backed sandpiper
+redshank
+dowitcher
+oystercatcher
+pelican
+king penguin
+albatross
+grey whale
+killer whale
+dugong
+sea lion
+Chihuahua
+Japanese spaniel
+Maltese dog
+Pekinese
+Shih-Tzu
+Blenheim spaniel
+papillon
+toy terrier
+Rhodesian ridgeback
+Afghan hound
+basset
+beagle
+bloodhound
+bluetick
+black-and-tan coonhound
+Walker hound
+English foxhound
+redbone
+borzoi
+Irish wolfhound
+Italian greyhound
+whippet
+Ibizan hound
+Norwegian elkhound
+otterhound
+Saluki
+Scottish deerhound
+Weimaraner
+Staffordshire bullterrier
+American Staffordshire terrier
+Bedlington terrier
+Border terrier
+Kerry blue terrier
+Irish terrier
+Norfolk terrier
+Norwich terrier
+Yorkshire terrier
+wire-haired fox terrier
+Lakeland terrier
+Sealyham terrier
+Airedale
+cairn
+Australian terrier
+Dandie Dinmont
+Boston bull
+miniature schnauzer
+giant schnauzer
+standard schnauzer
+Scotch terrier
+Tibetan terrier
+silky terrier
+soft-coated wheaten terrier
+West Highland white terrier
+Lhasa
+flat-coated retriever
+curly-coated retriever
+golden retriever
+Labrador retriever
+Chesapeake Bay retriever
+German short-haired pointer
+vizsla
+English setter
+Irish setter
+Gordon setter
+Brittany spaniel
+clumber
+English springer
+Welsh springer spaniel
+cocker spaniel
+Sussex spaniel
+Irish water spaniel
+kuvasz
+schipperke
+groenendael
+malinois
+briard
+kelpie
+komondor
+Old English sheepdog
+Shetland sheepdog
+collie
+Border collie
+Bouvier des Flandres
+Rottweiler
+German shepherd
+Doberman
+miniature pinscher
+Greater Swiss Mountain dog
+Bernese mountain dog
+Appenzeller
+EntleBucher
+boxer
+bull mastiff
+Tibetan mastiff
+French bulldog
+Great Dane
+Saint Bernard
+Eskimo dog
+malamute
+Siberian husky
+dalmatian
+affenpinscher
+basenji
+pug
+Leonberg
+Newfoundland
+Great Pyrenees
+Samoyed
+Pomeranian
+chow
+keeshond
+Brabancon griffon
+Pembroke
+Cardigan
+toy poodle
+miniature poodle
+standard poodle
+Mexican hairless
+timber wolf
+white wolf
+red wolf
+coyote
+dingo
+dhole
+African hunting dog
+hyena
+red fox
+kit fox
+Arctic fox
+grey fox
+tabby
+tiger cat
+Persian cat
+Siamese cat
+Egyptian cat
+cougar
+lynx
+leopard
+snow leopard
+jaguar
+lion
+tiger
+cheetah
+brown bear
+American black bear
+ice bear
+sloth bear
+mongoose
+meerkat
+tiger beetle
+ladybug
+ground beetle
+long-horned beetle
+leaf beetle
+dung beetle
+rhinoceros beetle
+weevil
+fly
+bee
+ant
+grasshopper
+cricket
+walking stick
+cockroach
+mantis
+cicada
+leafhopper
+lacewing
+dragonfly
+damselfly
+admiral
+ringlet
+monarch
+cabbage butterfly
+sulphur butterfly
+lycaenid
+starfish
+sea urchin
+sea cucumber
+wood rabbit
+hare
+Angora
+hamster
+porcupine
+fox squirrel
+marmot
+beaver
+guinea pig
+sorrel
+zebra
+hog
+wild boar
+warthog
+hippopotamus
+ox
+water buffalo
+bison
+ram
+bighorn
+ibex
+hartebeest
+impala
+gazelle
+Arabian camel
+llama
+weasel
+mink
+polecat
+black-footed ferret
+otter
+skunk
+badger
+armadillo
+three-toed sloth
+orangutan
+gorilla
+chimpanzee
+gibbon
+siamang
+guenon
+patas
+baboon
+macaque
+langur
+colobus
+proboscis monkey
+marmoset
+capuchin
+howler monkey
+titi
+spider monkey
+squirrel monkey
+Madagascar cat
+indri
+Indian elephant
+African elephant
+lesser panda
+giant panda
+barracouta
+eel
+coho
+rock beauty
+anemone fish
+sturgeon
+gar
+lionfish
+puffer
+abacus
+abaya
+academic gown
+accordion
+acoustic guitar
+aircraft carrier
+airliner
+airship
+altar
+ambulance
+amphibian
+analog clock
+apiary
+apron
+ashcan
+assault rifle
+backpack
+bakery
+balance beam
+balloon
+ballpoint
+Band Aid
+banjo
+bannister
+barbell
+barber chair
+barbershop
+barn
+barometer
+barrel
+barrow
+baseball
+basketball
+bassinet
+bassoon
+bathing cap
+bath towel
+bathtub
+beach wagon
+beacon
+beaker
+bearskin
+beer bottle
+beer glass
+bell cote
+bib
+bicycle-built-for-two
+bikini
+binder
+binoculars
+birdhouse
+boathouse
+bobsled
+bolo tie
+bonnet
+bookcase
+bookshop
+bottlecap
+bow
+bow tie
+brass
+brassiere
+breakwater
+breastplate
+broom
+bucket
+buckle
+bulletproof vest
+bullet train
+butcher shop
+cab
+caldron
+candle
+cannon
+canoe
+can opener
+cardigan
+car mirror
+carousel
+carpenter's kit
+carton
+car wheel
+cash machine
+cassette
+cassette player
+castle
+catamaran
+CD player
+cello
+cellular telephone
+chain
+chainlink fence
+chain mail
+chain saw
+chest
+chiffonier
+chime
+china cabinet
+Christmas stocking
+church
+cinema
+cleaver
+cliff dwelling
+cloak
+clog
+cocktail shaker
+coffee mug
+coffeepot
+coil
+combination lock
+computer keyboard
+confectionery
+container ship
+convertible
+corkscrew
+cornet
+cowboy boot
+cowboy hat
+cradle
+crane
+crash helmet
+crate
+crib
+Crock Pot
+croquet ball
+crutch
+cuirass
+dam
+desk
+desktop computer
+dial telephone
+diaper
+digital clock
+digital watch
+dining table
+dishrag
+dishwasher
+disk brake
+dock
+dogsled
+dome
+doormat
+drilling platform
+drum
+drumstick
+dumbbell
+Dutch oven
+electric fan
+electric guitar
+electric locomotive
+entertainment center
+envelope
+espresso maker
+face powder
+feather boa
+file
+fireboat
+fire engine
+fire screen
+flagpole
+flute
+folding chair
+football helmet
+forklift
+fountain
+fountain pen
+four-poster
+freight car
+French horn
+frying pan
+fur coat
+garbage truck
+gasmask
+gas pump
+goblet
+go-kart
+golf ball
+golfcart
+gondola
+gong
+gown
+grand piano
+greenhouse
+grille
+grocery store
+guillotine
+hair slide
+hair spray
+half track
+hammer
+hamper
+hand blower
+hand-held computer
+handkerchief
+hard disc
+harmonica
+harp
+harvester
+hatchet
+holster
+home theater
+honeycomb
+hook
+hoopskirt
+horizontal bar
+horse cart
+hourglass
+iPod
+iron
+jack-o'-lantern
+jean
+jeep
+jersey
+jigsaw puzzle
+jinrikisha
+joystick
+kimono
+knee pad
+knot
+lab coat
+ladle
+lampshade
+laptop
+lawn mower
+lens cap
+letter opener
+library
+lifeboat
+lighter
+limousine
+liner
+lipstick
+Loafer
+lotion
+loudspeaker
+loupe
+lumbermill
+magnetic compass
+mailbag
+mailbox
+maillot
+maillot
+manhole cover
+maraca
+marimba
+mask
+matchstick
+maypole
+maze
+measuring cup
+medicine chest
+megalith
+microphone
+microwave
+military uniform
+milk can
+minibus
+miniskirt
+minivan
+missile
+mitten
+mixing bowl
+mobile home
+Model T
+modem
+monastery
+monitor
+moped
+mortar
+mortarboard
+mosque
+mosquito net
+motor scooter
+mountain bike
+mountain tent
+mouse
+mousetrap
+moving van
+muzzle
+nail
+neck brace
+necklace
+nipple
+notebook
+obelisk
+oboe
+ocarina
+odometer
+oil filter
+organ
+oscilloscope
+overskirt
+oxcart
+oxygen mask
+packet
+paddle
+paddlewheel
+padlock
+paintbrush
+pajama
+palace
+panpipe
+paper towel
+parachute
+parallel bars
+park bench
+parking meter
+passenger car
+patio
+pay-phone
+pedestal
+pencil box
+pencil sharpener
+perfume
+Petri dish
+photocopier
+pick
+pickelhaube
+picket fence
+pickup
+pier
+piggy bank
+pill bottle
+pillow
+ping-pong ball
+pinwheel
+pirate
+pitcher
+plane
+planetarium
+plastic bag
+plate rack
+plow
+plunger
+Polaroid camera
+pole
+police van
+poncho
+pool table
+pop bottle
+pot
+potter's wheel
+power drill
+prayer rug
+printer
+prison
+projectile
+projector
+puck
+punching bag
+purse
+quill
+quilt
+racer
+racket
+radiator
+radio
+radio telescope
+rain barrel
+recreational vehicle
+reel
+reflex camera
+refrigerator
+remote control
+restaurant
+revolver
+rifle
+rocking chair
+rotisserie
+rubber eraser
+rugby ball
+rule
+running shoe
+safe
+safety pin
+saltshaker
+sandal
+sarong
+sax
+scabbard
+scale
+school bus
+schooner
+scoreboard
+screen
+screw
+screwdriver
+seat belt
+sewing machine
+shield
+shoe shop
+shoji
+shopping basket
+shopping cart
+shovel
+shower cap
+shower curtain
+ski
+ski mask
+sleeping bag
+slide rule
+sliding door
+slot
+snorkel
+snowmobile
+snowplow
+soap dispenser
+soccer ball
+sock
+solar dish
+sombrero
+soup bowl
+space bar
+space heater
+space shuttle
+spatula
+speedboat
+spider web
+spindle
+sports car
+spotlight
+stage
+steam locomotive
+steel arch bridge
+steel drum
+stethoscope
+stole
+stone wall
+stopwatch
+stove
+strainer
+streetcar
+stretcher
+studio couch
+stupa
+submarine
+suit
+sundial
+sunglass
+sunglasses
+sunscreen
+suspension bridge
+swab
+sweatshirt
+swimming trunks
+swing
+switch
+syringe
+table lamp
+tank
+tape player
+teapot
+teddy
+television
+tennis ball
+thatch
+theater curtain
+thimble
+thresher
+throne
+tile roof
+toaster
+tobacco shop
+toilet seat
+torch
+totem pole
+tow truck
+toyshop
+tractor
+trailer truck
+tray
+trench coat
+tricycle
+trimaran
+tripod
+triumphal arch
+trolleybus
+trombone
+tub
+turnstile
+typewriter keyboard
+umbrella
+unicycle
+upright
+vacuum
+vase
+vault
+velvet
+vending machine
+vestment
+viaduct
+violin
+volleyball
+waffle iron
+wall clock
+wallet
+wardrobe
+warplane
+washbasin
+washer
+water bottle
+water jug
+water tower
+whiskey jug
+whistle
+wig
+window screen
+window shade
+Windsor tie
+wine bottle
+wing
+wok
+wooden spoon
+wool
+worm fence
+wreck
+yawl
+yurt
+web site
+comic book
+crossword puzzle
+street sign
+traffic light
+book jacket
+menu
+plate
+guacamole
+consomme
+hot pot
+trifle
+ice cream
+ice lolly
+French loaf
+bagel
+pretzel
+cheeseburger
+hotdog
+mashed potato
+head cabbage
+broccoli
+cauliflower
+zucchini
+spaghetti squash
+acorn squash
+butternut squash
+cucumber
+artichoke
+bell pepper
+cardoon
+mushroom
+Granny Smith
+strawberry
+orange
+lemon
+fig
+pineapple
+banana
+jackfruit
+custard apple
+pomegranate
+hay
+carbonara
+chocolate sauce
+dough
+meat loaf
+pizza
+potpie
+burrito
+red wine
+espresso
+cup
+eggnog
+alp
+bubble
+cliff
+coral reef
+geyser
+lakeside
+promontory
+sandbar
+seashore
+valley
+volcano
+ballplayer
+groom
+scuba diver
+rapeseed
+daisy
+yellow lady's slipper
+corn
+acorn
+hip
+buckeye
+coral fungus
+agaric
+gyromitra
+stinkhorn
+earthstar
+hen-of-the-woods
+bolete
+ear
+toilet tissue
diff --git a/src/Driving_Reminder_Assistant/app/src/main/assets/labels_imagenet_slim.txt b/src/Driving_Reminder_Assistant/app/src/main/assets/labels_imagenet_slim.txt
new file mode 100644
index 0000000..572eccf
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/assets/labels_imagenet_slim.txt
@@ -0,0 +1,1001 @@
+dummy
+tench
+goldfish
+great white shark
+tiger shark
+hammerhead
+electric ray
+stingray
+cock
+hen
+ostrich
+brambling
+goldfinch
+house finch
+junco
+indigo bunting
+robin
+bulbul
+jay
+magpie
+chickadee
+water ouzel
+kite
+bald eagle
+vulture
+great grey owl
+European fire salamander
+common newt
+eft
+spotted salamander
+axolotl
+bullfrog
+tree frog
+tailed frog
+loggerhead
+leatherback turtle
+mud turtle
+terrapin
+box turtle
+banded gecko
+common iguana
+American chameleon
+whiptail
+agama
+frilled lizard
+alligator lizard
+Gila monster
+green lizard
+African chameleon
+Komodo dragon
+African crocodile
+American alligator
+triceratops
+thunder snake
+ringneck snake
+hognose snake
+green snake
+king snake
+garter snake
+water snake
+vine snake
+night snake
+boa constrictor
+rock python
+Indian cobra
+green mamba
+sea snake
+horned viper
+diamondback
+sidewinder
+trilobite
+harvestman
+scorpion
+black and gold garden spider
+barn spider
+garden spider
+black widow
+tarantula
+wolf spider
+tick
+centipede
+black grouse
+ptarmigan
+ruffed grouse
+prairie chicken
+peacock
+quail
+partridge
+African grey
+macaw
+sulphur-crested cockatoo
+lorikeet
+coucal
+bee eater
+hornbill
+hummingbird
+jacamar
+toucan
+drake
+red-breasted merganser
+goose
+black swan
+tusker
+echidna
+platypus
+wallaby
+koala
+wombat
+jellyfish
+sea anemone
+brain coral
+flatworm
+nematode
+conch
+snail
+slug
+sea slug
+chiton
+chambered nautilus
+Dungeness crab
+rock crab
+fiddler crab
+king crab
+American lobster
+spiny lobster
+crayfish
+hermit crab
+isopod
+white stork
+black stork
+spoonbill
+flamingo
+little blue heron
+American egret
+bittern
+crane
+limpkin
+European gallinule
+American coot
+bustard
+ruddy turnstone
+red-backed sandpiper
+redshank
+dowitcher
+oystercatcher
+pelican
+king penguin
+albatross
+grey whale
+killer whale
+dugong
+sea lion
+Chihuahua
+Japanese spaniel
+Maltese dog
+Pekinese
+Shih-Tzu
+Blenheim spaniel
+papillon
+toy terrier
+Rhodesian ridgeback
+Afghan hound
+basset
+beagle
+bloodhound
+bluetick
+black-and-tan coonhound
+Walker hound
+English foxhound
+redbone
+borzoi
+Irish wolfhound
+Italian greyhound
+whippet
+Ibizan hound
+Norwegian elkhound
+otterhound
+Saluki
+Scottish deerhound
+Weimaraner
+Staffordshire bullterrier
+American Staffordshire terrier
+Bedlington terrier
+Border terrier
+Kerry blue terrier
+Irish terrier
+Norfolk terrier
+Norwich terrier
+Yorkshire terrier
+wire-haired fox terrier
+Lakeland terrier
+Sealyham terrier
+Airedale
+cairn
+Australian terrier
+Dandie Dinmont
+Boston bull
+miniature schnauzer
+giant schnauzer
+standard schnauzer
+Scotch terrier
+Tibetan terrier
+silky terrier
+soft-coated wheaten terrier
+West Highland white terrier
+Lhasa
+flat-coated retriever
+curly-coated retriever
+golden retriever
+Labrador retriever
+Chesapeake Bay retriever
+German short-haired pointer
+vizsla
+English setter
+Irish setter
+Gordon setter
+Brittany spaniel
+clumber
+English springer
+Welsh springer spaniel
+cocker spaniel
+Sussex spaniel
+Irish water spaniel
+kuvasz
+schipperke
+groenendael
+malinois
+briard
+kelpie
+komondor
+Old English sheepdog
+Shetland sheepdog
+collie
+Border collie
+Bouvier des Flandres
+Rottweiler
+German shepherd
+Doberman
+miniature pinscher
+Greater Swiss Mountain dog
+Bernese mountain dog
+Appenzeller
+EntleBucher
+boxer
+bull mastiff
+Tibetan mastiff
+French bulldog
+Great Dane
+Saint Bernard
+Eskimo dog
+malamute
+Siberian husky
+dalmatian
+affenpinscher
+basenji
+pug
+Leonberg
+Newfoundland
+Great Pyrenees
+Samoyed
+Pomeranian
+chow
+keeshond
+Brabancon griffon
+Pembroke
+Cardigan
+toy poodle
+miniature poodle
+standard poodle
+Mexican hairless
+timber wolf
+white wolf
+red wolf
+coyote
+dingo
+dhole
+African hunting dog
+hyena
+red fox
+kit fox
+Arctic fox
+grey fox
+tabby
+tiger cat
+Persian cat
+Siamese cat
+Egyptian cat
+cougar
+lynx
+leopard
+snow leopard
+jaguar
+lion
+tiger
+cheetah
+brown bear
+American black bear
+ice bear
+sloth bear
+mongoose
+meerkat
+tiger beetle
+ladybug
+ground beetle
+long-horned beetle
+leaf beetle
+dung beetle
+rhinoceros beetle
+weevil
+fly
+bee
+ant
+grasshopper
+cricket
+walking stick
+cockroach
+mantis
+cicada
+leafhopper
+lacewing
+dragonfly
+damselfly
+admiral
+ringlet
+monarch
+cabbage butterfly
+sulphur butterfly
+lycaenid
+starfish
+sea urchin
+sea cucumber
+wood rabbit
+hare
+Angora
+hamster
+porcupine
+fox squirrel
+marmot
+beaver
+guinea pig
+sorrel
+zebra
+hog
+wild boar
+warthog
+hippopotamus
+ox
+water buffalo
+bison
+ram
+bighorn
+ibex
+hartebeest
+impala
+gazelle
+Arabian camel
+llama
+weasel
+mink
+polecat
+black-footed ferret
+otter
+skunk
+badger
+armadillo
+three-toed sloth
+orangutan
+gorilla
+chimpanzee
+gibbon
+siamang
+guenon
+patas
+baboon
+macaque
+langur
+colobus
+proboscis monkey
+marmoset
+capuchin
+howler monkey
+titi
+spider monkey
+squirrel monkey
+Madagascar cat
+indri
+Indian elephant
+African elephant
+lesser panda
+giant panda
+barracouta
+eel
+coho
+rock beauty
+anemone fish
+sturgeon
+gar
+lionfish
+puffer
+abacus
+abaya
+academic gown
+accordion
+acoustic guitar
+aircraft carrier
+airliner
+airship
+altar
+ambulance
+amphibian
+analog clock
+apiary
+apron
+ashcan
+assault rifle
+backpack
+bakery
+balance beam
+balloon
+ballpoint
+Band Aid
+banjo
+bannister
+barbell
+barber chair
+barbershop
+barn
+barometer
+barrel
+barrow
+baseball
+basketball
+bassinet
+bassoon
+bathing cap
+bath towel
+bathtub
+beach wagon
+beacon
+beaker
+bearskin
+beer bottle
+beer glass
+bell cote
+bib
+bicycle-built-for-two
+bikini
+binder
+binoculars
+birdhouse
+boathouse
+bobsled
+bolo tie
+bonnet
+bookcase
+bookshop
+bottlecap
+bow
+bow tie
+brass
+brassiere
+breakwater
+breastplate
+broom
+bucket
+buckle
+bulletproof vest
+bullet train
+butcher shop
+cab
+caldron
+candle
+cannon
+canoe
+can opener
+cardigan
+car mirror
+carousel
+carpenter's kit
+carton
+car wheel
+cash machine
+cassette
+cassette player
+castle
+catamaran
+CD player
+cello
+cellular telephone
+chain
+chainlink fence
+chain mail
+chain saw
+chest
+chiffonier
+chime
+china cabinet
+Christmas stocking
+church
+cinema
+cleaver
+cliff dwelling
+cloak
+clog
+cocktail shaker
+coffee mug
+coffeepot
+coil
+combination lock
+computer keyboard
+confectionery
+container ship
+convertible
+corkscrew
+cornet
+cowboy boot
+cowboy hat
+cradle
+crane
+crash helmet
+crate
+crib
+Crock Pot
+croquet ball
+crutch
+cuirass
+dam
+desk
+desktop computer
+dial telephone
+diaper
+digital clock
+digital watch
+dining table
+dishrag
+dishwasher
+disk brake
+dock
+dogsled
+dome
+doormat
+drilling platform
+drum
+drumstick
+dumbbell
+Dutch oven
+electric fan
+electric guitar
+electric locomotive
+entertainment center
+envelope
+espresso maker
+face powder
+feather boa
+file
+fireboat
+fire engine
+fire screen
+flagpole
+flute
+folding chair
+football helmet
+forklift
+fountain
+fountain pen
+four-poster
+freight car
+French horn
+frying pan
+fur coat
+garbage truck
+gasmask
+gas pump
+goblet
+go-kart
+golf ball
+golfcart
+gondola
+gong
+gown
+grand piano
+greenhouse
+grille
+grocery store
+guillotine
+hair slide
+hair spray
+half track
+hammer
+hamper
+hand blower
+hand-held computer
+handkerchief
+hard disc
+harmonica
+harp
+harvester
+hatchet
+holster
+home theater
+honeycomb
+hook
+hoopskirt
+horizontal bar
+horse cart
+hourglass
+iPod
+iron
+jack-o'-lantern
+jean
+jeep
+jersey
+jigsaw puzzle
+jinrikisha
+joystick
+kimono
+knee pad
+knot
+lab coat
+ladle
+lampshade
+laptop
+lawn mower
+lens cap
+letter opener
+library
+lifeboat
+lighter
+limousine
+liner
+lipstick
+Loafer
+lotion
+loudspeaker
+loupe
+lumbermill
+magnetic compass
+mailbag
+mailbox
+maillot
+maillot
+manhole cover
+maraca
+marimba
+mask
+matchstick
+maypole
+maze
+measuring cup
+medicine chest
+megalith
+microphone
+microwave
+military uniform
+milk can
+minibus
+miniskirt
+minivan
+missile
+mitten
+mixing bowl
+mobile home
+Model T
+modem
+monastery
+monitor
+moped
+mortar
+mortarboard
+mosque
+mosquito net
+motor scooter
+mountain bike
+mountain tent
+mouse
+mousetrap
+moving van
+muzzle
+nail
+neck brace
+necklace
+nipple
+notebook
+obelisk
+oboe
+ocarina
+odometer
+oil filter
+organ
+oscilloscope
+overskirt
+oxcart
+oxygen mask
+packet
+paddle
+paddlewheel
+padlock
+paintbrush
+pajama
+palace
+panpipe
+paper towel
+parachute
+parallel bars
+park bench
+parking meter
+passenger car
+patio
+pay-phone
+pedestal
+pencil box
+pencil sharpener
+perfume
+Petri dish
+photocopier
+pick
+pickelhaube
+picket fence
+pickup
+pier
+piggy bank
+pill bottle
+pillow
+ping-pong ball
+pinwheel
+pirate
+pitcher
+plane
+planetarium
+plastic bag
+plate rack
+plow
+plunger
+Polaroid camera
+pole
+police van
+poncho
+pool table
+pop bottle
+pot
+potter's wheel
+power drill
+prayer rug
+printer
+prison
+projectile
+projector
+puck
+punching bag
+purse
+quill
+quilt
+racer
+racket
+radiator
+radio
+radio telescope
+rain barrel
+recreational vehicle
+reel
+reflex camera
+refrigerator
+remote control
+restaurant
+revolver
+rifle
+rocking chair
+rotisserie
+rubber eraser
+rugby ball
+rule
+running shoe
+safe
+safety pin
+saltshaker
+sandal
+sarong
+sax
+scabbard
+scale
+school bus
+schooner
+scoreboard
+screen
+screw
+screwdriver
+seat belt
+sewing machine
+shield
+shoe shop
+shoji
+shopping basket
+shopping cart
+shovel
+shower cap
+shower curtain
+ski
+ski mask
+sleeping bag
+slide rule
+sliding door
+slot
+snorkel
+snowmobile
+snowplow
+soap dispenser
+soccer ball
+sock
+solar dish
+sombrero
+soup bowl
+space bar
+space heater
+space shuttle
+spatula
+speedboat
+spider web
+spindle
+sports car
+spotlight
+stage
+steam locomotive
+steel arch bridge
+steel drum
+stethoscope
+stole
+stone wall
+stopwatch
+stove
+strainer
+streetcar
+stretcher
+studio couch
+stupa
+submarine
+suit
+sundial
+sunglass
+sunglasses
+sunscreen
+suspension bridge
+swab
+sweatshirt
+swimming trunks
+swing
+switch
+syringe
+table lamp
+tank
+tape player
+teapot
+teddy
+television
+tennis ball
+thatch
+theater curtain
+thimble
+thresher
+throne
+tile roof
+toaster
+tobacco shop
+toilet seat
+torch
+totem pole
+tow truck
+toyshop
+tractor
+trailer truck
+tray
+trench coat
+tricycle
+trimaran
+tripod
+triumphal arch
+trolleybus
+trombone
+tub
+turnstile
+typewriter keyboard
+umbrella
+unicycle
+upright
+vacuum
+vase
+vault
+velvet
+vending machine
+vestment
+viaduct
+violin
+volleyball
+waffle iron
+wall clock
+wallet
+wardrobe
+warplane
+washbasin
+washer
+water bottle
+water jug
+water tower
+whiskey jug
+whistle
+wig
+window screen
+window shade
+Windsor tie
+wine bottle
+wing
+wok
+wooden spoon
+wool
+worm fence
+wreck
+yawl
+yurt
+web site
+comic book
+crossword puzzle
+street sign
+traffic light
+book jacket
+menu
+plate
+guacamole
+consomme
+hot pot
+trifle
+ice cream
+ice lolly
+French loaf
+bagel
+pretzel
+cheeseburger
+hotdog
+mashed potato
+head cabbage
+broccoli
+cauliflower
+zucchini
+spaghetti squash
+acorn squash
+butternut squash
+cucumber
+artichoke
+bell pepper
+cardoon
+mushroom
+Granny Smith
+strawberry
+orange
+lemon
+fig
+pineapple
+banana
+jackfruit
+custard apple
+pomegranate
+hay
+carbonara
+chocolate sauce
+dough
+meat loaf
+pizza
+potpie
+burrito
+red wine
+espresso
+cup
+eggnog
+alp
+bubble
+cliff
+coral reef
+geyser
+lakeside
+promontory
+sandbar
+seashore
+valley
+volcano
+ballplayer
+groom
+scuba diver
+rapeseed
+daisy
+yellow lady's slipper
+corn
+acorn
+hip
+buckeye
+coral fungus
+agaric
+gyromitra
+stinkhorn
+earthstar
+hen-of-the-woods
+bolete
+ear
+toilet tissue
diff --git a/src/Driving_Reminder_Assistant/app/src/main/assets/labels_mobilenet_quant_v1_224.txt b/src/Driving_Reminder_Assistant/app/src/main/assets/labels_mobilenet_quant_v1_224.txt
new file mode 100644
index 0000000..fe81123
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/assets/labels_mobilenet_quant_v1_224.txt
@@ -0,0 +1,1001 @@
+background
+tench
+goldfish
+great white shark
+tiger shark
+hammerhead
+electric ray
+stingray
+cock
+hen
+ostrich
+brambling
+goldfinch
+house finch
+junco
+indigo bunting
+robin
+bulbul
+jay
+magpie
+chickadee
+water ouzel
+kite
+bald eagle
+vulture
+great grey owl
+European fire salamander
+common newt
+eft
+spotted salamander
+axolotl
+bullfrog
+tree frog
+tailed frog
+loggerhead
+leatherback turtle
+mud turtle
+terrapin
+box turtle
+banded gecko
+common iguana
+American chameleon
+whiptail
+agama
+frilled lizard
+alligator lizard
+Gila monster
+green lizard
+African chameleon
+Komodo dragon
+African crocodile
+American alligator
+triceratops
+thunder snake
+ringneck snake
+hognose snake
+green snake
+king snake
+garter snake
+water snake
+vine snake
+night snake
+boa constrictor
+rock python
+Indian cobra
+green mamba
+sea snake
+horned viper
+diamondback
+sidewinder
+trilobite
+harvestman
+scorpion
+black and gold garden spider
+barn spider
+garden spider
+black widow
+tarantula
+wolf spider
+tick
+centipede
+black grouse
+ptarmigan
+ruffed grouse
+prairie chicken
+peacock
+quail
+partridge
+African grey
+macaw
+sulphur-crested cockatoo
+lorikeet
+coucal
+bee eater
+hornbill
+hummingbird
+jacamar
+toucan
+drake
+red-breasted merganser
+goose
+black swan
+tusker
+echidna
+platypus
+wallaby
+koala
+wombat
+jellyfish
+sea anemone
+brain coral
+flatworm
+nematode
+conch
+snail
+slug
+sea slug
+chiton
+chambered nautilus
+Dungeness crab
+rock crab
+fiddler crab
+king crab
+American lobster
+spiny lobster
+crayfish
+hermit crab
+isopod
+white stork
+black stork
+spoonbill
+flamingo
+little blue heron
+American egret
+bittern
+crane
+limpkin
+European gallinule
+American coot
+bustard
+ruddy turnstone
+red-backed sandpiper
+redshank
+dowitcher
+oystercatcher
+pelican
+king penguin
+albatross
+grey whale
+killer whale
+dugong
+sea lion
+Chihuahua
+Japanese spaniel
+Maltese dog
+Pekinese
+Shih-Tzu
+Blenheim spaniel
+papillon
+toy terrier
+Rhodesian ridgeback
+Afghan hound
+basset
+beagle
+bloodhound
+bluetick
+black-and-tan coonhound
+Walker hound
+English foxhound
+redbone
+borzoi
+Irish wolfhound
+Italian greyhound
+whippet
+Ibizan hound
+Norwegian elkhound
+otterhound
+Saluki
+Scottish deerhound
+Weimaraner
+Staffordshire bullterrier
+American Staffordshire terrier
+Bedlington terrier
+Border terrier
+Kerry blue terrier
+Irish terrier
+Norfolk terrier
+Norwich terrier
+Yorkshire terrier
+wire-haired fox terrier
+Lakeland terrier
+Sealyham terrier
+Airedale
+cairn
+Australian terrier
+Dandie Dinmont
+Boston bull
+miniature schnauzer
+giant schnauzer
+standard schnauzer
+Scotch terrier
+Tibetan terrier
+silky terrier
+soft-coated wheaten terrier
+West Highland white terrier
+Lhasa
+flat-coated retriever
+curly-coated retriever
+golden retriever
+Labrador retriever
+Chesapeake Bay retriever
+German short-haired pointer
+vizsla
+English setter
+Irish setter
+Gordon setter
+Brittany spaniel
+clumber
+English springer
+Welsh springer spaniel
+cocker spaniel
+Sussex spaniel
+Irish water spaniel
+kuvasz
+schipperke
+groenendael
+malinois
+briard
+kelpie
+komondor
+Old English sheepdog
+Shetland sheepdog
+collie
+Border collie
+Bouvier des Flandres
+Rottweiler
+German shepherd
+Doberman
+miniature pinscher
+Greater Swiss Mountain dog
+Bernese mountain dog
+Appenzeller
+EntleBucher
+boxer
+bull mastiff
+Tibetan mastiff
+French bulldog
+Great Dane
+Saint Bernard
+Eskimo dog
+malamute
+Siberian husky
+dalmatian
+affenpinscher
+basenji
+pug
+Leonberg
+Newfoundland
+Great Pyrenees
+Samoyed
+Pomeranian
+chow
+keeshond
+Brabancon griffon
+Pembroke
+Cardigan
+toy poodle
+miniature poodle
+standard poodle
+Mexican hairless
+timber wolf
+white wolf
+red wolf
+coyote
+dingo
+dhole
+African hunting dog
+hyena
+red fox
+kit fox
+Arctic fox
+grey fox
+tabby
+tiger cat
+Persian cat
+Siamese cat
+Egyptian cat
+cougar
+lynx
+leopard
+snow leopard
+jaguar
+lion
+tiger
+cheetah
+brown bear
+American black bear
+ice bear
+sloth bear
+mongoose
+meerkat
+tiger beetle
+ladybug
+ground beetle
+long-horned beetle
+leaf beetle
+dung beetle
+rhinoceros beetle
+weevil
+fly
+bee
+ant
+grasshopper
+cricket
+walking stick
+cockroach
+mantis
+cicada
+leafhopper
+lacewing
+dragonfly
+damselfly
+admiral
+ringlet
+monarch
+cabbage butterfly
+sulphur butterfly
+lycaenid
+starfish
+sea urchin
+sea cucumber
+wood rabbit
+hare
+Angora
+hamster
+porcupine
+fox squirrel
+marmot
+beaver
+guinea pig
+sorrel
+zebra
+hog
+wild boar
+warthog
+hippopotamus
+ox
+water buffalo
+bison
+ram
+bighorn
+ibex
+hartebeest
+impala
+gazelle
+Arabian camel
+llama
+weasel
+mink
+polecat
+black-footed ferret
+otter
+skunk
+badger
+armadillo
+three-toed sloth
+orangutan
+gorilla
+chimpanzee
+gibbon
+siamang
+guenon
+patas
+baboon
+macaque
+langur
+colobus
+proboscis monkey
+marmoset
+capuchin
+howler monkey
+titi
+spider monkey
+squirrel monkey
+Madagascar cat
+indri
+Indian elephant
+African elephant
+lesser panda
+giant panda
+barracouta
+eel
+coho
+rock beauty
+anemone fish
+sturgeon
+gar
+lionfish
+puffer
+abacus
+abaya
+academic gown
+accordion
+acoustic guitar
+aircraft carrier
+airliner
+airship
+altar
+ambulance
+amphibian
+analog clock
+apiary
+apron
+ashcan
+assault rifle
+backpack
+bakery
+balance beam
+balloon
+ballpoint
+Band Aid
+banjo
+bannister
+barbell
+barber chair
+barbershop
+barn
+barometer
+barrel
+barrow
+baseball
+basketball
+bassinet
+bassoon
+bathing cap
+bath towel
+bathtub
+beach wagon
+beacon
+beaker
+bearskin
+beer bottle
+beer glass
+bell cote
+bib
+bicycle-built-for-two
+bikini
+binder
+binoculars
+birdhouse
+boathouse
+bobsled
+bolo tie
+bonnet
+bookcase
+bookshop
+bottlecap
+bow
+bow tie
+brass
+brassiere
+breakwater
+breastplate
+broom
+bucket
+buckle
+bulletproof vest
+bullet train
+butcher shop
+cab
+caldron
+candle
+cannon
+canoe
+can opener
+cardigan
+car mirror
+carousel
+carpenter's kit
+carton
+car wheel
+cash machine
+cassette
+cassette player
+castle
+catamaran
+CD player
+cello
+cellular telephone
+chain
+chainlink fence
+chain mail
+chain saw
+chest
+chiffonier
+chime
+china cabinet
+Christmas stocking
+church
+cinema
+cleaver
+cliff dwelling
+cloak
+clog
+cocktail shaker
+coffee mug
+coffeepot
+coil
+combination lock
+computer keyboard
+confectionery
+container ship
+convertible
+corkscrew
+cornet
+cowboy boot
+cowboy hat
+cradle
+crane
+crash helmet
+crate
+crib
+Crock Pot
+croquet ball
+crutch
+cuirass
+dam
+desk
+desktop computer
+dial telephone
+diaper
+digital clock
+digital watch
+dining table
+dishrag
+dishwasher
+disk brake
+dock
+dogsled
+dome
+doormat
+drilling platform
+drum
+drumstick
+dumbbell
+Dutch oven
+electric fan
+electric guitar
+electric locomotive
+entertainment center
+envelope
+espresso maker
+face powder
+feather boa
+file
+fireboat
+fire engine
+fire screen
+flagpole
+flute
+folding chair
+football helmet
+forklift
+fountain
+fountain pen
+four-poster
+freight car
+French horn
+frying pan
+fur coat
+garbage truck
+gasmask
+gas pump
+goblet
+go-kart
+golf ball
+golfcart
+gondola
+gong
+gown
+grand piano
+greenhouse
+grille
+grocery store
+guillotine
+hair slide
+hair spray
+half track
+hammer
+hamper
+hand blower
+hand-held computer
+handkerchief
+hard disc
+harmonica
+harp
+harvester
+hatchet
+holster
+home theater
+honeycomb
+hook
+hoopskirt
+horizontal bar
+horse cart
+hourglass
+iPod
+iron
+jack-o'-lantern
+jean
+jeep
+jersey
+jigsaw puzzle
+jinrikisha
+joystick
+kimono
+knee pad
+knot
+lab coat
+ladle
+lampshade
+laptop
+lawn mower
+lens cap
+letter opener
+library
+lifeboat
+lighter
+limousine
+liner
+lipstick
+Loafer
+lotion
+loudspeaker
+loupe
+lumbermill
+magnetic compass
+mailbag
+mailbox
+maillot
+maillot
+manhole cover
+maraca
+marimba
+mask
+matchstick
+maypole
+maze
+measuring cup
+medicine chest
+megalith
+microphone
+microwave
+military uniform
+milk can
+minibus
+miniskirt
+minivan
+missile
+mitten
+mixing bowl
+mobile home
+Model T
+modem
+monastery
+monitor
+moped
+mortar
+mortarboard
+mosque
+mosquito net
+motor scooter
+mountain bike
+mountain tent
+mouse
+mousetrap
+moving van
+muzzle
+nail
+neck brace
+necklace
+nipple
+notebook
+obelisk
+oboe
+ocarina
+odometer
+oil filter
+organ
+oscilloscope
+overskirt
+oxcart
+oxygen mask
+packet
+paddle
+paddlewheel
+padlock
+paintbrush
+pajama
+palace
+panpipe
+paper towel
+parachute
+parallel bars
+park bench
+parking meter
+passenger car
+patio
+pay-phone
+pedestal
+pencil box
+pencil sharpener
+perfume
+Petri dish
+photocopier
+pick
+pickelhaube
+picket fence
+pickup
+pier
+piggy bank
+pill bottle
+pillow
+ping-pong ball
+pinwheel
+pirate
+pitcher
+plane
+planetarium
+plastic bag
+plate rack
+plow
+plunger
+Polaroid camera
+pole
+police van
+poncho
+pool table
+pop bottle
+pot
+potter's wheel
+power drill
+prayer rug
+printer
+prison
+projectile
+projector
+puck
+punching bag
+purse
+quill
+quilt
+racer
+racket
+radiator
+radio
+radio telescope
+rain barrel
+recreational vehicle
+reel
+reflex camera
+refrigerator
+remote control
+restaurant
+revolver
+rifle
+rocking chair
+rotisserie
+rubber eraser
+rugby ball
+rule
+running shoe
+safe
+safety pin
+saltshaker
+sandal
+sarong
+sax
+scabbard
+scale
+school bus
+schooner
+scoreboard
+screen
+screw
+screwdriver
+seat belt
+sewing machine
+shield
+shoe shop
+shoji
+shopping basket
+shopping cart
+shovel
+shower cap
+shower curtain
+ski
+ski mask
+sleeping bag
+slide rule
+sliding door
+slot
+snorkel
+snowmobile
+snowplow
+soap dispenser
+soccer ball
+sock
+solar dish
+sombrero
+soup bowl
+space bar
+space heater
+space shuttle
+spatula
+speedboat
+spider web
+spindle
+sports car
+spotlight
+stage
+steam locomotive
+steel arch bridge
+steel drum
+stethoscope
+stole
+stone wall
+stopwatch
+stove
+strainer
+streetcar
+stretcher
+studio couch
+stupa
+submarine
+suit
+sundial
+sunglass
+sunglasses
+sunscreen
+suspension bridge
+swab
+sweatshirt
+swimming trunks
+swing
+switch
+syringe
+table lamp
+tank
+tape player
+teapot
+teddy
+television
+tennis ball
+thatch
+theater curtain
+thimble
+thresher
+throne
+tile roof
+toaster
+tobacco shop
+toilet seat
+torch
+totem pole
+tow truck
+toyshop
+tractor
+trailer truck
+tray
+trench coat
+tricycle
+trimaran
+tripod
+triumphal arch
+trolleybus
+trombone
+tub
+turnstile
+typewriter keyboard
+umbrella
+unicycle
+upright
+vacuum
+vase
+vault
+velvet
+vending machine
+vestment
+viaduct
+violin
+volleyball
+waffle iron
+wall clock
+wallet
+wardrobe
+warplane
+washbasin
+washer
+water bottle
+water jug
+water tower
+whiskey jug
+whistle
+wig
+window screen
+window shade
+Windsor tie
+wine bottle
+wing
+wok
+wooden spoon
+wool
+worm fence
+wreck
+yawl
+yurt
+web site
+comic book
+crossword puzzle
+street sign
+traffic light
+book jacket
+menu
+plate
+guacamole
+consomme
+hot pot
+trifle
+ice cream
+ice lolly
+French loaf
+bagel
+pretzel
+cheeseburger
+hotdog
+mashed potato
+head cabbage
+broccoli
+cauliflower
+zucchini
+spaghetti squash
+acorn squash
+butternut squash
+cucumber
+artichoke
+bell pepper
+cardoon
+mushroom
+Granny Smith
+strawberry
+orange
+lemon
+fig
+pineapple
+banana
+jackfruit
+custard apple
+pomegranate
+hay
+carbonara
+chocolate sauce
+dough
+meat loaf
+pizza
+potpie
+burrito
+red wine
+espresso
+cup
+eggnog
+alp
+bubble
+cliff
+coral reef
+geyser
+lakeside
+promontory
+sandbar
+seashore
+valley
+volcano
+ballplayer
+groom
+scuba diver
+rapeseed
+daisy
+yellow lady's slipper
+corn
+acorn
+hip
+buckeye
+coral fungus
+agaric
+gyromitra
+stinkhorn
+earthstar
+hen-of-the-woods
+bolete
+ear
+toilet tissue
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/.DS_Store b/src/Driving_Reminder_Assistant/app/src/main/java/.DS_Store
new file mode 100644
index 0000000..a81dba4
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/java/.DS_Store differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/.DS_Store b/src/Driving_Reminder_Assistant/app/src/main/java/com/.DS_Store
new file mode 100644
index 0000000..90b69e0
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/java/com/.DS_Store differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/.DS_Store b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/.DS_Store
new file mode 100644
index 0000000..c1662b3
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/.DS_Store differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/.DS_Store b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/.DS_Store
new file mode 100644
index 0000000..d4e82f1
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/.DS_Store differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/AddCameraActivity.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/AddCameraActivity.java
new file mode 100644
index 0000000..f00bdfa
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/AddCameraActivity.java
@@ -0,0 +1,858 @@
+package com.ipcamera.detect;
+
+import java.util.Map;
+
+import vstc2.nativecaller.NativeCaller;
+
+import android.Manifest;
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.ProgressDialog;
+import android.app.Service;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.content.pm.PackageManager;
+import android.media.AudioManager;
+import android.net.wifi.WifiManager;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.Window;
+import android.widget.AdapterView;
+import android.widget.AdapterView.OnItemSelectedListener;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.annotation.NonNull;
+import androidx.core.app.ActivityCompat;
+
+import com.ipcamer.detect.R;
+import com.ipcamera.detect.BridgeService.AddCameraInterface;
+import com.ipcamera.detect.BridgeService.CallBackMessageInterface;
+import com.ipcamera.detect.BridgeService.IpcamClientInterface;
+import com.ipcamera.detect.adapter.SearchListAdapter;
+import com.ipcamera.detect.utils.ContentCommon;
+import com.ipcamera.detect.utils.MySharedPreferenceUtil;
+import com.ipcamera.detect.utils.MyStringUtils;
+import com.ipcamera.detect.utils.SystemValue;
+import com.ipcamera.detect.utils.VuidUtils;
+
+public class AddCameraActivity extends Activity implements OnClickListener,AddCameraInterface, OnItemSelectedListener, IpcamClientInterface,CallBackMessageInterface
+{
+ private EditText userEdit = null;
+ private EditText pwdEdit = null;
+ private EditText didEdit = null;
+ private TextView textView_top_show = null;
+ private Button done;
+ private static final int SEARCH_TIME = 3000;
+ private int option = ContentCommon.INVALID_OPTION;
+ private int CameraType = ContentCommon.CAMERA_TYPE_MJPEG;
+ private Button btnSearchCamera;
+ private SearchListAdapter listAdapter = null;
+ private ProgressDialog progressdlg = null;
+ private boolean isSearched;
+ private MyBroadCast receiver;
+ private WifiManager manager = null;
+ private ProgressBar progressBar = null;
+ private static final String STR_DID = "did";
+ private static final String STR_MSG_PARAM = "msgparam";
+ private MyWifiThread myWifiThread = null;
+ private boolean blagg = false;
+ private Intent intentbrod = null;
+ private Button button_play = null;
+ private Button button_setting = null;
+ private Button btn_info;
+ private int tag = 0;
+
+
+ class MyWifiThread extends Thread {
+ @Override
+ public void run() {
+ while (blagg == true) {
+ super.run();
+ updateListHandler.sendEmptyMessage(100000);
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
+ private class MyBroadCast extends BroadcastReceiver {
+
+ @Override
+ public void onReceive(Context arg0, Intent arg1) {
+ AddCameraActivity.this.finish();
+ Log.d("ip", "AddCameraActivity.this.finish()");
+ }
+
+ }
+
+ class StartPPPPThread implements Runnable {
+ @Override
+ public void run() {
+ try {
+ Thread.sleep(100);
+ if(VuidUtils.isVuid(SystemValue.deviceId))
+ {
+ int vuidStatus = NativeCaller.StartVUID("0",SystemValue.devicePass,1,"","",0,SystemValue.deviceId,0);
+ Log.e("vst","vuidStatus"+vuidStatus);
+ if(vuidStatus == -2)
+ {
+ // TODO: VUID 无效
+ Bundle bd = new Bundle();
+ Message msg = PPPPMsgHandler.obtainMessage();
+ msg.what = ContentCommon.PPPP_MSG_VSNET_NOTIFY_TYPE_VUIDSTATUS;
+ bd.putInt(STR_MSG_PARAM, -2);
+ bd.putString(STR_DID, SystemValue.deviceId);
+ msg.setData(bd);
+ PPPPMsgHandler.sendMessage(msg);
+ }
+ }else {
+ startCameraPPPP();
+ }
+ } catch (Exception e) {
+
+ }
+ }
+ }
+ private void startCameraPPPP() {
+ try {
+ Thread.sleep(100);
+ } catch (Exception e) {
+ }
+
+ if(SystemValue.deviceId.toLowerCase().startsWith("vsta"))
+ {
+ NativeCaller.StartPPPPExt(SystemValue.deviceId, SystemValue.deviceName,
+ SystemValue.devicePass,63,"","EFGFFBBOKAIEGHJAEDHJFEEOHMNGDCNJCDFKAKHLEBJHKEKMCAFCDLLLHAOCJPPMBHMNOMCJKGJEBGGHJHIOMFBDNPKNFEGCEGCBGCALMFOHBCGMFK",0);
+ }else if(SystemValue.deviceId.toLowerCase().startsWith("vstd"))
+ {
+ NativeCaller.StartPPPPExt(SystemValue.deviceId, SystemValue.deviceName,
+ SystemValue.devicePass,63,"","HZLXSXIALKHYEIEJHUASLMHWEESUEKAUIHPHSWAOSTEMENSQPDLRLNPAPEPGEPERIBLQLKHXELEHHULOEGIAEEHYEIEK-$$",1);
+ }else if(SystemValue.deviceId.toLowerCase().startsWith("vstf"))
+ {
+ NativeCaller.StartPPPPExt(SystemValue.deviceId, SystemValue.deviceName,
+ SystemValue.devicePass,63,"","HZLXEJIALKHYATPCHULNSVLMEELSHWIHPFIBAOHXIDICSQEHENEKPAARSTELERPDLNEPLKEILPHUHXHZEJEEEHEGEM-$$",1);
+ }
+ else if(SystemValue.deviceId.toLowerCase().startsWith("vste"))
+ {
+ NativeCaller.StartPPPPExt(SystemValue.deviceId, SystemValue.deviceName,
+ SystemValue.devicePass,63,"","EEGDFHBAKKIOGNJHEGHMFEEDGLNOHJMPHAFPBEDLADILKEKPDLBDDNPOHKKCIFKJBNNNKLCPPPNDBFDL",0);
+ }else if(SystemValue.deviceId.toLowerCase().startsWith("pisr"))
+ {
+ NativeCaller.StartPPPPExt(SystemValue.deviceId, SystemValue.deviceName,
+ SystemValue.devicePass,63,"","EFGFFBBOKAIEGHJAEDHJFEEOHMNGDCNJCDFKAKHLEBJHKEKMCAFCDLLLHAOCJPPMBHMNOMCJKGJEBGGHJHIOMFBDNPKNFEGCEGCBGCALMFOHBCGMFK",0);
+ }
+ else if(SystemValue.deviceId.toLowerCase().startsWith("vstg"))
+ {
+ NativeCaller.StartPPPPExt(SystemValue.deviceId, SystemValue.deviceName,
+ SystemValue.devicePass,63,"","EEGDFHBOKCIGGFJPECHIFNEBGJNLHOMIHEFJBADPAGJELNKJDKANCBPJGHLAIALAADMDKPDGOENEBECCIK:vstarcam2018",0);
+ }else if(SystemValue.deviceId.toLowerCase().startsWith("vsth"))
+ {
+ NativeCaller.StartPPPPExt(SystemValue.deviceId, SystemValue.deviceName,
+ SystemValue.devicePass,63,"","EEGDFHBLKGJIGEJLEKGOFMEDHAMHHJNAGGFABMCOBGJOLHLJDFAFCPPHGILKIKLMANNHKEDKOINIBNCPJOMK:vstarcam2018",0);
+ }else if(SystemValue.deviceId.toLowerCase().startsWith("vstb")||SystemValue.deviceId.toLowerCase().startsWith("vstc"))
+ {
+ NativeCaller.StartPPPPExt(SystemValue.deviceId, SystemValue.deviceName,
+ SystemValue.devicePass,63,"","ADCBBFAOPPJAHGJGBBGLFLAGDBJJHNJGGMBFBKHIBBNKOKLDHOBHCBOEHOKJJJKJBPMFLGCPPJMJAPDOIPNL",0);
+ }
+
+ else if(SystemValue.deviceId.toLowerCase().startsWith("vstj"))
+ {
+ NativeCaller.StartPPPPExt(SystemValue.deviceId, SystemValue.deviceName,
+ SystemValue.devicePass,63,"","EEGDFHBLKGJIGEJNEOHEFBEIGANCHHMBHIFEAHDEAMJCKCKJDJAFDDPPHLKJIHLMBENHKDCHPHNJBODA:vstarcam2019",0);
+
+ }
+ //改成63,方便手机接入
+ else if(SystemValue.deviceId.toLowerCase().startsWith("vstk"))
+ {
+ NativeCaller.StartPPPPExt(SystemValue.deviceId, SystemValue.deviceName,
+ SystemValue.devicePass,63,"","EBGDEJBJKGJFGJJBEFHPFCEKHGNMHNNMHMFFBICPAJJNLDLLDHACCNONGLLPJGLKANMJLDDHODMEBOCIJEMA:vstarcam2019",0);
+
+ }
+ else if(SystemValue.deviceId.toLowerCase().startsWith("vstm"))
+ {
+ NativeCaller.StartPPPPExt(SystemValue.deviceId, SystemValue.deviceName,
+ SystemValue.devicePass,63,"","EBGEEOBOKHJNHGJGEAGAEPEPHDMGHINBGIECBBCBBJIKLKLCCDBBCFODHLKLJJKPBOMELECKPNMNAICEJCNNJH:vstarcam2019",0);
+
+ }
+ else if(SystemValue.deviceId.toLowerCase().startsWith("vstn"))
+ {
+ NativeCaller.StartPPPPExt(SystemValue.deviceId, SystemValue.deviceName,
+ SystemValue.devicePass,63,"","EEGDFHBBKBIFGAIAFGHDFLFJGJNIGEMOHFFPAMDMAAIIKBKNCDBDDMOGHLKCJCKFBFMPLMCBPEMG:vstarcam2019",0);
+
+ }
+ else if(SystemValue.deviceId.toLowerCase().startsWith("vstl"))
+ {
+ NativeCaller.StartPPPPExt(SystemValue.deviceId, SystemValue.deviceName,
+ SystemValue.devicePass,63,"","EEGDFHBLKGJIGEJIEIGNFPEEHGNMHPNBGOFIBECEBLJDLMLGDKAPCNPFGOLLJFLJAOMKLBDFOGMAAFCJJPNFJP:vstarcam2019",0);
+
+ }
+ else if(SystemValue.deviceId.toLowerCase().startsWith("vstp"))
+ {
+ NativeCaller.StartPPPPExt(SystemValue.deviceId, SystemValue.deviceName,
+ SystemValue.devicePass,63,"","EEGDFHBLKGJIGEJLEIGJFLENHLNBHCNMGAFGBNCOAIJMLKKODNALCCPKGBLHJLLHAHMBKNDFOGNGBDCIJFMB:vstarcam2019",0);
+
+ }
+ else {
+ NativeCaller.StartPPPPExt(SystemValue.deviceId, SystemValue.deviceName,
+ SystemValue.devicePass,63,"","",0);
+ }
+ }
+ @Override
+ public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
+ if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
+ Toast.makeText(this, "Permission GET", Toast.LENGTH_SHORT).show();
+ } else {
+// Permission Denied
+ Toast.makeText(this, "Permission Denied", Toast.LENGTH_SHORT).show();
+ }
+ super.onRequestPermissionsResult(requestCode, permissions, grantResults);
+ }
+ private void stopCameraPPPP()
+ {
+ NativeCaller.StopPPPP(SystemValue.deviceId);
+ }
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ ActivityCompat.requestPermissions(this,
+ new String[]{
+ Manifest.permission.RECORD_AUDIO,
+ Manifest.permission.CAMERA,
+ Manifest.permission.WRITE_EXTERNAL_STORAGE,
+ Manifest.permission.READ_EXTERNAL_STORAGE,
+ Manifest.permission.MOUNT_UNMOUNT_FILESYSTEMS}, 1);
+
+ requestWindowFeature(Window.FEATURE_NO_TITLE);
+ setContentView(R.layout.add_camera);
+ progressdlg = new ProgressDialog(this);
+ progressdlg.setProgressStyle(ProgressDialog.STYLE_SPINNER);
+ progressdlg.setMessage(getString(R.string.searching_tip));
+ listAdapter = new SearchListAdapter(this);
+ findView();
+ manager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);
+ InitParams();
+ this.setVolumeControlStream(AudioManager.STREAM_MUSIC);
+ BridgeService.setAddCameraInterface(this);
+ BridgeService.setCallBackMessage(this);
+ receiver = new MyBroadCast();
+ IntentFilter filter = new IntentFilter();
+ filter.addAction("finish");
+ registerReceiver(receiver, filter);
+ intentbrod = new Intent("drop");
+ }
+
+ @Override
+ protected void onStart() {
+ // TODO Auto-generated method stub
+ super.onStart();
+ }
+
+ @Override
+ protected void onPause() {
+ // TODO Auto-generated method stub
+ super.onPause();
+ }
+
+ @Override
+ protected void onResume() {
+ // TODO Auto-generated method stub
+ super.onResume();
+ blagg = true;
+ }
+
+ private void InitParams() {
+ done.setOnClickListener(this);
+ btnSearchCamera.setOnClickListener(this);
+ //监听软键盘的删除键
+ userEdit.setOnKeyListener(new View.OnKeyListener() {
+ @Override
+ public boolean onKey(View v, int keyCode, KeyEvent event) {
+ if (keyCode == KeyEvent.KEYCODE_DEL) {
+ String s = userEdit.getText().toString();
+ if (TextUtils.isEmpty(s)) {
+ return true;
+ }
+ }
+ return false;
+ }
+ });
+ //监听软键盘的删除键
+ pwdEdit.setOnKeyListener(new View.OnKeyListener() {
+ @Override
+ public boolean onKey(View v, int keyCode, KeyEvent event) {
+ if (keyCode == KeyEvent.KEYCODE_DEL) {
+ String s = userEdit.getText().toString();
+ if (TextUtils.isEmpty(s)) {
+ return true;
+ }
+ }
+ return false;
+ }
+ });
+ //监听软键盘的删除键
+ didEdit.setOnKeyListener(new View.OnKeyListener() {
+ @Override
+ public boolean onKey(View v, int keyCode, KeyEvent event) {
+ if (keyCode == KeyEvent.KEYCODE_DEL) {
+ String s = userEdit.getText().toString();
+ if (TextUtils.isEmpty(s)) {
+ return true;
+ }
+ }
+ return false;
+ }
+ });
+ }
+
+ @Override
+ protected void onStop() {
+ super.onStop();
+ if (myWifiThread != null) {
+ blagg = false;
+ }
+ progressdlg.dismiss();
+ NativeCaller.StopSearch();
+
+ }
+
+ @Override
+ protected void onDestroy() {
+ super.onDestroy();
+ unregisterReceiver(receiver);
+ NativeCaller.Free();
+ Intent intent = new Intent();
+ intent.setClass(this, BridgeService.class);
+ stopService(intent);
+ tag = 0;
+ }
+
+ Runnable updateThread = new Runnable() {
+
+ public void run() {
+ NativeCaller.StopSearch();
+ progressdlg.dismiss();
+ Message msg = updateListHandler.obtainMessage();
+ msg.what = 1;
+ updateListHandler.sendMessage(msg);
+ }
+ };
+
+ Handler updateListHandler = new Handler() {
+ @Override
+ public void handleMessage(Message msg) {
+ if (msg.what == 1) {
+ listAdapter.notifyDataSetChanged();
+ if (listAdapter.getCount() > 0) {
+ AlertDialog.Builder dialog = new AlertDialog.Builder(
+ AddCameraActivity.this);
+ dialog.setTitle(getResources().getString(
+ R.string.add_search_result));
+ dialog.setPositiveButton(
+ getResources().getString(R.string.refresh),
+ new DialogInterface.OnClickListener() {
+
+ @Override
+ public void onClick(DialogInterface dialog,
+ int which) {
+ startSearch();
+ }
+ });
+ dialog.setNegativeButton(
+ getResources().getString(R.string.str_cancel), null);
+ dialog.setAdapter(listAdapter,
+ new DialogInterface.OnClickListener() {
+
+ @Override
+ public void onClick(DialogInterface dialog,
+ int arg2) {
+ Map mapItem = (Map) listAdapter.getItemContent(arg2);
+ if (mapItem == null) {
+ return;
+ }
+ String strName = (String) mapItem
+ .get(ContentCommon.STR_CAMERA_NAME);
+ String strDID = (String) mapItem
+ .get(ContentCommon.STR_CAMERA_ID);
+ String strUser = ContentCommon.DEFAULT_USER_NAME;
+ String strPwd = ContentCommon.DEFAULT_USER_PWD;
+ userEdit.setText(strUser);
+ pwdEdit.setText(strPwd);
+ didEdit.setText(strDID);
+ }
+ });
+
+ dialog.show();
+ } else {
+ Toast.makeText(AddCameraActivity.this,
+ getResources().getString(R.string.add_search_no),
+ Toast.LENGTH_LONG).show();
+ isSearched = false;//
+ }
+ }
+ }
+ };
+
+
+ private void startSearch() {
+ listAdapter.ClearAll();
+ progressdlg.setMessage(getString(R.string.searching_tip));
+ progressdlg.show();
+ new Thread(new SearchThread()).start();
+ updateListHandler.postDelayed(updateThread, SEARCH_TIME);
+ }
+
+ private class SearchThread implements Runnable {
+ @Override
+ public void run() {
+ Log.d("tag", "startSearch");
+ NativeCaller.StartSearch();
+ }
+ }
+
+ private void findView() {
+ progressBar = (ProgressBar) findViewById(R.id.main_model_progressBar1);
+ textView_top_show = (TextView) findViewById(R.id.login_textView1);
+ button_play = (Button) findViewById(R.id.play);
+ button_setting = (Button) findViewById(R.id.setting);
+ done = (Button) findViewById(R.id.done);
+ //done.setText("连接");
+ userEdit = (EditText) findViewById(R.id.editUser);
+
+ pwdEdit = (EditText) findViewById(R.id.editPwd);
+ didEdit = (EditText) findViewById(R.id.editDID);
+ btnSearchCamera = (Button) findViewById(R.id.btn_searchCamera);
+
+ btn_info = (Button)findViewById(R.id.getInfo);
+ button_play.setOnClickListener(this);
+ button_setting.setOnClickListener(this);
+
+ btn_info.setOnClickListener(this);
+ }
+
+ @Override
+ public void onClick(View v) {
+ switch (v.getId()) {
+ case R.id.play:
+ if (tag == 1) {
+ Intent intent = new Intent(AddCameraActivity.this, PlayActivity.class);
+ startActivity(intent);
+ }else{
+ Toast.makeText(AddCameraActivity.this,getResources().getString(R.string.main_play_prompt),Toast.LENGTH_SHORT).show();
+ }
+ break;
+ case R.id.setting:
+ if (tag == 1) {
+ Intent intent1 = new Intent(AddCameraActivity.this,
+ SettingActivity.class);
+ intent1.putExtra(ContentCommon.STR_CAMERA_ID,
+ SystemValue.deviceId);
+ intent1.putExtra(ContentCommon.STR_CAMERA_NAME,
+ SystemValue.deviceName);
+ intent1.putExtra(ContentCommon.STR_CAMERA_PWD, SystemValue.devicePass);
+ startActivity(intent1);
+ overridePendingTransition(R.anim.in_from_right,
+ R.anim.out_to_left);
+ } else {
+ Toast.makeText(AddCameraActivity.this,getResources().getString(R.string.main_setting_prompt),Toast.LENGTH_SHORT).show();
+ }
+ break;
+ case R.id.done:
+ if (tag == 1) {
+ Toast.makeText(AddCameraActivity.this,"设备已经是在线状态了",Toast.LENGTH_SHORT).show();
+ } else if (tag == 2) {
+ Toast.makeText(AddCameraActivity.this, "设备不在线",Toast.LENGTH_SHORT).show();
+ } else {
+ loginAndConnect();
+ }
+ break;
+ case R.id.btn_searchCamera:
+ stopCameraPPPP();
+ //把相机状态,设备id置空
+ tag=0;
+ textView_top_show.setText(R.string.login_stuta_camer);
+ SystemValue.deviceId=null;
+ searchCamera();
+ break;
+ case R.id.getInfo:
+ //todo 驾驶信息收集
+ startActivity(new Intent(AddCameraActivity.this,MessageActivity.class));
+ break;
+ default:
+ break;
+ }
+ }
+
+
+ private void searchCamera() {
+ if (!isSearched) {
+ isSearched = true;
+ startSearch();
+ } else {
+ AlertDialog.Builder dialog = new AlertDialog.Builder(
+ AddCameraActivity.this);
+ dialog.setTitle(getResources()
+ .getString(R.string.add_search_result));
+ dialog.setPositiveButton(
+ getResources().getString(R.string.refresh),
+ new DialogInterface.OnClickListener() {
+
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ startSearch();
+
+ }
+ });
+ dialog.setNegativeButton(
+ getResources().getString(R.string.str_cancel), null);
+ dialog.setAdapter(listAdapter,
+ new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int arg2) {
+ Map mapItem = (Map) listAdapter.getItemContent(arg2);
+ if (mapItem == null) {
+ return;
+ }
+ String strName = (String) mapItem
+ .get(ContentCommon.STR_CAMERA_NAME);
+ String strDID = (String) mapItem
+ .get(ContentCommon.STR_CAMERA_ID);
+ String strUser = ContentCommon.DEFAULT_USER_NAME;
+ String strPwd = ContentCommon.DEFAULT_USER_PWD;
+ userEdit.setText(strUser);
+ pwdEdit.setText(strPwd);
+ didEdit.setText(strDID);
+ }
+ });
+ dialog.show();
+ }
+ }
+
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
+ if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
+ AddCameraActivity.this.finish();
+ return false;
+ }
+ return false;
+ }
+
+ private void loginAndConnect() {
+ Intent in = new Intent();
+ String strUser = userEdit.getText().toString();
+ String strPwd = pwdEdit.getText().toString();
+ String strDID = didEdit.getText().toString();
+
+ if (strDID.length() == 0)
+ {
+ Toast.makeText(AddCameraActivity.this,
+ getResources().getString(R.string.input_camera_id), Toast.LENGTH_SHORT).show();
+ return;
+ }
+ if (strUser.length() == 0)
+ {
+ Toast.makeText(AddCameraActivity.this,
+ getResources().getString(R.string.input_camera_user), Toast.LENGTH_SHORT).show();
+ return;
+ }
+ if (option == ContentCommon.INVALID_OPTION) {
+ option = ContentCommon.ADD_CAMERA;
+ }
+ in.putExtra(ContentCommon.CAMERA_OPTION, option);
+ in.putExtra(ContentCommon.STR_CAMERA_ID, strDID);
+ in.putExtra(ContentCommon.STR_CAMERA_USER, strUser);
+ in.putExtra(ContentCommon.STR_CAMERA_PWD, strPwd);
+ in.putExtra(ContentCommon.STR_CAMERA_TYPE, CameraType);
+ progressBar.setVisibility(View.VISIBLE);
+ SystemValue.deviceName = strUser;
+ SystemValue.deviceId = strDID;
+ SystemValue.devicePass = strPwd;
+ BridgeService.setIpcamClientInterface(this);
+ NativeCaller.Init();
+ new Thread(new StartPPPPThread()).start();
+ }
+
+ @Override
+ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+ super.onActivityResult(requestCode, resultCode, data);
+ if (resultCode == RESULT_OK) {
+ Bundle bundle = data.getExtras();
+ String scanResult = bundle.getString("result");
+ didEdit.setText(scanResult);
+ }
+ }
+
+ /**
+ * BridgeService callback
+ * **/
+ @Override
+ public void callBackSearchResultData(int sysver, String strMac,
+ String strName, String strDeviceID, String strIpAddr, int port) {
+ Log.e("AddCameraActivity", strDeviceID+strName);
+ if (!listAdapter.AddCamera(strMac, strName, strDeviceID)) {
+ return;
+ }
+ }
+
+ private Handler PPPPMsgHandler = new Handler() {
+ public void handleMessage(Message msg) {
+
+ Bundle bd = msg.getData();
+ int msgParam = bd.getInt(STR_MSG_PARAM);
+ int msgType = msg.what;
+ Log.i("aaa", "===="+msgType+"--msgParam:"+msgParam);
+ String did = bd.getString(STR_DID);
+ int resid = R.string.pppp_status_connecting;
+ switch (msgType) {
+ case ContentCommon.PPPP_MSG_TYPE_PPPP_STATUS:
+
+ switch (msgParam) {
+ case ContentCommon.PPPP_STATUS_CONNECTING://0
+ resid = R.string.pppp_status_connecting;
+ progressBar.setVisibility(View.VISIBLE);
+ tag = 2;
+ break;
+ case ContentCommon.PPPP_STATUS_CONNECT_FAILED://3
+ resid = R.string.pppp_status_connect_failed;
+ progressBar.setVisibility(View.GONE);
+ tag = 0;
+ break;
+ case ContentCommon.PPPP_STATUS_DISCONNECT://4
+ resid = R.string.pppp_status_disconnect;
+ progressBar.setVisibility(View.GONE);
+ tag = 0;
+ break;
+ case ContentCommon.PPPP_STATUS_INITIALING://1
+ resid = R.string.pppp_status_initialing;
+ progressBar.setVisibility(View.VISIBLE);
+ tag = 2;
+ break;
+ case ContentCommon.PPPP_STATUS_INVALID_ID://5
+ resid = R.string.pppp_status_invalid_id;
+ progressBar.setVisibility(View.GONE);
+ tag = 0;
+ break;
+ case ContentCommon.PPPP_STATUS_ON_LINE://2 在线状态
+ resid = R.string.pppp_status_online;
+ progressBar.setVisibility(View.GONE);
+ //摄像机在线之后读取摄像机类型
+ String cmd="get_status.cgi?loginuse=admin&loginpas=" + SystemValue.devicePass
+ + "&user=admin&pwd=" + SystemValue.devicePass;
+ NativeCaller.TransferMessage(did, cmd, 1);
+ tag = 1;
+ break;
+ case ContentCommon.PPPP_STATUS_DEVICE_NOT_ON_LINE://6
+ resid = R.string.device_not_on_line;
+ progressBar.setVisibility(View.GONE);
+ tag = 0;
+ break;
+ case ContentCommon.PPPP_STATUS_CONNECT_TIMEOUT://7
+ resid = R.string.pppp_status_connect_timeout;
+ progressBar.setVisibility(View.GONE);
+ tag = 0;
+ break;
+ case ContentCommon.PPPP_STATUS_CONNECT_ERRER://8
+ resid =R.string.pppp_status_pwd_error;
+ progressBar.setVisibility(View.GONE);
+ tag = 0;
+ break;
+ default:
+ resid = R.string.pppp_status_unknown;
+ }
+ textView_top_show.setText(getResources().getString(resid));
+ if (msgParam == ContentCommon.PPPP_STATUS_ON_LINE) {
+ NativeCaller.PPPPGetSystemParams(did, ContentCommon.MSG_TYPE_GET_PARAMS);
+ NativeCaller.TransferMessage(did,
+ "get_factory_param.cgi?loginuse=admin&loginpas="
+ + SystemValue.devicePass + "&user=admin&pwd=" + SystemValue.devicePass, 1);// 检测push值
+ }
+ if (msgParam == ContentCommon.PPPP_STATUS_INVALID_ID
+ || msgParam == ContentCommon.PPPP_STATUS_CONNECT_FAILED
+ || msgParam == ContentCommon.PPPP_STATUS_DEVICE_NOT_ON_LINE
+ || msgParam == ContentCommon.PPPP_STATUS_CONNECT_TIMEOUT
+ || msgParam == ContentCommon.PPPP_STATUS_CONNECT_ERRER) {
+ NativeCaller.StopPPPP(did);
+ }
+ break;
+ case ContentCommon.PPPP_MSG_TYPE_PPPP_MODE:
+
+ break;
+ case ContentCommon.PPPP_MSG_VSNET_NOTIFY_TYPE_VUIDSTATUS:
+
+ switch (msgParam) {
+ case ContentCommon.PPPP_STATUS_CONNECTING://0
+ resid = R.string.pppp_status_connecting;
+ progressBar.setVisibility(View.VISIBLE);
+ tag = 2;
+ break;
+ case ContentCommon.PPPP_STATUS_CONNECT_FAILED://3
+ resid = R.string.pppp_status_connect_failed;
+ progressBar.setVisibility(View.GONE);
+ tag = 0;
+ break;
+ case ContentCommon.PPPP_STATUS_DISCONNECT://4
+ resid = R.string.pppp_status_disconnect;
+ progressBar.setVisibility(View.GONE);
+ tag = 0;
+ break;
+ case ContentCommon.PPPP_STATUS_INITIALING://1
+ resid = R.string.pppp_status_initialing;
+ progressBar.setVisibility(View.VISIBLE);
+ tag = 2;
+ break;
+ case ContentCommon.PPPP_STATUS_INVALID_ID://5
+ resid = R.string.pppp_status_invalid_id;
+ progressBar.setVisibility(View.GONE);
+ tag = 0;
+ break;
+ case ContentCommon.PPPP_STATUS_ON_LINE://2 在线状态
+ resid = R.string.pppp_status_online;
+ progressBar.setVisibility(View.GONE);
+ //摄像机在线之后读取摄像机类型
+ String cmd="get_status.cgi?loginuse=admin&loginpas=" + SystemValue.devicePass
+ + "&user=admin&pwd=" + SystemValue.devicePass;
+ NativeCaller.TransferMessage(did, cmd, 1);
+ tag = 1;
+ break;
+ case ContentCommon.PPPP_STATUS_DEVICE_NOT_ON_LINE://6
+ resid = R.string.device_not_on_line;
+ progressBar.setVisibility(View.GONE);
+ tag = 0;
+ break;
+ case ContentCommon.PPPP_STATUS_CONNECT_TIMEOUT://7
+ resid = R.string.pppp_status_connect_timeout;
+ progressBar.setVisibility(View.GONE);
+ tag = 0;
+ break;
+ case ContentCommon.PPPP_STATUS_CONNECT_ERRER://8
+ resid =R.string.pppp_status_pwd_error;
+ progressBar.setVisibility(View.GONE);
+ tag = 0;
+ break;
+ case ContentCommon.PPPP_STATUS_INVALID_VUID:
+ resid =R.string.pppp_status_invalid_id;
+ progressBar.setVisibility(View.GONE);
+ tag = 0;
+ break;
+ case ContentCommon.PPPP_STATUS_ALLOT_VUID:
+
+ break;
+
+ default:
+ resid = R.string.pppp_status_unknown;
+ }
+ textView_top_show.setText(getResources().getString(resid));
+ if (msgParam == ContentCommon.PPPP_STATUS_ON_LINE) {
+ NativeCaller.PPPPGetSystemParams(did, ContentCommon.MSG_TYPE_GET_PARAMS);
+ NativeCaller.TransferMessage(did,
+ "get_factory_param.cgi?loginuse=admin&loginpas="
+ + SystemValue.devicePass + "&user=admin&pwd=" + SystemValue.devicePass, 1);// 检测push值
+ }
+ if (msgParam == ContentCommon.PPPP_STATUS_INVALID_ID
+ || msgParam == ContentCommon.PPPP_STATUS_CONNECT_FAILED
+ || msgParam == ContentCommon.PPPP_STATUS_DEVICE_NOT_ON_LINE
+ || msgParam == ContentCommon.PPPP_STATUS_CONNECT_TIMEOUT
+ || msgParam == ContentCommon.PPPP_STATUS_CONNECT_ERRER) {
+ NativeCaller.StopPPPP(did);
+ }
+ break;
+ }
+ }
+ };
+
+ @Override
+ public void BSMsgNotifyData(String did, int type, int param) {
+ Log.d("ip", "type:" + type + " param:" + param);
+ Bundle bd = new Bundle();
+ Message msg = PPPPMsgHandler.obtainMessage();
+ msg.what = type;
+ bd.putInt(STR_MSG_PARAM, param);
+ bd.putString(STR_DID, did);
+ msg.setData(bd);
+ PPPPMsgHandler.sendMessage(msg);
+ if (type == ContentCommon.PPPP_MSG_TYPE_PPPP_STATUS) {
+ intentbrod.putExtra("ifdrop", param);
+ sendBroadcast(intentbrod);
+ }
+
+ }
+
+ @Override
+ public void BSSnapshotNotify(String did, byte[] bImage, int len) {
+ // TODO Auto-generated method stub
+ Log.i("ip", "BSSnapshotNotify---len"+len);
+ }
+
+ @Override
+ public void callBackUserParams(String did, String user1, String pwd1,
+ String user2, String pwd2, String user3, String pwd3) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void CameraStatus(String did, int status) {
+
+ }
+
+ @Override
+ public void onItemSelected(AdapterView> arg0, View arg1, int arg2,
+ long arg3) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView> arg0) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public void CallBackGetStatus(String did, String resultPbuf, int cmd) {
+ // TODO Auto-generated method stub
+ if (cmd == ContentCommon.CGI_IEGET_STATUS) {
+ String cameraType = spitValue(resultPbuf, "upnp_status=");
+
+ String cameraSysver = MyStringUtils.spitValue(resultPbuf, "sys_ver=");
+ MySharedPreferenceUtil.saveSystemVer(AddCameraActivity.this, did, cameraSysver);
+ int intType = Integer.parseInt(cameraType);
+ int type14 = (int) (intType >> 16) & 1;// 14位 来判断是否报警联动摄像机
+ if (intType == 2147483647) {// 特殊值
+ type14 = 0;
+ }
+ if(type14==1){
+ updateListHandler.sendEmptyMessage(2);
+ }
+ }
+ }
+
+ private String spitValue(String name, String tag) {
+ String[] strs = name.split(";");
+ for (int i = 0; i < strs.length; i++) {
+ String str1 = strs[i].trim();
+ if (str1.startsWith("var")) {
+ str1 = str1.substring(4, str1.length());
+ }
+ if (str1.startsWith(tag)) {
+ String result = str1.substring(str1.indexOf("=") + 1);
+ return result;
+ }
+ }
+ return -1 + "";
+ }
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/BaseActivity.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/BaseActivity.java
new file mode 100644
index 0000000..8f946bd
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/BaseActivity.java
@@ -0,0 +1,19 @@
+package com.ipcamera.detect;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.widget.Toast;
+
+public class BaseActivity extends Activity{
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ }
+
+ public void showToast(String content){
+ Toast.makeText(this, content, Toast.LENGTH_SHORT).show();
+ }
+ public void showToast(int rid){
+ Toast.makeText(this, getResources().getString(rid), Toast.LENGTH_LONG).show();
+ }
+ }
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/BridgeService.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/BridgeService.java
new file mode 100644
index 0000000..b1a75f1
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/BridgeService.java
@@ -0,0 +1,1455 @@
+package com.ipcamera.detect;
+
+import com.ipcamer.detect.R;
+import com.ipcamera.detect.utils.ContentCommon;
+import com.ipcamera.detect.utils.MySharedPreferenceUtil;
+import com.ipcamera.detect.utils.MyStringUtils;
+
+import vstc2.nativecaller.NativeCaller;
+import android.app.Dialog;
+import android.app.Notification;
+import android.app.NotificationManager;
+import android.app.Service;
+import android.content.Intent;
+import android.os.Binder;
+import android.os.IBinder;
+import android.util.Log;
+import com.ipcamera.detect.utils.VuidUtils;
+
+public class BridgeService extends Service
+{
+ private String TAG = BridgeService.class.getSimpleName();
+ private Notification mNotify2;
+ private NotificationManager notifyManager ;
+
+ @Override
+ public IBinder onBind(Intent intent) {
+ Log.d("tag", "BridgeService onBind()");
+ return new ControllerBinder();
+ }
+
+ class ControllerBinder extends Binder {
+ public BridgeService getBridgeService() {
+ return BridgeService.this;
+ }
+ }
+
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ Log.d("tag", "BridgeService onCreate()");
+ notifyManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
+ //NativeCaller.PPPPSetCallbackContext(this);
+ NativeCaller.PPPPSetCallbackContext2(this,-1);
+ }
+
+ @Override
+ public int onStartCommand(Intent intent, int flags, int startId) {
+ return super.onStartCommand(intent, flags, startId);
+ }
+
+ @Override
+ public void onDestroy() {
+ super.onDestroy();
+ notifyManager.cancel(R.drawable.app);
+ }
+
+ /**
+ *
+ * PlayActivity feedback method
+ *
+ * jni
+ *
+ * @param videobuf
+ *
+ * @param h264Data
+ *
+ * @param len
+ *
+ * @param width
+ *
+ * @param height
+ *
+ */
+
+ public void VideoData(String did, byte[] videobuf, int h264Data, int len,
+ int width, int height, int timestamp, short milistamp, int sessid,
+ int version, int originFrameLen) {
+ /*Log.d(TAG, "BridgeService----Call VideoData 视频数据返回...h264Data: "
+ + h264Data + " len: " + len + " videobuf len: " + len
+ + "width: " + width + "height: " + height + ",did:" + did
+ + ",sessid:" + sessid + ",version:" + version);*/
+
+ if (playInterface != null) {
+ playInterface.callBackVideoData(videobuf, h264Data, len, width,height);
+ }
+ }
+
+ public void CallBack_H264Data(String did, byte[] h264, int type, int size,
+ int timestamp, short milistamp, int sessid, int version) {
+ Log.w(TAG, "H264 数据返回:" + did + "," + h264.length + ",type:" + type
+ + ",size:" + size + ",time:" + timestamp + ",did:" + did
+ + ",sessid:" + sessid + ",version:" + version);
+ if (playInterface != null) {
+ playInterface.callBackH264Data(h264, type, size);
+ }
+ }
+
+ @SuppressWarnings("unused")
+ /**
+ * PlayActivity feedback method
+ *
+ * PPPP
+ * @param did
+ * @param msgType
+ * @param param
+ */
+ private void MessageNotify(String did, int type, int param) {
+// if (playInterface != null) {
+// playInterface.callBackMessageNotify(did, msgType, param);
+// }
+ if(type == 4 && param ==0)
+ {
+ // TODO: 录像成功回调,不作为p2p状态
+ return;
+ }
+ Log.d("vst", "###MessageNotify### did="+did+", type="+type+", param"+param+", did="+did);
+ if (ipcamClientInterface != null) {
+ ipcamClientInterface.BSMsgNotifyData(did, type, param);
+ }
+ if (wifiInterface != null) {
+ wifiInterface.callBackPPPPMsgNotifyData(did, type, param);
+ }
+
+ if (userInterface != null) {
+ userInterface.callBackPPPPMsgNotifyData(did, type, param);
+
+ }
+ }
+
+ /**
+ * PlayActivity feedback method
+ *
+ * AudioData
+ *
+ * @param pcm
+ * @param len
+ */
+ public void AudioData(byte[] pcm, int len) {
+ Log.d(TAG, "AudioData: len :+ " + len);
+ if (playInterface != null) {
+ playInterface.callBackAudioData(pcm, len);
+ }
+ }
+
+ /**
+ * IpcamClientActivity feedback method
+ *
+ * p2p statu
+ *
+ * @param param
+ */
+ public void PPPPMsgNotify(String did, int type, int param) {
+ Log.d(TAG, "PPPPMsgNotify did:" + did + " type:" + type + " param:"
+ + param);
+ if (ipcamClientInterface != null) {
+ ipcamClientInterface.BSMsgNotifyData(did, type, param);
+ }
+ if (wifiInterface != null) {
+ wifiInterface.callBackPPPPMsgNotifyData(did, type, param);
+ }
+
+ if (userInterface != null) {
+ userInterface.callBackPPPPMsgNotifyData(did, type, param);
+
+ }
+ }
+
+ /***
+ * SearchActivity feedback method
+ *
+ * **/
+
+ public void SearchResult(String sysVer, String appVer, String strMac,
+ String strName, String strDeviceID, String strIpAddr, int port) {
+
+ if (strDeviceID.length() == 0) {
+ return;
+ }
+ if (addCameraInterface != null) {
+ addCameraInterface.callBackSearchResultData(0, strMac,
+ strName, strDeviceID, strIpAddr, port);
+ }
+
+ }
+
+
+
+ // ======================callback==================================================
+ /**
+ *
+ * @param paramType
+ * @param result
+ * 0:fail 1sucess
+ */
+ public void CallBack_SetSystemParamsResult(String did, int paramType,int result)
+ {
+ switch (paramType) {
+ case ContentCommon.MSG_TYPE_SET_WIFI:
+ if (wifiInterface != null) {
+ wifiInterface.callBackSetSystemParamsResult(did, paramType,result);
+ }
+ break;
+ case ContentCommon.MSG_TYPE_SET_USER:
+ if (userInterface != null) {
+ userInterface.callBackSetSystemParamsResult(did, paramType,result);
+ }
+ break;
+ case ContentCommon.MSG_TYPE_SET_ALARM:
+ if (alarmInterface != null) {
+ // Log.d(TAG,"user result:"+result+" paramType:"+paramType);
+ alarmInterface.callBackSetSystemParamsResult(did, paramType,result);
+ }
+ break;
+ case ContentCommon.MSG_TYPE_SET_MAIL:
+ if (mailInterface != null)
+ {
+ mailInterface.callBackSetSystemParamsResult(did, paramType,
+ result);
+ }
+ break;
+ case ContentCommon.MSG_TYPE_SET_FTP:
+ if (ftpInterface != null) {
+ ftpInterface.callBackSetSystemParamsResult(did, paramType,result);
+ }
+ break;
+ case ContentCommon.MSG_TYPE_SET_DATETIME:
+ if (dateTimeInterface != null) {
+ Log.d(TAG, "user result:" + result + " paramType:" + paramType);
+ dateTimeInterface.callBackSetSystemParamsResult(did, paramType,result);
+ }
+ break;
+ case ContentCommon.MSG_TYPE_SET_RECORD_SCH:
+ if (sCardInterface != null) {
+ sCardInterface.callBackSetSystemParamsResult(did, paramType,result);
+ }
+ break;
+ case ContentCommon.CGI_IESET_ALIAS:
+ // TODO: 修改名称回调
+ break;
+ default:
+ break;
+ }
+ }
+
+ public void CallBackTransCMDString(String did, String cgi_str)
+ {
+ Log.e("vst" + "callback_CGI++++++++", cgi_str);
+ String cmd = MyStringUtils.spitValue(cgi_str, "cmd=");
+ String type = MyStringUtils.spitValue(cgi_str, "type=");
+ Log.e("callback_CGI", cgi_str);
+ if (cmd.equals("2017") && type.equals("3")) {
+ String command = MyStringUtils.spitValue(cgi_str, "command=");
+ String mask = MyStringUtils.spitValue(cgi_str, "mask=");
+ String record_plan1 = MyStringUtils.spitValue(cgi_str,
+ "record_plan1=");
+ String record_plan2 = MyStringUtils.spitValue(cgi_str,
+ "record_plan2=");
+ String record_plan3 = MyStringUtils.spitValue(cgi_str,
+ "record_plan3=");
+ String record_plan4 = MyStringUtils.spitValue(cgi_str,
+ "record_plan4=");
+ String record_plan5 = MyStringUtils.spitValue(cgi_str,
+ "record_plan5=");
+ String record_plan6 = MyStringUtils.spitValue(cgi_str,
+ "record_plan6=");
+ String record_plan7 = MyStringUtils.spitValue(cgi_str,
+ "record_plan7=");
+ String record_plan8 = MyStringUtils.spitValue(cgi_str,
+ "record_plan8=");
+ String record_plan9 = MyStringUtils.spitValue(cgi_str,
+ "record_plan9=");
+ String record_plan10 = MyStringUtils.spitValue(cgi_str,
+ "record_plan10=");
+ String record_plan11 = MyStringUtils.spitValue(cgi_str,
+ "record_plan11=");
+ String record_plan12 = MyStringUtils.spitValue(cgi_str,
+ "record_plan12=");
+ String record_plan13 = MyStringUtils.spitValue(cgi_str,
+ "record_plan13=");
+ String record_plan14 = MyStringUtils.spitValue(cgi_str,
+ "record_plan14=");
+ String record_plan15 = MyStringUtils.spitValue(cgi_str,
+ "record_plan15=");
+ String record_plan16 = MyStringUtils.spitValue(cgi_str,
+ "record_plan16=");
+ String record_plan17 = MyStringUtils.spitValue(cgi_str,
+ "record_plan17=");
+ String record_plan18 = MyStringUtils.spitValue(cgi_str,
+ "record_plan18=");
+ String record_plan19 = MyStringUtils.spitValue(cgi_str,
+ "record_plan19=");
+ String record_plan20 = MyStringUtils.spitValue(cgi_str,
+ "record_plan20=");
+ String record_plan21 = MyStringUtils.spitValue(cgi_str,
+ "record_plan21=");
+ String record_plan_enable = MyStringUtils.spitValue(cgi_str,
+ "record_plan_enable=");
+ try {
+ mTimingInterface.TimingCallback(did, command, mask,
+ record_plan1, record_plan2, record_plan3, record_plan4,
+ record_plan5, record_plan6, record_plan7, record_plan8,
+ record_plan9, record_plan10, record_plan11,
+ record_plan12, record_plan13, record_plan14,
+ record_plan15, record_plan16, record_plan17,
+ record_plan18, record_plan19, record_plan20,
+ record_plan21, record_plan_enable);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return;
+ }
+
+ if (cmd.equals("2017") && type.equals("1")) {
+ String command = MyStringUtils.spitValue(cgi_str, "command=");
+ String mask = MyStringUtils.spitValue(cgi_str, "mask=");
+ String motion_record_plan1 = MyStringUtils.spitValue(cgi_str,
+ "motion_record_plan1=");
+ String motion_record_plan2 = MyStringUtils.spitValue(cgi_str,
+ "motion_record_plan2=");
+ String motion_record_plan3 = MyStringUtils.spitValue(cgi_str,
+ "motion_record_plan3=");
+ String motion_record_plan4 = MyStringUtils.spitValue(cgi_str,
+ "motion_record_plan4=");
+ String motion_record_plan5 = MyStringUtils.spitValue(cgi_str,
+ "motion_record_plan5=");
+ String motion_record_plan6 = MyStringUtils.spitValue(cgi_str,
+ "motion_record_plan6=");
+ String motion_record_plan7 = MyStringUtils.spitValue(cgi_str,
+ "motion_record_plan7=");
+ String motion_record_plan8 = MyStringUtils.spitValue(cgi_str,
+ "motion_record_plan8=");
+ String motion_record_plan9 = MyStringUtils.spitValue(cgi_str,
+ "motion_record_plan9=");
+ String motion_record_plan10 = MyStringUtils.spitValue(cgi_str,
+ "motion_record_plan10=");
+ String motion_record_plan11 = MyStringUtils.spitValue(cgi_str,
+ "motion_record_plan11=");
+ String motion_record_plan12 = MyStringUtils.spitValue(cgi_str,
+ "motion_record_plan12=");
+ String motion_record_plan13 = MyStringUtils.spitValue(cgi_str,
+ "motion_record_plan13=");
+ String motion_record_plan14 = MyStringUtils.spitValue(cgi_str,
+ "motion_record_plan14=");
+ String motion_record_plan15 = MyStringUtils.spitValue(cgi_str,
+ "motion_record_plan15=");
+ String motion_record_plan16 = MyStringUtils.spitValue(cgi_str,
+ "motion_record_plan16=");
+ String motion_record_plan17 = MyStringUtils.spitValue(cgi_str,
+ "motion_record_plan17=");
+ String motion_record_plan18 = MyStringUtils.spitValue(cgi_str,
+ "motion_record_plan18=");
+ String motion_record_plan19 = MyStringUtils.spitValue(cgi_str,
+ "motion_record_plan19=");
+ String motion_record_plan20 = MyStringUtils.spitValue(cgi_str,
+ "motion_record_plan20=");
+ String motion_record_plan21 = MyStringUtils.spitValue(cgi_str,
+ "motion_record_plan21=");
+ String motion_record_enable = MyStringUtils.spitValue(cgi_str,
+ "motion_record_enable=");
+ try {
+ mVideoTimingInterface.VideoTimingCallback(did, command, mask,
+ motion_record_plan1, motion_record_plan2,
+ motion_record_plan3, motion_record_plan4,
+ motion_record_plan5, motion_record_plan6,
+ motion_record_plan7, motion_record_plan8,
+ motion_record_plan9, motion_record_plan10,
+ motion_record_plan11, motion_record_plan12,
+ motion_record_plan13, motion_record_plan14,
+ motion_record_plan15, motion_record_plan16,
+ motion_record_plan17, motion_record_plan18,
+ motion_record_plan19, motion_record_plan20,
+ motion_record_plan21, motion_record_enable);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return;
+ }
+ if (cmd.equals("2017") && type.equals("2")) {
+ String command = MyStringUtils.spitValue(cgi_str, "command=");
+ String mask = MyStringUtils.spitValue(cgi_str, "mask=");
+ String motion_push_plan1 = MyStringUtils.spitValue(cgi_str,
+ "motion_push_plan1=");
+ String motion_push_plan2 = MyStringUtils.spitValue(cgi_str,
+ "motion_push_plan2=");
+ String motion_push_plan3 = MyStringUtils.spitValue(cgi_str,
+ "motion_push_plan3=");
+ String motion_push_plan4 = MyStringUtils.spitValue(cgi_str,
+ "motion_push_plan4=");
+ String motion_push_plan5 = MyStringUtils.spitValue(cgi_str,
+ "motion_push_plan5=");
+ String motion_push_plan6 = MyStringUtils.spitValue(cgi_str,
+ "motion_push_plan6=");
+ String motion_push_plan7 = MyStringUtils.spitValue(cgi_str,
+ "motion_push_plan7=");
+ String motion_push_plan8 = MyStringUtils.spitValue(cgi_str,
+ "motion_push_plan8=");
+ String motion_push_plan9 = MyStringUtils.spitValue(cgi_str,
+ "motion_push_plan9=");
+ String motion_push_plan10 = MyStringUtils.spitValue(cgi_str,
+ "motion_push_plan10=");
+ String motion_push_plan11 = MyStringUtils.spitValue(cgi_str,
+ "motion_push_plan11=");
+ String motion_push_plan12 = MyStringUtils.spitValue(cgi_str,
+ "motion_push_plan12=");
+ String motion_push_plan13 = MyStringUtils.spitValue(cgi_str,
+ "motion_push_plan13=");
+ String motion_push_plan14 = MyStringUtils.spitValue(cgi_str,
+ "motion_push_plan14=");
+ String motion_push_plan15 = MyStringUtils.spitValue(cgi_str,
+ "motion_push_plan15=");
+ String motion_push_plan16 = MyStringUtils.spitValue(cgi_str,
+ "motion_push_plan16=");
+ String motion_push_plan17 = MyStringUtils.spitValue(cgi_str,
+ "motion_push_plan17=");
+ String motion_push_plan18 = MyStringUtils.spitValue(cgi_str,
+ "motion_push_plan18=");
+ String motion_push_plan19 = MyStringUtils.spitValue(cgi_str,
+ "motion_push_plan19=");
+ String motion_push_plan20 = MyStringUtils.spitValue(cgi_str,
+ "motion_push_plan20=");
+ String motion_push_plan21 = MyStringUtils.spitValue(cgi_str,
+ "motion_push_plan21=");
+ String motion_push_enable = MyStringUtils.spitValue(cgi_str,
+ "motion_push_enable=");
+ try {
+ mPushTimingInterface.PushTimingCallback(did, command, mask,
+ motion_push_plan1, motion_push_plan2,
+ motion_push_plan3, motion_push_plan4,
+ motion_push_plan5, motion_push_plan6,
+ motion_push_plan7, motion_push_plan8,
+ motion_push_plan9, motion_push_plan10,
+ motion_push_plan11, motion_push_plan12,
+ motion_push_plan13, motion_push_plan14,
+ motion_push_plan15, motion_push_plan16,
+ motion_push_plan17, motion_push_plan18,
+ motion_push_plan19, motion_push_plan20,
+ motion_push_plan21, motion_push_enable);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return;
+ }
+ if (cmd.equals("2108")) {
+ try {
+ String command = MyStringUtils.spitValue(cgi_str, "command=");
+
+ if (command.equals("-1")) return;
+ if (command.equals("0")||command.equals("1")) {
+ String sirenMode = MyStringUtils.spitValue(cgi_str, "sirenMode=");
+ String lightMode= MyStringUtils.spitValue(cgi_str, "lightMode=");
+ if (mLowPwerInterface != null) {
+ mLowPwerInterface.LowPwerCallBack(did, cmd, command, sirenMode+lightMode);
+ }
+ if (mLowPwerInterfaceForIndexCgiHelper!=null){
+ mLowPwerInterfaceForIndexCgiHelper.LowPwerCallBack(did, cmd, command, sirenMode,lightMode);
+ }
+ }
+
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return;
+ }
+
+ if (cmd.equals("2109")) {
+ try {
+ if (mCameraLightInterface != null) {
+ String command = MyStringUtils.spitValue(cgi_str, "command=");
+
+ if (command.equals("2")){
+ String sirenStatus = MyStringUtils.spitValue(cgi_str, "sirenStatus=");
+ String lightStatus = MyStringUtils.spitValue(cgi_str, "lightStatus=");
+ mCameraLightInterface.LightSireCallBack(did, cmd, command, sirenStatus,lightStatus);
+ // mLowPwerInterface.LowPwerCallBack(did, cmd, command, content);
+ }else if (command.equals("0")){
+ String sirenStatus= MyStringUtils.spitValue(cgi_str, "siren=");
+ String lightStatus =MyStringUtils.spitValue(cgi_str, "light=");
+ if (command.equals("-1")) return;
+ mLowPwerInterfaceForIndexCgiHelper.LowPwerCallBack(did, cmd, command, sirenStatus,lightStatus);
+ // mLowPwerInterface.LowPwerCallBack(did, cmd, command, content);
+ }
+
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return;
+ }
+
+ }
+
+ public void CallBack_CameraParams(String did, int resolution,int brightness, int contrast, int hue, int saturation, int flip,
+ int fram, int mode)
+ {
+ Log.d("ddd", "CallBack_CameraParams");
+ if (playInterface != null)
+ {
+ playInterface.callBackCameraParamNotify(did, resolution,brightness, contrast, hue, saturation, flip,mode);
+ }
+ }
+
+ public void P2PRawDataNotify(String did, byte[] data, int datalen,
+ int serialno) {
+
+ }
+
+ public void P2PRawDataSendStatusNotify(String did, int serialno, int len) {
+
+ }
+
+ public void CallBack_WifiParams(String did, int enable, String ssid,
+ int channel, int mode, int authtype, int encryp, int keyformat,
+ int defkey, String key1, String key2, String key3, String key4,
+ int key1_bits, int key2_bits, int key3_bits, int key4_bits,
+ String wpa_psk)
+ {
+ Log.d("ddd", "CallBack_WifiParams");
+ if (wifiInterface != null) {
+ wifiInterface.callBackWifiParams(did, enable, ssid, channel, mode,
+ authtype, encryp, keyformat, defkey, key1, key2, key3,
+ key4, key1_bits, key2_bits, key3_bits, key4_bits, wpa_psk);
+ }
+ }
+
+ public void CallBack_UserParams(String did, String user1, String pwd1,
+ String user2, String pwd2, String user3, String pwd3)
+ {
+ Log.d("ddd", "CallBack_UserParams");
+ if (userInterface != null) {
+ userInterface.callBackUserParams(did, user1, pwd1, user2, pwd2,
+ user3, pwd3);
+ }
+ if (ipcamClientInterface != null) {
+ ipcamClientInterface.callBackUserParams(did, user1, pwd1, user2,
+ pwd2, user3, pwd3);
+ }
+ }
+
+ public void CallBack_FtpParams(String did, String svr_ftp, String user,
+ String pwd, String dir, int port, int mode, int upload_interval)
+ {
+ if (ftpInterface != null) {
+ ftpInterface.callBackFtpParams(did, svr_ftp, user, pwd, dir, port,
+ mode, upload_interval);
+ }
+ }
+
+ public void CallBack_DDNSParams(String did, int service, String user,
+ String pwd, String host, String proxy_svr, int ddns_mode,int proxy_port)
+ {
+ Log.d("ddd", "CallBack_DDNSParams");
+ }
+
+ public void CallBack_MailParams(String did, String svr, int port,
+ String user, String pwd, int ssl, String sender, String receiver1,
+ String receiver2, String receiver3, String receiver4)
+ {
+ if (mailInterface != null) {
+ mailInterface.callBackMailParams(did, svr, port, user, pwd, ssl,
+ sender, receiver1, receiver2, receiver3, receiver4);
+ }
+ }
+
+ public void CallBack_DatetimeParams(String did, int now, int tz,
+ int ntp_enable, String ntp_svr)
+ {
+ if (dateTimeInterface != null) {
+ dateTimeInterface.callBackDatetimeParams(did, now, tz, ntp_enable,
+ ntp_svr);
+ }
+ }
+
+ /**
+ * IpcamClientActivity feedback method
+ *
+ * snapshot result
+ *
+ * @param did
+ * @param bImage
+ * @param len
+ */
+ public void PPPPSnapshotNotify(String did, byte[] bImage, int len) {
+ Log.d(TAG, "PPPPSnapshotNotify did:" + did + " len:" + len);
+ if (ipcamClientInterface != null) {
+ ipcamClientInterface.BSSnapshotNotify(did, bImage, len);
+ }
+ }
+
+ public void CallBack_Snapshot(String did, byte[] data, int len)
+ {
+ if (ipcamClientInterface != null) {
+ ipcamClientInterface.BSSnapshotNotify(did, data, len);
+ }
+
+ }
+
+ public void CallBack_NetworkParams(String did, String ipaddr,
+ String netmask, String gateway, String dns1, String dns2, int dhcp,
+ int port, int rtsport) {
+ Log.d("ddd", "CallBack_NetworkParams");
+ }
+
+ public void CallBack_CameraStatusParams(String did, String sysver,
+ String devname, String devid, String appver, String oemid,
+ int alarmstatus, int sdcardstatus, int sdcardtotalsize,
+ int sdcardremainsize) {
+
+ if (ipcamClientInterface != null) {
+ ipcamClientInterface.CameraStatus(did, alarmstatus);
+ }
+ if (updatefirmware != null)
+ {
+ Log.i("info", "othersSettingActivity");
+ updatefirmware.CallBack_UpdateFirmware(did,sysver, appver, oemid);
+ }
+ }
+
+ public void CallBack_PTZParams(String did, int led_mod,
+ int ptz_center_onstart, int ptz_run_times, int ptz_patrol_rate,
+ int ptz_patrul_up_rate, int ptz_patrol_down_rate,
+ int ptz_patrol_left_rate, int ptz_patrol_right_rate,
+ int disable_preset) {
+ Log.d("ddd", "CallBack_PTZParams");
+ }
+
+ public void CallBack_WifiScanResult(String did, String ssid, String mac,
+ int security, int dbm0, int dbm1, int mode, int channel, int bEnd) {
+ Log.d("tag", "CallBack_WifiScanResult");
+ if (wifiInterface != null) {
+ wifiInterface.callBackWifiScanResult(did, ssid, mac, security,
+ dbm0, dbm1, mode, channel, bEnd);
+ }
+ }
+
+ public void CallBack_AlarmParams(String did, int alarm_audio,
+ int motion_armed, int motion_sensitivity, int input_armed,
+ int ioin_level, int iolinkage, int ioout_level, int alarmpresetsit,
+ int mail, int snapshot, int record, int upload_interval,
+ int schedule_enable, int schedule_sun_0, int schedule_sun_1,
+ int schedule_sun_2, int schedule_mon_0, int schedule_mon_1,
+ int schedule_mon_2, int schedule_tue_0, int schedule_tue_1,
+ int schedule_tue_2, int schedule_wed_0, int schedule_wed_1,
+ int schedule_wed_2, int schedule_thu_0, int schedule_thu_1,
+ int schedule_thu_2, int schedule_fri_0, int schedule_fri_1,
+ int schedule_fri_2, int schedule_sat_0, int schedule_sat_1,
+ int schedule_sat_2, int defense_plan1, int defense_plan2,
+ int defense_plan3, int defense_plan4, int defense_plan5,
+ int defense_plan6, int defense_plan7, int defense_plan8,
+ int defense_plan9, int defense_plan10, int defense_plan11,
+ int defense_plan12, int defense_plan13, int defense_plan14,
+ int defense_plan15, int defense_plan16, int defense_plan17,
+ int defense_plan18, int defense_plan19, int defense_plan20,
+ int defense_plan21,int remind_rare) {
+
+ if (alarmInterface != null) {
+ alarmInterface.callBackAlarmParams(did,alarm_audio ,motion_armed,
+ motion_sensitivity, input_armed, ioin_level, iolinkage,
+ ioout_level, alarmpresetsit, mail, snapshot, record,
+ upload_interval, schedule_enable, schedule_sun_0,
+ schedule_sun_1, schedule_sun_2, schedule_mon_0,
+ schedule_mon_1, schedule_mon_2, schedule_tue_0,
+ schedule_tue_1, schedule_tue_2, schedule_wed_0,
+ schedule_wed_1, schedule_wed_2, schedule_thu_0,
+ schedule_thu_1, schedule_thu_2, schedule_fri_0,
+ schedule_fri_1, schedule_fri_2, schedule_sat_0,
+ schedule_sat_1, schedule_sat_2);
+ }
+
+
+ if (alarmParamsInterface != null) {
+ alarmParamsInterface.CallBack_AlarmParams(did, alarm_audio,
+ motion_armed, motion_sensitivity, input_armed, ioin_level,
+ iolinkage, ioout_level, alarmpresetsit, mail, snapshot,
+ record, upload_interval, schedule_enable, schedule_sun_0,
+ schedule_sun_1, schedule_sun_2, schedule_mon_0,
+ schedule_mon_1, schedule_mon_2, schedule_tue_0,
+ schedule_tue_1, schedule_tue_2, schedule_wed_0,
+ schedule_wed_1, schedule_wed_2, schedule_thu_0,
+ schedule_thu_1, schedule_thu_2, schedule_fri_0,
+ schedule_fri_1, schedule_fri_2, schedule_sat_0,
+ schedule_sat_1, schedule_sat_2, defense_plan1,
+ defense_plan2, defense_plan3, defense_plan4, defense_plan5,
+ defense_plan6, defense_plan7, defense_plan8, defense_plan9,
+ defense_plan10, defense_plan11, defense_plan12,
+ defense_plan13, defense_plan14, defense_plan15,
+ defense_plan16, defense_plan17, defense_plan18,
+ defense_plan19, defense_plan20, defense_plan21);
+ }
+ }
+ /*
+ * @param alarmtype==0x14(20) 为可视门铃按钮动作
+ *
+ */
+
+ public void CallBack_AlarmNotify(String did, int alarmtype) {
+ Log.d("tag", "callBack_AlarmNotify did:" + did + " alarmtype:"
+ + alarmtype);
+ switch (alarmtype) {
+ case ContentCommon.MOTION_ALARM:// 移动侦测报警
+ String strMotionAlarm = getResources().getString(
+ R.string.alerm_motion_alarm);
+ //getNotification(strMotionAlarm, did, true);
+ break;
+ case ContentCommon.GPIO_ALARM:
+ String strGpioAlarm = getResources().getString(
+ R.string.alerm_gpio_alarm);
+ //getNotification(strGpioAlarm, did, true);
+ break;
+ case ContentCommon.ALARM_DOORBELL:
+ //此处编写按下门铃需要执行的动作
+ //getNotification("门铃来了", did, false);
+ break;
+ case ContentCommon.HIGHTEMP_ALARM://高温报警
+ case ContentCommon.LOWTEMP_ALARM://低温报警
+ case ContentCommon.LOWPOWER_ALARM://低电报警
+ case ContentCommon.CRY_ALARM://哭声报警
+ break;
+ default:
+ break;
+ }
+
+ }
+
+ public void CallBack_RecordFileSearchResult(String did, String filename,
+ int size, int recordcount, int pagecount, int pageindex,
+ int pagesize, int bEnd) {
+ Log.d("info", "CallBack_RecordFileSearchResult did: " + did
+ + " filename: " + filename + " size: " + size);
+ if (playBackTFInterface != null) {
+ playBackTFInterface.callBackRecordFileSearchResult(did, filename,
+ size, recordcount, pagecount, pageindex, pagesize, bEnd);
+ }
+ }
+
+ public void CallBack_PlaybackVideoData(String did, byte[] videobuf,
+ int h264Data, int len, int width, int height, int time,
+ int streamid, int FrameType, int originFrameLen) {
+ Log.d(TAG, "CallBack_PlaybackVideoData len:" + len + " width:" + width
+ + " height:" + height);
+ if (playBackInterface != null) {
+ playBackInterface.callBackPlaybackVideoData(videobuf, h264Data,
+ len, width, height,time,FrameType,originFrameLen, 0, 0);
+ }
+ }
+
+ /*
+ * 录像回放参数回调
+ */
+ public void CallBack_RecordSchParams(String did, int record_cover_enable,
+ int record_timer, int record_size, int record_chnl,
+ int record_time_enable, int record_schedule_sun_0,
+ int record_schedule_sun_1, int record_schedule_sun_2,
+ int record_schedule_mon_0, int record_schedule_mon_1,
+ int record_schedule_mon_2, int record_schedule_tue_0,
+ int record_schedule_tue_1, int record_schedule_tue_2,
+ int record_schedule_wed_0, int record_schedule_wed_1,
+ int record_schedule_wed_2, int record_schedule_thu_0,
+ int record_schedule_thu_1, int record_schedule_thu_2,
+ int record_schedule_fri_0, int record_schedule_fri_1,
+ int record_schedule_fri_2, int record_schedule_sat_0,
+ int record_schedule_sat_1, int record_schedule_sat_2,
+ int record_sd_status, int sdtotal, int sdfree, int audio_enble) {
+ if (sCardInterface != null) {
+ sCardInterface.callBackRecordSchParams(did, record_cover_enable,
+ record_timer, record_size, record_time_enable,
+ record_schedule_sun_0, record_schedule_sun_1,
+ record_schedule_sun_2, record_schedule_mon_0,
+ record_schedule_mon_1, record_schedule_mon_2,
+ record_schedule_tue_0, record_schedule_tue_1,
+ record_schedule_tue_2, record_schedule_wed_0,
+ record_schedule_wed_1, record_schedule_wed_2,
+ record_schedule_thu_0, record_schedule_thu_1,
+ record_schedule_thu_2, record_schedule_fri_0,
+ record_schedule_fri_1, record_schedule_fri_2,
+ record_schedule_sat_0, record_schedule_sat_1,
+ record_schedule_sat_2, record_sd_status, sdtotal, sdfree,audio_enble);
+ }
+ Log.e(TAG, "录像计划:record_schedule_sun_0=" + record_schedule_sun_0
+ + ",record_schedule_sun_1=" + record_schedule_sun_1
+ + ",record_schedule_sun_2=" + record_schedule_sun_2
+ + ",record_schedule_mon_0=" + record_schedule_mon_0
+ + ",record_schedule_mon_1=" + record_schedule_mon_1
+ + ",record_schedule_mon_2=" + record_schedule_mon_2);
+ }
+
+// public void setUpdateFirmware(FirmwareUpdateActiviy activity,String did)
+// {
+// this.othersSettingActivity=activity;
+// NativeCaller.PPPPGetSystemParams(did, ContentCommon.MSG_TYPE_GET_STATUS);//获取版本的本地方法
+// }
+
+ //固件更新接口
+ private static Firmware updatefirmware;
+ public static void setFirmware(Firmware firmware)
+ {
+ updatefirmware=firmware;
+ }
+ public interface Firmware
+ {
+ void CallBack_UpdateFirmware(String did,String sysver, String appver,String oemid);
+ }
+
+ //通知
+ /*@SuppressWarnings("deprecation")
+ private Notification getNotification(String content, String did,boolean isAlarm)
+ {
+ *//*mNotify2 = new Notification(R.drawable.app,content, System.currentTimeMillis());
+ mNotify2.defaults |= Notification.DEFAULT_SOUND;//声音
+ mNotify2.setLatestEventInfo(BridgeService.this, "This is content title",
+ "This is content text", null);
+
+ notifyManager.notify(1, mNotify2);
+ return mNotify2;*//*
+ }*/
+
+ public static LowPwerInterface mLowPwerInterface;
+ public static LowPwerInterface mLowPwerInterfaceForLightLevel;
+ public static LowPwerInterface2109 mLowPwerInterfaceForIndexCgiHelper;
+ public static void setLowPwerInterface(LowPwerInterface2109 lowPwerInterface){
+ mLowPwerInterfaceForIndexCgiHelper=lowPwerInterface;
+ }
+
+ public static void setLowPwerInterfaceForLightLevel(LowPwerInterface lowPwerInterface){
+ mLowPwerInterfaceForLightLevel=lowPwerInterface;
+ }
+ public interface LowPwerInterface {
+ void LowPwerCallBack(String did, String command, String cmd, String content);
+ }
+
+ public interface LowPwerInterface2109 {
+ void LowPwerCallBack(String did, String command, String cmd, String siren,String light);
+ }
+
+ public static CameraLightInterfaceInterface mCameraLightInterface;
+
+ public interface CameraLightInterfaceInterface {
+ void LightSireCallBack(String did, String command, String cmd, String siren,String light);
+ }
+
+ public static void setCameraLightInterfaceInterface(CameraLightInterfaceInterface cameraLightInterfaceInterface){
+ mCameraLightInterface = cameraLightInterfaceInterface;
+ }
+
+
+ private static IpcamClientInterface ipcamClientInterface;
+ public static void setIpcamClientInterface(IpcamClientInterface ipcInterface)
+ {
+ ipcamClientInterface = ipcInterface;
+ }
+ public interface IpcamClientInterface {
+ void BSMsgNotifyData(String did, int type, int param);
+
+ void BSSnapshotNotify(String did, byte[] bImage, int len);
+
+ void callBackUserParams(String did, String user1, String pwd1,
+ String user2, String pwd2, String user3, String pwd3);
+
+ void CameraStatus(String did, int status);
+ }
+
+
+ private static PictureInterface pictureInterface;
+ public static void setPictureInterface(PictureInterface pi) {
+ pictureInterface = pi;
+ }
+
+ public interface PictureInterface {
+ void BSMsgNotifyData(String did, int type, int param);
+ }
+
+ private static VideoInterface videoInterface;
+
+ public static void setVideoInterface(VideoInterface vi)
+ {
+ videoInterface = vi;
+ }
+
+ public interface VideoInterface {
+ void BSMsgNotifyData(String did, int type, int param);
+ }
+
+ private static WifiInterface wifiInterface;
+
+ public static void setWifiInterface(WifiInterface wi) {
+ wifiInterface = wi;
+ }
+
+ public interface WifiInterface {
+ void callBackWifiParams(String did, int enable, String ssid,
+ int channel, int mode, int authtype, int encryp, int keyformat,
+ int defkey, String key1, String key2, String key3, String key4,
+ int key1_bits, int key2_bits, int key3_bits, int key4_bits,
+ String wpa_psk);
+
+ void callBackWifiScanResult(String did, String ssid, String mac,
+ int security, int dbm0, int dbm1, int mode, int channel,
+ int bEnd);
+
+ void callBackSetSystemParamsResult(String did, int paramType, int result);
+
+ void callBackPPPPMsgNotifyData(String did, int type, int param);
+ }
+
+ // 获取计划录像接口
+ public static TimingInterface mTimingInterface;
+
+ public static interface TimingInterface {
+ void TimingCallback(String did, String command, String mask,
+ String record_plan1, String record_plan2, String record_plan3,
+ String record_plan4, String record_plan5, String record_plan6,
+ String record_plan7, String record_plan8, String record_plan9,
+ String record_plan10, String record_plan11,
+ String record_plan12, String record_plan13,
+ String record_plan14, String record_plan15,
+ String record_plan16, String record_plan17,
+ String record_plan18, String record_plan19,
+ String record_plan20, String record_plan21,
+ String record_plan_enable);
+ }
+
+ public static void setTimingInterface(TimingInterface nTimingInterface) {
+ mTimingInterface = nTimingInterface;
+ }
+ // 获取移动侦测录像计划接口
+ public static VideoTimingInterface mVideoTimingInterface;
+
+ public static interface VideoTimingInterface {
+ void VideoTimingCallback(String did, String command, String mask,
+ String motion_record_plan1, String motion_record_plan2,
+ String motion_record_plan3, String motion_record_plan4,
+ String motion_record_plan5, String motion_record_plan6,
+ String motion_record_plan7, String motion_record_plan8,
+ String motion_record_plan9, String motion_record_plan10,
+ String motion_record_plan11, String motion_record_plan12,
+ String motion_record_plan13, String motion_record_plan14,
+ String motion_record_plan15, String motion_record_plan16,
+ String motion_record_plan17, String motion_record_plan18,
+ String motion_record_plan19, String motion_record_plan20,
+ String motion_record_plan21, String motion_record_enable);
+ }
+
+ public static void setVideoTimingInterface(
+ VideoTimingInterface nVideoTimingInterface) {
+ mVideoTimingInterface = nVideoTimingInterface;
+ }
+
+ // 获取移动侦测推送录像计划接口
+ public static PushTimingInterface mPushTimingInterface;
+
+ public static interface PushTimingInterface {
+ void PushTimingCallback(String did, String command, String mask,
+ String motion_push_plan1, String motion_push_plan2,
+ String motion_push_plan3, String motion_push_plan4,
+ String motion_push_plan5, String motion_push_plan6,
+ String motion_push_plan7, String motion_push_plan8,
+ String motion_push_plan9, String motion_push_plan10,
+ String motion_push_plan11, String motion_push_plan12,
+ String motion_push_plan13, String motion_push_plan14,
+ String motion_push_plan15, String motion_push_plan16,
+ String motion_push_plan17, String motion_push_plan18,
+ String motion_push_plan19, String motion_push_plan20,
+ String motion_push_plan21, String motion_push_enable);
+ }
+
+ public static void setPushTimingInterface(
+ PushTimingInterface nPushTimingInterface) {
+ mPushTimingInterface = nPushTimingInterface;
+ }
+
+ private static UserInterface userInterface;
+
+ public static void setUserInterface(UserInterface ui) {
+ userInterface = ui;
+ }
+
+ public interface UserInterface {
+ void callBackUserParams(String did, String user1, String pwd1,
+ String user2, String pwd2, String user3, String pwd3);
+
+ void callBackSetSystemParamsResult(String did, int paramType, int result);
+
+ void callBackPPPPMsgNotifyData(String did, int type, int param);
+ }
+
+ private static AlarmInterface alarmInterface;
+
+ public static void setAlarmInterface(AlarmInterface ai) {
+ alarmInterface = ai;
+ }
+
+ public interface AlarmInterface {
+ void callBackAlarmParams(String did, int motion_armed,
+ int motion_sensitivity, int input_armed, int ioin_level,
+ int iolinkage, int ioout_level, int alermpresetsit, int mail,
+ int snapshot, int record, int upload_interval,
+ int schedule_enable, int schedule_sun_0, int schedule_sun_1,
+ int schedule_sun_2, int schedule_mon_0, int schedule_mon_1,
+ int schedule_mon_2, int schedule_tue_0, int schedule_tue_1,
+ int schedule_tue_2, int schedule_wed_0, int schedule_wed_1,
+ int schedule_wed_2, int schedule_thu_0, int schedule_thu_1,
+ int schedule_thu_2, int schedule_fri_0, int schedule_fri_1,
+ int schedule_fri_2, int schedule_sat_0, int schedule_sat_1,
+ int schedule_sat_2, int schedule_sat_22);
+
+ void callBackSetSystemParamsResult(String did, int paramType, int result);
+ }
+
+ //移动侦测布防
+ private static CallBack_AlarmParamsInterface alarmParamsInterface;
+
+ public static void setCallBack_AlarmParamsInterface(
+ CallBack_AlarmParamsInterface c) {
+ alarmParamsInterface = c;
+ }
+
+ public static void setCallBack_AlarmParamsInterfaceToNull() {
+ alarmParamsInterface = null;
+ }
+
+ public interface CallBack_AlarmParamsInterface {
+ void CallBack_AlarmParams(String did, int alarm_audio,
+ int motion_armed, int motion_sensitivity, int input_armed,
+ int ioin_level, int iolinkage, int ioout_level,
+ int alarmpresetsit, int mail, int snapshot, int record,
+ int upload_interval, int schedule_enable, int schedule_sun_0,
+ int schedule_sun_1, int schedule_sun_2, int schedule_mon_0,
+ int schedule_mon_1, int schedule_mon_2, int schedule_tue_0,
+ int schedule_tue_1, int schedule_tue_2, int schedule_wed_0,
+ int schedule_wed_1, int schedule_wed_2, int schedule_thu_0,
+ int schedule_thu_1, int schedule_thu_2, int schedule_fri_0,
+ int schedule_fri_1, int schedule_fri_2, int schedule_sat_0,
+ int schedule_sat_1, int schedule_sat_2, int defense_plan1,
+ int defense_plan2, int defense_plan3, int defense_plan4,
+ int defense_plan5, int defense_plan6, int defense_plan7,
+ int defense_plan8, int defense_plan9, int defense_plan10,
+ int defense_plan11, int defense_plan12, int defense_plan13,
+ int defense_plan14, int defense_plan15, int defense_plan16,
+ int defense_plan17, int defense_plan18, int defense_plan19,
+ int defense_plan20, int defense_plan21);
+ }
+
+ private static DateTimeInterface dateTimeInterface;
+
+ public static void setDateTimeInterface(DateTimeInterface di) {
+ dateTimeInterface = di;
+ }
+
+ public interface DateTimeInterface {
+ void callBackDatetimeParams(String did, int now, int tz,
+ int ntp_enable, String ntp_svr);
+
+ void callBackSetSystemParamsResult(String did, int paramType, int result);
+ }
+
+ private static MailInterface mailInterface;
+
+ public static void setMailInterface(MailInterface mi) {
+ mailInterface = mi;
+ }
+
+ public interface MailInterface {
+ void callBackMailParams(String did, String svr, int port, String user,
+ String pwd, int ssl, String sender, String receiver1,
+ String receiver2, String receiver3, String receiver4);
+
+ void callBackSetSystemParamsResult(String did, int paramType, int result);
+ }
+
+ private static FtpInterface ftpInterface;
+
+ public static void setFtpInterface(FtpInterface fi) {
+ ftpInterface = fi;
+ }
+
+ public interface FtpInterface {
+ void callBackFtpParams(String did, String svr_ftp, String user,
+ String pwd, String dir, int port, int mode, int upload_interval);
+
+ void callBackSetSystemParamsResult(String did, int paramType, int result);
+ }
+
+ private static SDCardInterface sCardInterface;
+
+ public static void setSDCardInterface(SDCardInterface si) {
+ sCardInterface = si;
+ }
+
+ public interface SDCardInterface {
+ void callBackRecordSchParams(String did, int record_cover_enable,
+ int record_timer, int record_size, int record_time_enable,
+ int record_schedule_sun_0, int record_schedule_sun_1,
+ int record_schedule_sun_2, int record_schedule_mon_0,
+ int record_schedule_mon_1, int record_schedule_mon_2,
+ int record_schedule_tue_0, int record_schedule_tue_1,
+ int record_schedule_tue_2, int record_schedule_wed_0,
+ int record_schedule_wed_1, int record_schedule_wed_2,
+ int record_schedule_thu_0, int record_schedule_thu_1,
+ int record_schedule_thu_2, int record_schedule_fri_0,
+ int record_schedule_fri_1, int record_schedule_fri_2,
+ int record_schedule_sat_0, int record_schedule_sat_1,
+ int record_schedule_sat_2, int record_sd_status, int sdtotal,
+ int sdfree,int enable_audio);
+
+ void callBackSetSystemParamsResult(String did, int paramType, int result);;
+ }
+
+ private static PlayInterface playInterface;
+
+ public static void setPlayInterface(PlayInterface pi) {
+ playInterface = pi;
+ }
+
+ public interface PlayInterface {
+ void callBackCameraParamNotify(String did, int resolution,
+ int brightness, int contrast, int hue, int saturation, int flip,int mode);
+
+ void callBackVideoData(byte[] videobuf, int h264Data, int len,
+ int width, int height);
+
+ void callBackMessageNotify(String did, int msgType, int param);
+
+ void callBackAudioData(byte[] pcm, int len);
+
+ void callBackH264Data(byte[] h264, int type, int size);
+ }
+
+ public static void getPlayBackVideo(PlayBackInterface face) {
+ playBackInterface = face;
+ }
+
+ private static PlayBackTFInterface playBackTFInterface;
+
+ public static void setPlayBackTFInterface(PlayBackTFInterface pbtfi) {
+ playBackTFInterface = pbtfi;
+ }
+
+ public interface PlayBackTFInterface {
+ void callBackRecordFileSearchResult(String did, String filename,
+ int size, int recordcount, int pagecount, int pageindex,
+ int pagesize, int bEnd);
+ }
+
+ private static PlayBackInterface playBackInterface;
+
+ public static void setPlayBackInterface(PlayBackInterface pbi) {
+ playBackInterface = pbi;
+ }
+
+ public interface PlayBackInterface {
+ void callBackPlaybackVideoData(byte[] videobuf, int h264Data, int len,
+ int width, int height, int time, int frameType, int originFrameLen, float pos, float cachePOS);
+ }
+
+ private static AddCameraInterface addCameraInterface;
+
+ public static void setAddCameraInterface(AddCameraInterface aci) {
+ addCameraInterface = aci;
+ }
+
+ public interface AddCameraInterface {
+ void callBackSearchResultData(int cameraType, String strMac,
+ String strName, String strDeviceID, String strIpAddr, int port);
+ }
+
+ private static SensorListActivityAllDataInterface sensorListInterfece;
+ public interface SensorListActivityAllDataInterface
+ {
+ void CallBackMessage(String did, String resultPbuf, int cmd,
+ int sensorid1, int sensorid2, int sensorid3, int sensortype,
+ int sensorstatus, int presetid, int id);
+ }
+ public static void setSensorListInterface(SensorListActivityAllDataInterface sensor)
+ {
+ sensorListInterfece = sensor;
+ }
+
+ private static EditSensorListActivityInterface setEditSensor;
+ public interface EditSensorListActivityInterface {
+ void CallBackMessages(String did, String resultPbuf, int cmd);
+ }
+ public static void setSensornameInterface(EditSensorListActivityInterface sensor) {
+ setEditSensor = sensor;
+ }
+
+
+ private static CallBackMessageInterface messageInterface;
+
+ public static void setCallBackMessage(CallBackMessageInterface message) {
+ messageInterface = message;
+ }
+
+ public interface CallBackMessageInterface {
+ void CallBackGetStatus(String did, String resultPbuf, int cmd);
+ }
+
+ //
+ public void CallBackTransferMessage(String did, String resultPbuf, int cmd,
+ int sensorid1, int sensorid2, int sensorid3, int sensortype,
+ int sensorstatus, int presetid, int index) {
+ Log.e("info", "Service CallBackTransferMessage---resultPbuf:"
+ + resultPbuf + "--did:" + did + "---cmd:" + cmd + ",id1="
+ + sensorid1 + ",id2=" + sensorid2 + ",id3=" + sensorid3
+ + ",sensortype=" + sensortype + ",sensortatus=" + sensorstatus
+ + ",presetid=" + presetid + ",index:" + index);
+ if (cmd == ContentCommon.CGI_GET_SENSOR_STATUS)
+ {// 获取布撤防状态返回
+
+ }
+ if (cmd == ContentCommon.CGI_SET_SENSOR_NAME && setEditSensor != null)
+ {// 编辑传感器信息返回
+ setEditSensor.CallBackMessages(did, resultPbuf, cmd);
+ }
+ if (cmd == ContentCommon.CGI_DEL_SENSOR && setEditSensor != null)
+ {// 删除传感器返回
+ setEditSensor.CallBackMessages(did, resultPbuf, cmd);
+ }
+ if (cmd == ContentCommon.CGI_SET_SENSOR_PRESET)
+ {// 设置传感器预制返回
+ setEditSensor.CallBackMessages(did, resultPbuf, cmd);
+ }
+ if (cmd == ContentCommon.CGI_SENSOR_GETPRESET)
+ {// 获取联动摄像机绑定的看守位返回
+
+ }
+ if (cmd == ContentCommon.CGI_IEGET_STATUS)
+ {// 获取摄像机相关参数返回
+ if (messageInterface != null) {
+ messageInterface.CallBackGetStatus(did, resultPbuf, cmd);
+ }
+ }
+ if (cmd == ContentCommon.CGI_GET_SENSOR_STATUS)
+ {// 获取联动摄像机相关参数返回
+
+ }
+ //获取某一个设备已经添加的传感器列表
+ if (sensorListInterfece != null
+ && cmd != ContentCommon.CGI_SET_SENSOR_PRESET
+ && cmd != ContentCommon.CGI_DEL_SENSOR
+ && cmd != ContentCommon.CGI_SET_SENSOR_PRESET
+ && cmd != ContentCommon.CGI_SET_SENSOR_STATUS
+ && cmd != ContentCommon.CGI_IEGET_STATUS
+ && cmd != ContentCommon.CGI_SENSOR_GETPRESET
+ && cmd != ContentCommon.CGI_SET_SENSOR_NAME
+ && cmd != ContentCommon.CGI_GET_SENSOR_STATUS)
+ {
+ sensorListInterfece.CallBackMessage(did, resultPbuf, cmd,sensorid1, sensorid2, sensorid3, sensortype, sensorstatus,presetid, index);
+ }
+ if(cmd == ContentCommon.CGI_IEGET_FACTORY)
+ {
+ if (resultPbuf.contains("correctModel=")) {
+ int num = resultPbuf.indexOf("correctModel=") + "correctModel=".length();
+ String correctModel = resultPbuf.substring(num, num + 1);
+ MySharedPreferenceUtil.saveDeviceInformation(this, did, ContentCommon.DEVICE_MODEL_TYPE, correctModel);
+ }
+ }
+
+ }
+
+ /**
+ *
+ * @param did
+ * @param name
+ * @param headcmd
+ * @param selfcmd
+ * @param linkpreset
+ * @param sensortype
+ * @param sensoraction
+ * sensoraction == ContentCommon.SENSOR_ALARM_ACTION_GARRISON//
+ * 联动摄像机布防返回 sensoraction ==
+ * ContentCommon.SENSOR_ALARM_ACTION_CANCELGARRISON// 联动摄像机撤防返回
+ * sensoraction == ContentCommon.SENSOR_ALARM_ACTION_ALARM ||
+ * sensoraction == ContentCommon.SENSOR_ALARM_ACTION_SOS//
+ * 联动摄像机报警 sensoraction ==
+ * ContentCommon.SENSOR_ALARM_ACTION_LOWBATT// 联动摄像机低电
+ * sensoraction ==
+ * ContentCommon.SENSOR_ALARM_ACTION_CANCELALARM// 联动摄像机取消报警
+ * @param channel
+ * @param sensorid1
+ * @param sensorid2
+ * @param sensorid3
+ * 请求摄像机绑定传感器时 如果sensorid1 sensorid2 sensorid3 同时为255或者0 为无效传感器
+ */
+ public void CallBackAlermMessage(String did, String name, int headcmd,
+ int selfcmd, int linkpreset, int sensortype, int sensoraction,
+ int channel, int sensorid1, int sensorid2, int sensorid3) {
+ Log.e("info", "CallBackAlermMessage=====shix name:" + name
+ + " headcmd:" + headcmd + " selfcmd:" + selfcmd
+ + " linkpreset:" + linkpreset + " sensortype:" + sensortype
+ + " sensoraction:" + sensoraction + " channel:" + channel
+ + " sensorid1:" + sensorid1 + " sensorid2" + sensorid2
+ + " sensorid3:" + sensorid3);
+
+ if (sensoraction == ContentCommon.SENSOR_ALARM_ACTION_GARRISON)// 联动摄像机布防返回
+ {
+
+ }
+ // 联动摄像机撤防返回
+ if (sensoraction == ContentCommon.SENSOR_ALARM_ACTION_CANCELGARRISON)
+ {
+
+ }
+ // 联动摄像机报警
+ if (sensoraction == ContentCommon.SENSOR_ALARM_ACTION_ALARM|| sensoraction == ContentCommon.SENSOR_ALARM_ACTION_SOS)
+ {
+
+ }
+ // 联动摄像机低电
+ if (sensoraction == ContentCommon.SENSOR_ALARM_ACTION_LOWBATT)
+ {
+
+ }
+ // 联动摄像机取消报警
+ if (sensoraction == ContentCommon.SENSOR_ALARM_ACTION_CANCELALARM)
+ {
+
+ }
+
+ if (selfcmd == ContentCommon.SENSOR_ALARM_ACTION_ALARM&& sensoraction == 8)
+ {
+ // 对码返回
+ setCodeInterface.CallBackReCodeMessage(did, name, headcmd, selfcmd,linkpreset, sensortype,
+ sensoraction, channel, sensorid1,sensorid2, sensorid3);
+ }
+
+ }
+
+ //对码接口定义
+ public static void setCodeInterface(SensorSetCodeInterface sensor) {
+ setCodeInterface = sensor;
+ }
+
+ private static SensorSetCodeInterface setCodeInterface;
+
+ public interface SensorSetCodeInterface
+ {
+ void CallBackReCodeMessage(String did, String name, int headcmd,
+ int selfcmd, int linkpreset, int sensortype, int sensoraction,
+ int channel, int sensorid1, int sensorid2, int sensorid3);
+ }
+
+ public void CallBackAlermLogList(String did, String alarmdvsname, int cmd,int armtype
+ , int dvstype, int actiontype, int time, int nowCount,int nCount)
+
+ {
+
+ }
+
+ public void CallBackTransferCamList(String did, String camName, int camNum,
+ int bEnd, String camDid, String camUser, String camPwd) {
+
+ }
+
+ public void CallBackTransJson(String json) {
+
+ }
+
+ public void CallBackTransJson(String did, String json) {
+
+ }
+
+ public void CallBackOriFramLen(String uid, int originFrameLen) {
+
+ }
+
+ public void onTimeOut(Dialog dialog) {
+
+ }
+
+ public void onTransCMDString(String did, byte[] data, int lenght) {
+
+ }
+
+ //add start by ydzhu 2017-11-20 增加tf卡播放下载接口
+ public void CallBack_TFCardPlayback(String did, byte[] yuv, int type,
+ int size,int width,int height, int timestamp,float pos,float cachePOS) {
+
+ Log.e("videodate brig","did"+did+"yuv"+yuv.length+"width"+width+"height"+height);
+ if (playBackInterface != null) {
+ playBackInterface.callBackPlaybackVideoData(yuv, 1,
+ size, width, height,timestamp,type,0, pos, cachePOS);
+ }
+ }
+
+ public void CallBack_TFCardRecord(String did, float pos,int nError) {
+
+ }
+ //add end
+
+ public void CallBack_LowpowerDevMag(String did,int nState) {
+
+ }
+
+ //start vuid
+ /**
+ 搜索回调(只有sdk版本0x1240以上的就用这个收到搜索通知,低于那版本使用SearchResult收取)
+ @param sysVer: 设备固件版本
+ @param appVer: 设备
+ @param strMac: 设备Mac地址
+ @param strName: 设备名字
+ @param strDeviceID: 设备UID
+ @param strIpAddr: 设备IP
+ @param port: 设备端口号
+ @param strUID: 设备uid
+ */
+ public void CallBack_SearchVUIDResult(String sysVer, String appVer, String strMac, String strName, String strDeviceID, String strIpAddr, int port,String strUID) {
+ Log.d("vst", "user strDeviceID:" + strDeviceID + " strVUID:" + strUID + VuidUtils.isVuid(strDeviceID));
+ if (strDeviceID.length() == 0) {
+ return;
+ }
+ if (addCameraInterface != null) {
+ addCameraInterface.callBackSearchResultData(0, strMac,
+ strName, strDeviceID, strIpAddr, port);
+ }
+
+ }
+
+ //start vuid by dunn 2019-10-22
+ /**
+ StartVUID连接时状态
+ @param did: UID
+ @param vuid: vuid
+ @param type: 消息类型
+ @param param: 通知ID
+ */
+ public void VUIDMsgNotify(String did, String vuid,int type,long param) {
+ Log.d("vst", "###VUIDMsgNotify### vuid="+vuid+", type="+type+", param"+param+", did="+did);
+ if (ipcamClientInterface != null) {
+ ipcamClientInterface.BSMsgNotifyData(did, ContentCommon.PPPP_MSG_VSNET_NOTIFY_TYPE_VUIDSTATUS, (int) param);
+ }
+ if (wifiInterface != null) {
+ wifiInterface.callBackPPPPMsgNotifyData(did, ContentCommon.PPPP_MSG_VSNET_NOTIFY_TYPE_VUIDSTATUS, (int)type);
+ }
+
+ if (userInterface != null) {
+ userInterface.callBackPPPPMsgNotifyData(did, ContentCommon.PPPP_MSG_VSNET_NOTIFY_TYPE_VUIDSTATUS, (int)type);
+
+ }
+ }
+ /**20190304======进度回调
+ 合并视频文件的进度回调
+ @param did: UID
+ @param pos: 0.0~1.0进度(只代表某个文件)
+ @param index: 文件索引(第几个文件)
+ @param nError: 0:有错误 1:无错误
+ */
+ public void CallBack_MergeVideoPos(String did, float pos,int index,int nError) {
+
+ }
+
+ public void CallBack_FaceMessageResult(String did, String strFaceID,byte[] data,int len,int type, int param) {
+
+ }
+
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/Classifier.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/Classifier.java
new file mode 100644
index 0000000..1978c08
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/Classifier.java
@@ -0,0 +1,94 @@
+package com.ipcamera.detect;
+
+
+import android.graphics.Bitmap;
+import android.graphics.RectF;
+
+import java.util.List;
+
+/**
+ * Generic interface for interacting with different recognition engines.
+ */
+public interface Classifier {
+ /**
+ * An immutable result returned by a Classifier describing what was recognized.
+ */
+ public class Recognition {
+ /**
+ * A unique identifier for what has been recognized. Specific to the class, not the instance of
+ * the object.
+ */
+ private final String id;
+
+ /**
+ * Display name for the recognition.
+ */
+ private final String title;
+
+ /**
+ * A sortable score for how good the recognition is relative to others. Higher should be better.
+ */
+ private final Float confidence;
+
+ /** Optional location within the source image for the location of the recognized object. */
+ private RectF location;
+
+ public Recognition(
+ final String id, final String title, final Float confidence, final RectF location) {
+ this.id = id;
+ this.title = title;
+ this.confidence = confidence;
+ this.location = location;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public Float getConfidence() {
+ return confidence;
+ }
+
+ public RectF getLocation() {
+ return new RectF(location);
+ }
+
+ public void setLocation(RectF location) {
+ this.location = location;
+ }
+
+ @Override
+ public String toString() {
+ String resultString = "";
+ if (id != null) {
+ resultString += "[" + id + "] ";
+ }
+
+ if (title != null) {
+ resultString += title + " ";
+ }
+
+ if (confidence != null) {
+ resultString += String.format("(%.1f%%) ", confidence * 100.0f);
+ }
+
+ if (location != null) {
+ resultString += location + " ";
+ }
+
+ return resultString.trim();
+ }
+ }
+
+ List recognizeImage(Bitmap bitmap);
+
+ void enableStatLogging(final boolean debug);
+
+ String getStatString();
+
+ void close();
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/MessageActivity.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/MessageActivity.java
new file mode 100644
index 0000000..82af046
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/MessageActivity.java
@@ -0,0 +1,159 @@
+package com.ipcamera.detect;
+
+import android.app.Activity;
+import android.os.Handler;
+import android.os.Message;
+import androidx.appcompat.app.AppCompatActivity;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ListView;
+
+import com.ipcamer.detect.R;
+import com.ipcamera.detect.adapter.MessageAdapter;
+import com.ipcamera.detect.bean.ErrorBean;
+import com.ipcamera.detect.bean.JsonBean;
+import com.ipcamera.detect.bean.MessageBean;
+import com.ipcamera.detect.bean.PushBindDeviceBean;
+import com.ipcamera.detect.net.ApiCallBack;
+import com.ipcamera.detect.net.HttpConstances;
+import com.ipcamera.detect.net.VcmApi;
+import com.ipcamera.detect.utils.Log;
+import com.ipcamera.detect.utils.StringUtils;
+import com.ipcamera.detect.utils.ToastUtils;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+
+public class MessageActivity extends Activity {
+
+ private ListView mListview;
+ private PushBindDeviceBean pushBindDeviceBean=null;
+ private MessageBean mMessageBean;
+ private Button sureButton;
+ private EditText et_uid,et_time;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_message);
+
+ initView();
+ initDate();
+
+ }
+
+ private void initDate()
+ {
+ String ran=StringUtils.getFourRandom();
+ String date=(System.currentTimeMillis()+"").substring(0,10);
+ mMessageBean = new MessageBean();
+ mMessageBean.setRan(ran);
+ mMessageBean.setEncryp(StringUtils.getEncryp("281e70f4-f9e8-211e-4bea-db24d44b1adf",date,ran));
+ mMessageBean.setUid(et_uid.getText().toString());
+ mMessageBean.setDate(date);
+ //时间格式必须是2018-10-20
+ mMessageBean.setRecordDate(et_time.getText().toString());
+ }
+
+ private boolean check() {
+ if (textIsNull(et_uid)&&textIsNull(et_time)&&textIsNull(et_uid)) {
+ return true;
+ }else {
+ return false;
+ }
+ }
+
+ private boolean textIsNull(EditText editText){
+ if (editText.getText().toString().equals("")){
+ ToastUtils.show(MessageActivity.this,getString(R.string.input_null));
+ return false;
+ }else {
+ return true;
+ }
+ }
+
+ private void initView()
+ {
+ sureButton = (Button)findViewById(R.id.sure);
+ et_uid = (EditText)findViewById(R.id.et_uid);
+ et_time = (EditText)findViewById(R.id.et_time);
+ sureButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ if(check())
+ {
+ getDevicesInfo();
+ }
+ }
+ });
+ mListview = (ListView)findViewById(R.id.messagelist);
+ }
+
+
+ //记录接口
+ private void getDevicesInfo() {
+ initDate();
+ Log.e("api","getDevicesInfo"+mMessageBean.getEncryp());
+ VcmApi.get().load(HttpConstances.GETINFO, mMessageBean, new ApiCallBack() {
+ @Override
+ public void onFinish(JsonBean bean) {
+ Log.e("api","bean"+bean);
+ if(bean.getCode() == 200) {
+ //ToastUtils.show(MessageActivity.this, bean.getJson());
+ Bundle bd = new Bundle();
+ Message msg = showHandler.obtainMessage();
+ msg.what = 1;
+ bd.putString("content", bean.getJson());
+ msg.setData(bd);
+ showHandler.sendMessage(msg);
+ }
+ }
+
+ @Override
+ public void onError(ErrorBean bean) {
+ Log.e("api","bean"+bean);
+ ToastUtils.show(MessageActivity.this,bean.getErrorMsg());
+ }
+ });
+ }
+
+ Handler showHandler = new Handler() {
+ @Override
+ public void handleMessage(Message msg) {
+ Bundle bd = msg.getData();
+
+ ArrayList items = new ArrayList();
+
+ if (msg.what == 1) {
+ String msgParam = bd.getString("content");
+
+ JSONArray backBodyJson = null;// 首先把字符串转成 JSONArray 对象
+ try {
+ backBodyJson = new JSONArray(msgParam);
+ for (int i = 0;i> 2, MeasureSpec.AT_MOST);
+ super.onMeasure(widthMeasureSpec, expandSpec);
+ }
+
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/PlayActivity.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/PlayActivity.java
new file mode 100644
index 0000000..b62a68d
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/PlayActivity.java
@@ -0,0 +1,2882 @@
+package com.ipcamera.detect;
+import java.io.File;
+
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import vstc2.nativecaller.NativeCaller;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.res.Configuration;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.Color;
+import android.graphics.Matrix;
+import android.graphics.PointF;
+import android.graphics.Rect;
+import android.graphics.RectF;
+import android.graphics.Shader.TileMode;
+import android.graphics.drawable.BitmapDrawable;
+import android.graphics.drawable.ColorDrawable;
+import android.media.MediaPlayer;
+import android.opengl.GLSurfaceView;
+import android.os.AsyncTask;
+import android.os.Build;
+import android.os.Bundle;
+import android.os.Environment;
+import android.os.Handler;
+import android.os.HandlerThread;
+import android.os.Message;
+
+import androidx.annotation.RequiresApi;
+import androidx.viewpager.widget.ViewPager.OnPageChangeListener;
+import androidx.viewpager.widget.ViewPager;
+
+import android.util.Log;
+import android.view.GestureDetector;
+import android.view.GestureDetector.OnGestureListener;
+import android.view.Display;
+import android.view.Gravity;
+import android.view.KeyEvent;
+import android.view.LayoutInflater;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.View.OnTouchListener;
+import android.view.Window;
+import android.view.WindowManager;
+import android.view.animation.Animation;
+import android.view.animation.AnimationUtils;
+import android.widget.Button;
+import android.widget.FrameLayout;
+import android.widget.HorizontalScrollView;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.PopupWindow;
+import android.widget.SeekBar;
+import android.widget.PopupWindow.OnDismissListener;
+import android.widget.SeekBar.OnSeekBarChangeListener;
+import android.widget.TextView;
+import android.widget.Toast;
+
+
+import com.ipcamer.detect.R;
+import com.ipcamera.detect.BridgeService.PlayInterface;
+import com.ipcamera.detect.adapter.ViewPagerAdapter;
+import com.ipcamera.detect.utils.AudioPlayer;
+import com.ipcamera.detect.utils.ContentCommon;
+import com.ipcamera.detect.utils.CustomAudioRecorder;
+import com.ipcamera.detect.utils.CustomAudioRecorder.AudioRecordResult;
+import com.ipcamera.detect.utils.CustomBuffer;
+import com.ipcamera.detect.utils.CustomBufferData;
+import com.ipcamera.detect.utils.CustomBufferHead;
+import com.ipcamera.detect.utils.DrawCaptureRect;
+import com.ipcamera.detect.utils.MyRender;
+import com.ipcamera.detect.utils.MySharedPreferenceUtil;
+import com.ipcamera.detect.utils.SystemValue;
+import com.ipcamera.detect.utils.VideoFramePool;
+
+import com.tenginekit.AndroidConfig;
+import com.tenginekit.KitCore;
+import com.tenginekit.face.Face;
+import com.tenginekit.face.FaceDetectInfo;
+import com.tenginekit.face.FaceIrisInfo;
+import com.tenginekit.face.FaceLandmark3dInfo;
+import com.tenginekit.face.FaceLandmarkInfo;
+import com.tenginekit.model.TenginekitPoint;
+
+import com.ipcamera.detect.model.TensorFlowObjectDetectionAPIModel;
+/**
+ * 预览界面的活动
+ * @author Liu Huanxi
+ * @Date 2021/6/5
+ * 文件名:PlayActivity.java
+ * @Description 预览模式的活动类,检测驾驶员行为
+ **/
+
+public class PlayActivity extends Activity implements OnTouchListener,OnGestureListener, OnClickListener, PlayInterface ,AudioRecordResult ,BridgeService.CameraLightInterfaceInterface {
+ //调试时用到的TAG
+ private static final String LOG_TAG = "PlayActivity";
+
+ /**疲劳检测请求的msg_index*/
+ protected static final int FATIGUE_MSG = 137;
+ /**偏头检测请求的msg_index*/
+ protected static final int NOD_MSG = 138;
+ /**初始化请求的msg_index*/
+ protected static final int INIT_MSG = 139;
+ /**子线程开启的用于检测抽烟、打电话的handle名称*/
+ private static final String HANDLE_THREAD_NAME = "cameraBackground";
+
+ /**定时处理检测消息的Handler和timer*/
+ protected Handler timeHandler;
+ Timer timer4Fatigue = null;
+ Timer timer4Nod = null;
+ Timer timer4Init = null;
+
+ /**轻度疲劳连续出现的时间阙值*/
+ protected int twiceTimes = 2;
+ /**疲劳程度*/
+ protected double fatigueDegree = 0;
+ /**轻度疲劳程度的阈值*/
+ protected static double fatigueThreshold1 = 0.23;
+ /**中度疲劳程度的阈值*/
+ protected static double fatigueThreshold2 = 0.69;
+ /**重度疲劳程度的阈值*/
+ protected static double fatigueThreshold3 = 1.61;
+ /**特别疲劳程度的阈值*/
+ protected static double fatigueThreshold4 = 2.3;
+
+ /**判定闭眼的阈值,PERCLOS测量使用P70标准*/
+ protected static double eyesCloseThreshold = 0.7;
+ /**PERCLOS的值*/
+ protected double perclosDegree = 0;
+ /**1分钟平均闭眼时间*/
+ protected double avgBlinkTime = 0;
+ /**1分钟闭眼的帧数*/
+ protected int eyesCloseNumber = 0;
+ /**1分钟总帧数*/
+ protected int totalFrameNumber = 0;
+ //*1分钟眨眼次数*/
+ protected int blinkNumber = 0;
+ /**是否处于闭眼*/
+ protected boolean isEyesClose = false;
+
+ /**采用二次判决的方式判定打哈欠
+ 1分钟打哈欠的个数*/
+ protected int yawnNumber = 0;
+ /**判断哈欠的第一个阙值*/
+ protected static double yawnThreshold1 = 0.65;
+ /**判断哈欠的第二个阙值*/
+ protected static double yawnThreshold2 = 0.5;
+ /**哈欠持续的帧判定阙值,本设备设置的帧数是15帧/s */
+ protected static double yawnFrameThreshold1 = 15;
+ protected static double yawnFrameThreshold2 = 45;
+ protected static double yawnFrameThreshold3 = 75;
+ /**哈欠程度是否处于第一个阙值和第二个之间,即小哈欠*/
+ protected boolean isSmallYawn = false;
+ /**哈欠程度是否处于大于第一个阙值,即打哈欠*/
+ protected boolean isBigYawn = false;
+ /**连续大于第一个阈值,加1*/
+ protected int yawnFrame1 = 0;
+ /**连续大于第二个阙值,加1*/
+ protected int yawnFrame2 = 0;
+ /**大哈欠连续最大帧数目*/
+ protected int maxYawnFrame1 = 0;
+ /**小哈欠连续最大帧数目*/
+ protected int maxYawnFrame2 = 0;
+
+ /**普通情况时头部姿态参数,分别代表了头在三个方向转向的度数初始化过程中得到*/
+ protected float normalPitch = 0;
+ protected float normalRoll = 0;
+ protected float normalYaw = 0;
+
+ /**初始化normalPitch normalRoll normalYaw用到的,用来计算前15s的平均值*/
+ protected float totalPitch = 0;
+ protected float totalRoll = 0;
+ protected float totalYaw = 0;
+ /**是否需要初始化头部姿态*/
+ protected boolean initPosition = true;
+ /**初始化所需的帧数*/
+ protected int initFrame = 0;
+
+ /**一段时间内偏头的帧数*/
+ protected int headNodFrame = 0;
+ /**一段时间内不偏头的帧数*/
+ protected int headNormalFrame = 0;
+
+ /**注意力的阈值*/
+ protected static double noticeThreshold1 = 0.45;
+ protected static double noticeThreshold2 = 0.65;
+ /**连续失去注意力的帧数*/
+ private int loseNoticeFrame = 0;
+
+ /**连续未检测出人的帧数*/
+ private int notDetectFrame = 0;
+ /**判断初始化过程中是否检测不到人*/
+ private boolean fail2Init = false;
+
+ /** 摄像头返回的视频流宽*/
+ protected int previewWidth;
+ /** 摄像头返回的视频流高*/
+ protected int previewHeight;
+ /** 平面展示的宽*/
+ protected static double ScreenWidth;
+ /** 平面展示的高*/
+ protected static double ScreenHeight;
+
+ /** 摄像头返回的数据流*/
+ protected byte[] mNV21Bytes = null;
+ /**获取数据流的子线程*/
+ protected Runnable imageConverter;
+
+ /**人脸矩形框对象*/
+ protected DrawCaptureRect mFaceRect = null;
+
+ /**警报提示播放器*/
+ protected MediaPlayer alarmPlayer = null;
+ /**警报完成监听器*/
+ protected MediaPlayer.OnCompletionListener onCompletionListener;
+ /**判定是否在警报*/
+ protected boolean isAlarming = false;
+
+ /**判断抽烟和接电话的子线程*/
+ private HandlerThread backgroundThread;
+ /**
+ * A {@link Handler} 对应上方子线程的Handler
+ */
+ private Handler backgroundHandler;
+
+ /**同步锁,重复的分类计算*/
+ private final Object lock = new Object();
+ /**是否在进行分类计算*/
+ private boolean runClassifier = false;
+ /**判断吸烟和接电话的分类器*/
+ private Classifier classifier;
+ /**分类器对应模型文件*/
+ private static final String TF_OD_API_MODEL_FILE = "file:///android_asset/frozen_inference_graph_v6.pb";
+ /**分类器对应的LABEL列表*/
+ private static final String TF_OD_API_LABELS_FILE = "file:///android_asset/coco_labels_list.txt";
+ /**分类输入的位图的大小*/
+ private static final int TF_OD_API_INPUT_SIZE = 300;
+ /**分类结果的致信度的阙值*/
+ private static final float MINIMUM_CONFIDENCE_TF_OD_API = 0.6f;
+
+ private static final int AUDIO_BUFFER_START_CODE = 0xff00ff;
+ //surfaceView控键
+ private GLSurfaceView playSurface = null;
+ //GLSurfaceView的渲染器
+ private MyRender myRender;
+ /**
+ * videodata:视频流数据
+ * videoDataLen:视频流长度
+ * nVideoWidths:视频的宽
+ * nVideoHeights:视频的高
+ */
+ private byte[] videodata = null;
+ private int videoDataLen = 0;
+ public int nVideoWidths = 0;
+ public int nVideoHeights = 0;
+
+ private View progressView = null;//滚动圈视图
+ private boolean bProgress = true;
+ private GestureDetector gt = new GestureDetector(this);//手势监听器
+ private final int BRIGHT = 1;//亮度标志
+ private final int CONTRAST = 2;//对比度标志
+ private final int IR_STATE = 14;//IR(夜视)开关
+ private int nResolution = 0;//分辨率值
+ private int nBrightness = 0;//亮度值
+ private int nContrast = 0;//对比度
+
+ private boolean bInitCameraParam = false;
+ private boolean bManualExit = false;
+ private TextView textosd = null;
+ private String strName = null;
+ private String strDID = null;
+ private View osdView = null;
+ private boolean bDisplayFinished = true;
+ private CustomBuffer AudioBuffer = null;
+ private AudioPlayer audioPlayer = null;
+ private boolean bAudioStart = false;
+
+ private boolean isUpDownPressed = false;
+ private ImageView videoViewPortrait;
+ private ImageView videoViewStandard;
+ //底部控件声明
+ private HorizontalScrollView bottomView;
+ private ImageButton ptzAudio, ptztalk, ptzDefaultSet, ptzBrightness, ptzContrast, ptzTake_photos, ptzTake_vodeo, ptzResolutoin, preset;
+ private int nStreamCodecType;//分辨率格式
+
+
+ private PopupWindow controlWindow;//设备方向控制提示控件
+ private PopupWindow mPopupWindowProgress;//进度条控件
+ private PopupWindow presetBitWindow;//预置位面板
+ private PopupWindow resolutionPopWindow;//分辨率面板
+ //上下左右提示文本
+ private TextView control_item;
+ //正在控制设备
+ private boolean isControlDevice = false;
+
+ private String stqvga = "qvga";
+ private String stvga = "vga";
+ private String stqvga1 = "qvga1";
+ private String stvga1 = "vga1";
+ private String stp720 = "p720";
+ private String sthigh = "high";
+ private String stmiddle = "middle";
+ private String stmax = "max";
+
+ //预位置设置
+ private Button[] btnLeft = new Button[16];
+ private Button[] btnRigth = new Button[16];
+ private ViewPager prePager;
+ private List listViews;
+ //分辨率标识符
+ private boolean ismax = false;
+ private boolean ishigh = false;
+ private boolean isp720 = false;
+ private boolean ismiddle = false;
+ private boolean isqvga1 = false;
+ private boolean isvga1 = false;
+ private boolean isqvga = false;
+ private boolean isvga = false;
+
+ private Animation showAnim;
+ private boolean isTakepic = false;//是否需要拍照
+ private boolean isPictSave = false;//是否需要存照片
+ private boolean isTalking = false;//是否在说话
+ private boolean isMcriophone = false;//是否打开麦克风
+ public boolean isH264 = false;//是否是H264格式标志
+ public boolean isJpeg = false;//图片是否为Jpeg格式
+ private boolean isTakeVideo = false;//是否在录像
+ private long videotime = 0;// 录每张图片的时间
+
+ private Animation dismissAnim;
+ private int timeTag = 0;
+ private int timeOne = 0;
+ private int timeTwo = 0;
+ private BitmapDrawable drawable = null;
+ private boolean bAudioRecordStart = false;
+ //送话器
+ private CustomAudioRecorder customAudioRecorder;
+
+ private ImageButton lightBtn, sireBtn;
+ private int picNum = 0;//拍照张数标识
+ /**
+ * @Description 弹出退出确定的对话框
+ * @Throws:
+ * NullPointerException dialog分配内存失败
+ */
+ public void showSureDialog() {
+ AlertDialog.Builder builder = null;
+ try{
+ builder = new AlertDialog.Builder(this);
+ }catch (NullPointerException np){
+ Log.e(LOG_TAG, "showSureDialog: builder is null");
+ return;
+ }
+ builder.setIcon(R.drawable.app);
+ builder.setTitle(getResources().getString(R.string.exit)
+ + getResources().getString(R.string.app_name));
+ builder.setMessage(R.string.exit_alert);
+ builder.setPositiveButton(R.string.str_ok,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int whichButton) {
+ Intent intent = new Intent("finish");
+ sendBroadcast(intent);
+ PlayActivity.this.finish();
+ }
+ });
+ builder.setNegativeButton(R.string.str_cancel, null);
+ builder.show();
+ }
+
+ @SuppressLint("HandlerLeak")
+ private Handler deviceParamsHandler = new Handler() {
+ public void handleMessage(Message msg) {
+ switch (msg.what) {
+ case 11:
+ lightBtn.setBackground(getResources().getDrawable(R.drawable.camera_light_btn_off));
+ break;
+ case 12:
+ lightBtn.setBackground(getResources().getDrawable(R.drawable.camera_light_btn_on));
+ break;
+ case 13:
+ sireBtn.setBackground(getResources().getDrawable(R.drawable.camera_siren_btn_off));
+ break;
+ case 14:
+ sireBtn.setBackground(getResources().getDrawable(R.drawable.camera_siren_btn_on));
+ break;
+ default:
+ break;
+ }
+ }
+ };
+
+ //默认视频参数
+ private void defaultVideoParams() {
+ nBrightness = 1;//设置亮度
+ nContrast = 128;//设置对比度
+ NativeCaller.PPPPCameraControl(strDID, 1, 0);
+ NativeCaller.PPPPCameraControl(strDID, 2, 128);
+ showToast(R.string.ptz_default_vedio_params);
+ }
+
+ private void showToast(int i) {
+ Toast.makeText(PlayActivity.this, i, Toast.LENGTH_SHORT).show();
+ }
+
+ //设置视频可见
+ private void setViewVisible() {
+ if (bProgress) {
+ bProgress = false;
+ progressView.setVisibility(View.INVISIBLE);
+ osdView.setVisibility(View.VISIBLE);
+ getCameraParams();
+ }
+ }
+
+ int disPlaywidth;
+ private Bitmap mBmp;
+ @SuppressLint("HandlerLeak")
+ private Handler mHandler = new Handler() {
+ public void handleMessage(Message msg) {
+ if (msg.what == 1 || msg.what == 2) {
+ setViewVisible();
+ }
+ if (!isPTZPrompt) {
+ isPTZPrompt = true;
+ showToast(R.string.ptz_control);
+ }
+ int width = getWindowManager().getDefaultDisplay().getWidth();
+ int height = getWindowManager().getDefaultDisplay().getHeight();
+ switch (msg.what) {
+ case 1: // h264的视频流回调后触发,对视频的显示做了一些设置
+ {
+ if (reslutionlist.size() == 0) {
+ if (nResolution == 0) {
+ ismax = true;
+ ismiddle = false;
+ ishigh = false;
+ isp720 = false;
+ isqvga1 = false;
+ isvga1 = false;
+ addReslution(stmax, ismax);
+ } else if (nResolution == 1) {
+ ismax = false;
+ ismiddle = false;
+ ishigh = true;
+ isp720 = false;
+ isqvga1 = false;
+ isvga1 = false;
+ addReslution(sthigh, ishigh);
+ } else if (nResolution == 2) {
+ ismax = false;
+ ismiddle = true;
+ ishigh = false;
+ isp720 = false;
+ isqvga1 = false;
+ isvga1 = false;
+ addReslution(stmiddle, ismiddle);
+ } else if (nResolution == 3) {
+ ismax = false;
+ ismiddle = false;
+ ishigh = false;
+ isp720 = true;
+ isqvga1 = false;
+ isvga1 = false;
+ addReslution(stp720, isp720);
+ nResolution = 3;
+ } else if (nResolution == 4) {
+ ismax = false;
+ ismiddle = false;
+ ishigh = false;
+ isp720 = false;
+ isqvga1 = false;
+ isvga1 = true;
+ addReslution(stvga1, isvga1);
+ } else if (nResolution == 5) {
+ ismax = false;
+ ismiddle = false;
+ ishigh = false;
+ isp720 = false;
+ isqvga1 = true;
+ isvga1 = false;
+ addReslution(stqvga1, isqvga1);
+ }
+ } else {
+ if (reslutionlist.containsKey(strDID)) {
+ getReslution();
+ } else {
+ if (nResolution == 0) {
+ ismax = true;
+ ismiddle = false;
+ ishigh = false;
+ isp720 = false;
+ isqvga1 = false;
+ isvga1 = false;
+ addReslution(stmax, ismax);
+ } else if (nResolution == 1) {
+ ismax = false;
+ ismiddle = false;
+ ishigh = true;
+ isp720 = false;
+ isqvga1 = false;
+ isvga1 = false;
+ addReslution(sthigh, ishigh);
+ } else if (nResolution == 2) {
+ ismax = false;
+ ismiddle = true;
+ ishigh = false;
+ isp720 = false;
+ isqvga1 = false;
+ isvga1 = false;
+ addReslution(stmiddle, ismiddle);
+ } else if (nResolution == 3) {
+ ismax = false;
+ ismiddle = false;
+ ishigh = false;
+ isp720 = true;
+ isqvga1 = false;
+ isvga1 = false;
+ addReslution(stp720, isp720);
+ nResolution = 3;
+ } else if (nResolution == 4) {
+ ismax = false;
+ ismiddle = false;
+ ishigh = false;
+ isp720 = false;
+ isqvga1 = false;
+ isvga1 = true;
+ addReslution(stvga1, isvga1);
+ } else if (nResolution == 5) {
+ ismax = false;
+ ismiddle = false;
+ ishigh = false;
+ isp720 = false;
+ isqvga1 = true;
+ isvga1 = false;
+ addReslution(stqvga1, isqvga1);
+ }
+ }
+ }
+
+ if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
+ FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(
+ width, width * 3 / 4);
+ lp.gravity = Gravity.CENTER;
+ playSurface.setLayoutParams(lp);
+ } else if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
+ FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(
+ width, height);
+ lp.gravity = Gravity.CENTER;
+ playSurface.setLayoutParams(lp);
+ }
+ //将视频流存储在视频帧池里
+ framePool.pushBytes(videodata, videoDataLen, nVideoWidths, nVideoHeights);
+ //myRender.writeSample(videodata, nVideoWidths, nVideoHeights);
+ }
+ break;
+ case 2: // 回调的是JPEG格式,则构建相应的位图并存储
+ {
+ if (reslutionlist.size() == 0) {
+ if (nResolution == 1) {
+ isvga = true;
+ isqvga = false;
+ addReslution(stvga, isvga);
+ } else if (nResolution == 0) {
+ isqvga = true;
+ isvga = false;
+ addReslution(stqvga, isqvga);
+ }
+ } else {
+ if (reslutionlist.containsKey(strDID)) {
+ getReslution();
+ } else {
+ if (nResolution == 1) {
+ isvga = true;
+ isqvga = false;
+ addReslution(stvga, isvga);
+ } else if (nResolution == 0) {
+ isqvga = true;
+ isvga = false;
+ addReslution(stqvga, isqvga);
+ }
+ }
+ }
+ //解码视频流
+ try{
+ mBmp = BitmapFactory.decodeByteArray(videodata, 0, videoDataLen);
+ }catch (NullPointerException np){
+ Log.e(LOG_TAG, "handleMessage: fail to decode Byte Array" );
+ }
+ if (mBmp == null) {
+ bDisplayFinished = true;
+ return;
+ }
+ if (isTakepic) {
+ takePicture(mBmp);
+ isTakepic = false;
+ }
+ nVideoWidths = mBmp.getWidth();
+ nVideoHeights = mBmp.getHeight();
+
+ if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
+ // 创建位图
+ Bitmap bitmap = Bitmap.createScaledBitmap(mBmp, width,
+ width * 3 / 4, true);
+ //videoViewLandscape.setVisibility(View.GONE);
+ videoViewPortrait.setVisibility(View.VISIBLE);
+ videoViewPortrait.setImageBitmap(bitmap);
+
+ } else if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
+ Bitmap bitmap = Bitmap.createScaledBitmap(mBmp, width, height, true);
+ videoViewPortrait.setVisibility(View.GONE);
+ //videoViewLandscape.setVisibility(View.VISIBLE);
+ //videoViewLandscape.setImageBitmap(bitmap);
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ if (msg.what == 1 || msg.what == 2) {
+ bDisplayFinished = true;
+ }
+ }
+
+ };
+ //获得摄像头的一些设置
+ private void getCameraParams() {
+ NativeCaller.PPPPGetSystemParams(strDID,
+ ContentCommon.MSG_TYPE_GET_CAMERA_PARAMS);
+ }
+
+ //设备消息的处理器,响应设备断开连接
+ @SuppressLint("HandlerLeak")
+ private Handler msgHandler = new Handler() {
+ public void handleMessage(Message msg) {
+ if (msg.what == 1) {
+ //Log.d("tag", "断线了");
+ Toast.makeText(getApplicationContext(),
+ R.string.pppp_status_disconnect, Toast.LENGTH_SHORT)
+ .show();
+ finish();
+ }
+ }
+ };
+ //视频流帧池,存储视频流,保证以一个稳定的帧数输出
+ private VideoFramePool framePool;
+
+ /**
+ *
+ * @param savedInstanceState
+ */
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ // getDataFromOther();
+
+ getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
+ WindowManager.LayoutParams.FLAG_FULLSCREEN);
+ requestWindowFeature(Window.FEATURE_NO_TITLE);
+ setContentView(R.layout.play);
+ //mine
+ onCompletionListener = new MediaPlayer.OnCompletionListener() {
+ @Override
+ public void onCompletion(MediaPlayer mp) {
+ isAlarming = false;
+ }
+ };
+ if (alarmPlayer != null) {
+ alarmPlayer.release();
+ }
+ alarmPlayer = MediaPlayer.create(this, R.raw.first_init);
+ alarmPlayer.setOnCompletionListener(onCompletionListener);
+ alarmPlayer.start();
+ isAlarming = true;
+ showToast(R.string.initing);
+ mFaceRect = new DrawCaptureRect(getApplicationContext(),
+ 190, 10, 1, 1, getResources().getColor(R.color.color_green));
+ //在一个activity上面添加额外的content
+ addContentView(mFaceRect, new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT));
+ try {
+ classifier = TensorFlowObjectDetectionAPIModel.create(
+ this.getAssets(), TF_OD_API_MODEL_FILE, TF_OD_API_LABELS_FILE, TF_OD_API_INPUT_SIZE);
+ } catch (IOException e) {
+ Log.e(LOG_TAG, "Failed to initialize an image classifier.");
+ }
+
+ strName = SystemValue.deviceName;
+ strDID = SystemValue.deviceId;
+ BridgeService.setCameraLightInterfaceInterface(PlayActivity.this);
+ disPlaywidth = getWindowManager().getDefaultDisplay().getWidth();
+ findView();
+ AudioBuffer = new CustomBuffer();
+ audioPlayer = new AudioPlayer(AudioBuffer);
+ customAudioRecorder = new CustomAudioRecorder(this);
+ BridgeService.setPlayInterface(this);
+ NativeCaller.StartPPPPLivestream(strDID, 10, 1);//确保不能重复start
+
+ getCameraParams();
+ dismissTopAnim = AnimationUtils.loadAnimation(this,
+ R.anim.ptz_top_anim_dismiss);
+ showTopAnim = AnimationUtils.loadAnimation(this,
+ R.anim.ptz_top_anim_show);
+ showAnim = AnimationUtils.loadAnimation(this,
+ R.anim.ptz_otherset_anim_show);
+ dismissAnim = AnimationUtils.loadAnimation(this,
+ R.anim.ptz_otherset_anim_dismiss);
+
+ myRender = new MyRender(playSurface);
+ framePool = new VideoFramePool(playSurface, myRender);
+ framePool.setFrameRate(15);
+ framePool.start();
+ playSurface.setRenderer(myRender);
+
+ showBottom();
+
+ //灯与警笛
+ if (SystemValue.supportLightAndSirenO13AndO10(MySharedPreferenceUtil.getSystemVer(this, strDID))) {
+ getLightAndSirenStatte(strDID, SystemValue.devicePass);
+ lightBtn.setVisibility(View.VISIBLE);
+ sireBtn.setVisibility(View.VISIBLE);
+ } else {
+ lightBtn.setVisibility(View.GONE);
+ sireBtn.setVisibility(View.GONE);
+ }
+ }
+
+
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
+ if (mPopupWindowProgress != null && mPopupWindowProgress.isShowing()) {
+ mPopupWindowProgress.dismiss();
+ }
+ if (resolutionPopWindow != null && resolutionPopWindow.isShowing()) {
+ resolutionPopWindow.dismiss();
+ }
+ if (keyCode == KeyEvent.KEYCODE_MENU) {
+ if (!bProgress) {
+ Date date = new Date();
+ if (timeTag == 0) {
+ timeOne = date.getSeconds();
+ timeTag = 1;
+ showToast(R.string.main_show_back);
+ } else if (timeTag == 1) {
+ timeTwo = date.getSeconds();
+ if (timeTwo - timeOne <= 3) {
+ Intent intent = new Intent("finish");
+ sendBroadcast(intent);
+ PlayActivity.this.finish();
+ timeTag = 0;
+ } else {
+ timeTag = 1;
+ showToast(R.string.main_show_back);
+ }
+ }
+ } else {
+ showSureDialog();
+ }
+ return true;
+ }
+ if (keyCode == KeyEvent.KEYCODE_BACK) {
+ if (!bProgress) {
+ showBottom();
+ } else {
+ showSureDialog();
+ }
+ framePool.exit();
+ }
+ return super.onKeyDown(keyCode, event);
+ }
+
+ protected void setResolution(int Resolution) {
+ Log.d("tag", "setResolution resolution:" + Resolution);
+ NativeCaller.PPPPCameraControl(strDID, 16, Resolution);
+ }
+
+ private void findView() {
+ //方向控制提示框
+ initControlDailog();
+ //视频渲染画面控件
+ playSurface = (GLSurfaceView) findViewById(R.id.mysurfaceview);
+ playSurface.setOnTouchListener(this);
+ playSurface.setLongClickable(true);//确保手势识别正确工作
+
+ videoViewPortrait = (ImageView) findViewById(R.id.vedioview);
+ videoViewStandard = (ImageView) findViewById(R.id.vedioview_standard);
+
+ progressView = (View) findViewById(R.id.progressLayout);
+ //顶部
+ osdView = (View) findViewById(R.id.osdlayout);
+
+ //显示设备名称
+ textosd = (TextView) findViewById(R.id.textosd);
+ textosd.setText(strName);
+ textosd.setVisibility(View.VISIBLE);
+
+
+ //底部菜单
+ bottomView = (HorizontalScrollView) findViewById(R.id.bottom_view);
+
+ ptztalk = (ImageButton) findViewById(R.id.ptz_talk);
+ ptzAudio = (ImageButton) findViewById(R.id.ptz_audio);
+ ptzTake_photos = (ImageButton) findViewById(R.id.ptz_take_photos);
+ ptzTake_vodeo = (ImageButton) findViewById(R.id.ptz_take_videos);
+ ptzDefaultSet = (ImageButton) findViewById(R.id.ptz_default_set);
+ ptzBrightness = (ImageButton) findViewById(R.id.ptz_brightness);
+ ptzContrast = (ImageButton) findViewById(R.id.ptz_contrast);
+ ptzResolutoin = (ImageButton) findViewById(R.id.ptz_resolution);
+ preset = (ImageButton) findViewById(R.id.preset);
+
+ lightBtn = (ImageButton) findViewById(R.id.light);
+ sireBtn = (ImageButton) findViewById(R.id.sire);
+
+ ptztalk.setOnClickListener(this);
+ ptzAudio.setOnClickListener(this);
+ ptzTake_photos.setOnClickListener(this);
+ ptzTake_vodeo.setOnClickListener(this);
+ ptzBrightness.setOnClickListener(this);
+ ptzContrast.setOnClickListener(this);
+ ptzResolutoin.setOnClickListener(this);
+ ptzDefaultSet.setOnClickListener(this);
+ preset.setOnClickListener(this);
+ lightBtn.setOnClickListener(this);
+ sireBtn.setOnClickListener(this);
+
+ Bitmap bitmap = BitmapFactory.decodeResource(getResources(),
+ R.drawable.top_bg);
+ drawable = new BitmapDrawable(bitmap);
+ drawable.setTileModeXY(TileMode.REPEAT, TileMode.REPEAT);
+ drawable.setDither(true);
+
+ bottomView.setBackgroundDrawable(drawable);
+ }
+
+ private boolean isDown = false;
+ private boolean isSecondDown = false;
+ private float x1 = 0;
+ private float x2 = 0;
+ private float y1 = 0;
+ private float y2 = 0;
+
+ @Override
+ public boolean onTouch(View v, MotionEvent event) {
+
+ if (!isDown) {
+ x1 = event.getX();
+ y1 = event.getY();
+ isDown = true;
+ }
+ switch (event.getAction() & MotionEvent.ACTION_MASK) {
+ case MotionEvent.ACTION_DOWN:
+ savedMatrix.set(matrix);
+ start.set(event.getX(), event.getY());
+ mode = DRAG;
+ originalScale = getScale();
+ break;
+ case MotionEvent.ACTION_POINTER_UP:
+
+ break;
+ case MotionEvent.ACTION_UP:
+ if (Math.abs((x1 - x2)) < 25 && Math.abs((y1 - y2)) < 25) {
+
+ if (resolutionPopWindow != null
+ && resolutionPopWindow.isShowing()) {
+ resolutionPopWindow.dismiss();
+ }
+
+ if (mPopupWindowProgress != null
+ && mPopupWindowProgress.isShowing()) {
+ mPopupWindowProgress.dismiss();
+ }
+ if (!isSecondDown) {
+ if (!bProgress) {
+ showBottom();
+ }
+ }
+ isSecondDown = false;
+ }
+ x1 = 0;
+ x2 = 0;
+ y1 = 0;
+ y2 = 0;
+ isDown = false;
+ break;
+ case MotionEvent.ACTION_POINTER_DOWN:
+ isSecondDown = true;
+ break;
+ }
+ return gt.onTouchEvent(event);
+ }
+
+ private static final int NONE = 0;
+ private static final int DRAG = 1;
+ private static final int ZOOM = 2;
+
+ private int mode = NONE;
+ private float oldDist;
+ private Matrix matrix = new Matrix();
+ private Matrix savedMatrix = new Matrix();
+ private PointF start = new PointF();
+ private PointF mid = new PointF();
+ float mMaxZoom = 2.0f;
+ float mMinZoom = 0.3125f;
+ float originalScale;
+ float baseValue;
+ protected Matrix mBaseMatrix = new Matrix();
+ protected Matrix mSuppMatrix = new Matrix();
+ private Matrix mDisplayMatrix = new Matrix();
+ private final float[] mMatrixValues = new float[9];
+
+ protected void zoomTo(float scale, float centerX, float centerY) {
+ Log.d("zoomTo", "zoomTo scale:" + scale);
+ if (scale > mMaxZoom) {
+ scale = mMaxZoom;
+ } else if (scale < mMinZoom) {
+ scale = mMinZoom;
+ }
+
+ float oldScale = getScale();
+ float deltaScale = scale / oldScale;
+ Log.d("deltaScale", "deltaScale:" + deltaScale);
+ mSuppMatrix.postScale(deltaScale, deltaScale, centerX, centerY);
+ videoViewStandard.setScaleType(ImageView.ScaleType.MATRIX);
+ videoViewStandard.setImageMatrix(getImageViewMatrix());
+ }
+
+ protected Matrix getImageViewMatrix() {
+ mDisplayMatrix.set(mBaseMatrix);
+ mDisplayMatrix.postConcat(mSuppMatrix);
+ return mDisplayMatrix;
+ }
+
+ protected float getScale(Matrix matrix) {
+ return getValue(matrix, Matrix.MSCALE_X);
+ }
+
+ protected float getScale() {
+ return getScale(mSuppMatrix);
+ }
+
+ protected float getValue(Matrix matrix, int whichValue) {
+ matrix.getValues(mMatrixValues);
+ return mMatrixValues[whichValue];
+ }
+
+ /*private float (MotionEvent event) {
+ try {
+ float x = event.getX(0) - event.getX(1);
+ float y = event.getY(0) - event.getY(1);
+ return FloatMath.sqrt(x * x + y * y);
+ } catch (Exception e) {
+ }
+ return 0;
+ }*/
+
+ private void midPoint(PointF point, MotionEvent event) {
+ float x = event.getX(0) + event.getX(1);
+ float y = event.getY(0) + event.getY(1);
+ point.set(x / 2, y / 2);
+ }
+
+ @Override
+ public boolean onDown(MotionEvent e) {
+ Log.d("tag", "onDown");
+
+ return false;
+ }
+
+ private final int MINLEN = 80;//最小间距
+ private Animation showTopAnim;
+ private Animation dismissTopAnim;
+ private boolean isPTZPrompt;
+
+ @Override
+ public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
+ float velocityY) {
+ float x1 = e1.getX();
+ float x2 = e2.getX();
+ float y1 = e1.getY();
+ float y2 = e2.getY();
+
+ float xx = x1 > x2 ? x1 - x2 : x2 - x1;
+ float yy = y1 > y2 ? y1 - y2 : y2 - y1;
+
+ if (xx > yy) {
+ if ((x1 > x2) && (xx > MINLEN)) {// right
+ if (!isControlDevice)
+ new ControlDeviceTask(ContentCommon.CMD_PTZ_RIGHT).execute();
+
+ } else if ((x1 < x2) && (xx > MINLEN)) {// left
+ if (!isControlDevice)
+ new ControlDeviceTask(ContentCommon.CMD_PTZ_LEFT).execute();
+ }
+
+ } else {
+ if ((y1 > y2) && (yy > MINLEN)) {// down
+ if (!isControlDevice)
+ new ControlDeviceTask(ContentCommon.CMD_PTZ_DOWN).execute();
+ } else if ((y1 < y2) && (yy > MINLEN)) {// up
+ if (!isControlDevice)
+ new ControlDeviceTask(ContentCommon.CMD_PTZ_UP).execute();
+ }
+
+ }
+ return false;
+ }
+
+ @Override
+ public void onLongPress(MotionEvent e) {
+ }
+
+ @Override
+ public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,
+ float distanceY) {
+ return false;
+ }
+
+ @Override
+ public void onShowPress(MotionEvent e) {
+
+ }
+
+ @Override
+ public boolean onSingleTapUp(MotionEvent e) {
+ return false;
+ }
+
+
+ public void showSureDialogPlay() {
+ AlertDialog.Builder builder = new AlertDialog.Builder(this);
+ builder.setIcon(R.drawable.app);
+ builder.setTitle(getResources().getString(R.string.exit_show));
+ builder.setMessage(R.string.exit_play_show);
+ builder.setPositiveButton(R.string.str_ok,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int whichButton) {
+ PlayActivity.this.finish();
+ }
+ });
+ builder.setNegativeButton(R.string.str_cancel, null);
+ builder.show();
+ }
+
+ @Override
+ public void onClick(View v) {
+ switch (v.getId()) {
+ case R.id.ptz_talk://对讲
+ goMicroPhone();
+ break;
+ case R.id.ptz_take_videos://录像
+ goTakeVideo();
+ break;
+ case R.id.ptz_take_photos://拍照
+ dismissBrightAndContrastProgress();
+ if (existSdcard()) {// 判断sd卡是否存在
+ //takePicture(mBmp);
+ isTakepic = true;
+ } else {
+ showToast(R.string.ptz_takepic_save_fail);
+ }
+ break;
+ case R.id.ptz_audio:
+ goAudio();
+ break;
+ case R.id.ptz_brightness:
+ if (mPopupWindowProgress != null
+ && mPopupWindowProgress.isShowing()) {
+ mPopupWindowProgress.dismiss();
+ mPopupWindowProgress = null;
+ }
+ setBrightOrContrast(BRIGHT);
+ break;
+ case R.id.ptz_contrast:
+ if (mPopupWindowProgress != null
+ && mPopupWindowProgress.isShowing()) {
+ mPopupWindowProgress.dismiss();
+ mPopupWindowProgress = null;
+ }
+ setBrightOrContrast(CONTRAST);
+ break;
+ case R.id.ptz_resolution:
+ showResolutionPopWindow();
+ break;
+ case R.id.preset://预置位设置
+ presetBitWindow();
+ break;
+ case R.id.ptz_resolution_jpeg_qvga:
+ dismissBrightAndContrastProgress();
+ resolutionPopWindow.dismiss();
+ nResolution = 1;
+ setResolution(nResolution);
+ Log.d("tag", "jpeg resolution:" + nResolution + " qvga");
+ break;
+ case R.id.ptz_resolution_jpeg_vga:
+ dismissBrightAndContrastProgress();
+ resolutionPopWindow.dismiss();
+ nResolution = 0;
+ setResolution(nResolution);
+ Log.d("tag", "jpeg resolution:" + nResolution + " vga");
+ break;
+ case R.id.ptz_resolution_h264_qvga:
+ dismissBrightAndContrastProgress();
+ resolutionPopWindow.dismiss();
+ ismax = false;
+ ismiddle = false;
+ ishigh = false;
+ isp720 = false;
+ isqvga1 = true;
+ isvga1 = false;
+ addReslution(stqvga1, isqvga1);
+ nResolution = 5;
+ setResolution(nResolution);
+ break;
+ case R.id.ptz_resolution_h264_vga:
+ dismissBrightAndContrastProgress();
+ resolutionPopWindow.dismiss();
+ ismax = false;
+ ismiddle = false;
+ ishigh = false;
+ isp720 = false;
+ isqvga1 = false;
+ isvga1 = true;
+ addReslution(stvga1, isvga1);
+ nResolution = 4;
+ setResolution(nResolution);
+
+ break;
+ case R.id.ptz_resolution_h264_720p:
+ dismissBrightAndContrastProgress();
+ resolutionPopWindow.dismiss();
+ ismax = false;
+ ismiddle = false;
+ ishigh = false;
+ isp720 = true;
+ isqvga1 = false;
+ isvga1 = false;
+ addReslution(stp720, isp720);
+ nResolution = 3;
+ setResolution(nResolution);
+ break;
+ case R.id.ptz_resolution_h264_middle:
+ dismissBrightAndContrastProgress();
+ resolutionPopWindow.dismiss();
+ ismax = false;
+ ismiddle = true;
+ ishigh = false;
+ isp720 = false;
+ isqvga1 = false;
+ isvga1 = false;
+ addReslution(stmiddle, ismiddle);
+ nResolution = 2;
+ setResolution(nResolution);
+ break;
+ case R.id.ptz_resolution_h264_high:
+ dismissBrightAndContrastProgress();
+ resolutionPopWindow.dismiss();
+ ismax = false;
+ ismiddle = false;
+ ishigh = true;
+ isp720 = false;
+ isqvga1 = false;
+ isvga1 = false;
+ addReslution(sthigh, ishigh);
+ nResolution = 1;
+ setResolution(nResolution);
+ break;
+ case R.id.ptz_resolution_h264_max:
+ dismissBrightAndContrastProgress();
+ resolutionPopWindow.dismiss();
+ ismax = true;
+ ismiddle = false;
+ ishigh = false;
+ isp720 = false;
+ isqvga1 = false;
+ isvga1 = false;
+ addReslution(stmax, ismax);
+ nResolution = 0;
+ setResolution(nResolution);
+ break;
+
+ case R.id.ptz_default_set:
+ dismissBrightAndContrastProgress();
+ defaultVideoParams();
+ break;
+
+ case R.id.light:
+ if (isOpen) {
+ setLightState(strDID, SystemValue.devicePass, false);
+ lightBtn.setBackground(getResources().getDrawable(R.drawable.camera_light_btn_off));
+
+ } else {
+ setLightState(strDID, SystemValue.devicePass, true);
+ lightBtn.setBackground(getResources().getDrawable(R.drawable.camera_light_btn_on));
+ }
+ isOpen = !isOpen;
+ break;
+ case R.id.sire:
+ if (isOpenSire) {
+ setSireState(strDID, SystemValue.devicePass, false);
+ sireBtn.setBackground(getResources().getDrawable(R.drawable.camera_siren_btn_off));
+
+ } else {
+ setSireState(strDID, SystemValue.devicePass, true);
+ sireBtn.setBackground(getResources().getDrawable(R.drawable.camera_siren_btn_on));
+ }
+ isOpenSire = !isOpenSire;
+ break;
+ }
+ }
+
+ boolean isOpen = false;
+ boolean isOpenSire = false;
+
+ public static void setLightState(String did, String pwd, boolean isOpen) {
+ NativeCaller.TransferMessage(did, "trans_cmd_string.cgi?cmd=2109&command=0&light=" + (isOpen ? 1 : 0) + "&loginuse=admin&loginpas=" + pwd + "&user=admin&pwd=" + pwd, 1);
+ }
+
+ public static void setSireState(String did, String pwd, boolean isOpen) {
+ NativeCaller.TransferMessage(did, "trans_cmd_string.cgi?cmd=2109&command=0&siren=" + (isOpen ? 1 : 0) + "&loginuse=admin&loginpas=" + pwd + "&user=admin&pwd=" + pwd, 1);
+ }
+
+ private void dismissBrightAndContrastProgress() {
+ if (mPopupWindowProgress != null && mPopupWindowProgress.isShowing()) {
+ mPopupWindowProgress.dismiss();
+ mPopupWindowProgress = null;
+ }
+ }
+
+ private void showBottom() {
+ if (isUpDownPressed) {
+ isUpDownPressed = false;
+ bottomView.startAnimation(dismissAnim);
+ bottomView.setVisibility(View.GONE);
+ } else {
+ isUpDownPressed = true;
+ bottomView.startAnimation(showAnim);
+ bottomView.setVisibility(View.VISIBLE);
+ }
+ }
+
+ @Override
+ public void LightSireCallBack(String did, String command, String cmd, String siren, String light) {
+ if (!did.equals(strDID)) {
+ return;
+ }
+ if (light.equals("0")) {
+ isOpen = false;
+ deviceParamsHandler.sendEmptyMessage(11);
+
+ } else {
+ deviceParamsHandler.sendEmptyMessage(12);
+ isOpen = true;
+ }
+ if (siren.equals("0")) {
+ isOpenSire = false;
+ deviceParamsHandler.sendEmptyMessage(13);
+ } else {
+ isOpenSire = true;
+ deviceParamsHandler.sendEmptyMessage(14);
+ }
+ }
+
+
+ /*
+ *异步控制方向
+ */
+ private class ControlDeviceTask extends AsyncTask {
+ private int type;
+
+ public ControlDeviceTask(int type) {
+ this.type = type;
+ }
+
+ @Override
+ protected void onPreExecute() {
+ // TODO Auto-generated method stub
+ super.onPreExecute();
+ if (type == ContentCommon.CMD_PTZ_RIGHT) {
+ control_item.setText(R.string.right);
+ } else if (type == ContentCommon.CMD_PTZ_LEFT) {
+ control_item.setText(R.string.left);
+ } else if (type == ContentCommon.CMD_PTZ_UP) {
+ control_item.setText(R.string.up);
+ } else if (type == ContentCommon.CMD_PTZ_DOWN) {
+ control_item.setText(R.string.down);
+ }
+ if (controlWindow != null && controlWindow.isShowing())
+ controlWindow.dismiss();
+
+ if (controlWindow != null && !controlWindow.isShowing())
+ controlWindow.showAtLocation(playSurface, Gravity.CENTER, 0, 0);
+ }
+
+ @Override
+ protected Integer doInBackground(Void... arg0) {
+ // TODO Auto-generated method stub
+ isControlDevice = true;
+ if (type == ContentCommon.CMD_PTZ_RIGHT) {
+ NativeCaller.PPPPPTZControl(strDID, ContentCommon.CMD_PTZ_RIGHT);
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ NativeCaller.PPPPPTZControl(strDID, ContentCommon.CMD_PTZ_RIGHT_STOP);
+ } else if (type == ContentCommon.CMD_PTZ_LEFT) {
+ NativeCaller.PPPPPTZControl(strDID, ContentCommon.CMD_PTZ_LEFT);
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ NativeCaller.PPPPPTZControl(strDID, ContentCommon.CMD_PTZ_LEFT_STOP);
+ } else if (type == ContentCommon.CMD_PTZ_UP) {
+ NativeCaller.PPPPPTZControl(strDID, ContentCommon.CMD_PTZ_UP);
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ NativeCaller.PPPPPTZControl(strDID, ContentCommon.CMD_PTZ_UP_STOP);
+ } else if (type == ContentCommon.CMD_PTZ_DOWN) {
+ NativeCaller.PPPPPTZControl(strDID, ContentCommon.CMD_PTZ_DOWN);
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ NativeCaller.PPPPPTZControl(strDID, ContentCommon.CMD_PTZ_DOWN_STOP);
+ }
+ return 0;
+ }
+
+ @Override
+ protected void onPostExecute(Integer result) {
+ // TODO Auto-generated method stub
+ super.onPostExecute(result);
+ isControlDevice = false;
+ if (controlWindow != null && controlWindow.isShowing())
+ controlWindow.dismiss();
+ //mine
+ stopBackgroundThread();
+ reInitPosition();
+ makeInitAlarm(3);
+ showToast(R.string.initing);
+ }
+
+ }
+
+ private void reInitPosition() {
+ initPosition = true;
+ fail2Init = false;
+ timeHandler.removeMessages(INIT_MSG);
+ timeHandler.removeMessages(FATIGUE_MSG);
+ timeHandler.removeMessages(NOD_MSG);
+ if (timer4Init != null) {
+ timer4Init.cancel();
+ timer4Init = null;
+ }
+ if (timer4Fatigue != null) {
+ timer4Fatigue.cancel();
+ timer4Fatigue = null;
+ }
+ if (timer4Nod != null) {
+ timer4Nod.cancel();
+ timer4Nod = null;
+ }
+ initParams();
+ handleTimeMsg();
+ }
+
+ /*
+ * 上下左右提示框
+ */
+ private void initControlDailog() {
+ LayoutInflater inflater = LayoutInflater.from(this);
+ View view = inflater.inflate(R.layout.control_device_view, null);
+ control_item = (TextView) view.findViewById(R.id.textView1_play);
+ controlWindow = new PopupWindow(view, LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
+ controlWindow.setBackgroundDrawable(new ColorDrawable(0));
+ controlWindow.setOnDismissListener(new OnDismissListener() {
+
+ @Override
+ public void onDismiss() {
+ // TODO Auto-generated method stub
+ controlWindow.dismiss();
+ }
+ });
+ controlWindow.setTouchInterceptor(new OnTouchListener() {
+ @Override
+ public boolean onTouch(View arg0, MotionEvent arg1) {
+ if (arg1.getAction() == MotionEvent.ACTION_OUTSIDE) {
+ controlWindow.dismiss();
+ }
+ return false;
+ }
+ });
+ }
+
+ /*
+ * 16个预置位设置面板
+ */
+ private void presetBitWindow() {
+ LayoutInflater inflater = LayoutInflater.from(this);
+ View view = inflater.inflate(R.layout.preset_view, null);
+ initViewPager(view);
+ presetBitWindow = new PopupWindow(view, LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
+ presetBitWindow.setAnimationStyle(R.style.AnimationPreview);
+ presetBitWindow.setFocusable(true);
+ presetBitWindow.setOutsideTouchable(true);
+ presetBitWindow.setBackgroundDrawable(new ColorDrawable(0));
+ presetBitWindow.showAtLocation(playSurface, Gravity.CENTER, 0, 0);
+
+ }
+
+ private void initViewPager(View view) {
+ final TextView left = (TextView) view.findViewById(R.id.text_pre_left);
+ final TextView rigth = (TextView) view.findViewById(R.id.text_pre_right);
+ left.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View arg0) {
+ left.setTextColor(Color.BLUE);
+ rigth.setTextColor(0xffffffff);
+ prePager.setCurrentItem(0);
+ }
+ });
+ rigth.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View arg0) {
+ rigth.setTextColor(Color.BLUE);
+ left.setTextColor(0xffffffff);
+ prePager.setCurrentItem(1);
+ }
+ });
+
+ prePager = (ViewPager) view.findViewById(R.id.vPager);
+ listViews = new ArrayList();
+ LayoutInflater mInflater = getLayoutInflater();
+ View view1 = mInflater.inflate(R.layout.popuppreset, null);
+ View view2 = mInflater.inflate(R.layout.popuppreset, null);
+ btnLeft[0] = (Button) view1.findViewById(R.id.pre1);
+ btnRigth[0] = (Button) view2.findViewById(R.id.pre1);
+ btnLeft[1] = (Button) view1.findViewById(R.id.pre2);
+ btnRigth[1] = (Button) view2.findViewById(R.id.pre2);
+ btnLeft[2] = (Button) view1.findViewById(R.id.pre3);
+ btnRigth[2] = (Button) view2.findViewById(R.id.pre3);
+ btnLeft[3] = (Button) view1.findViewById(R.id.pre4);
+ btnRigth[3] = (Button) view2.findViewById(R.id.pre4);
+ btnLeft[4] = (Button) view1.findViewById(R.id.pre5);
+ btnRigth[4] = (Button) view2.findViewById(R.id.pre5);
+ btnLeft[5] = (Button) view1.findViewById(R.id.pre6);
+ btnRigth[5] = (Button) view2.findViewById(R.id.pre6);
+ btnLeft[6] = (Button) view1.findViewById(R.id.pre7);
+ btnRigth[6] = (Button) view2.findViewById(R.id.pre7);
+ btnLeft[7] = (Button) view1.findViewById(R.id.pre8);
+ btnRigth[7] = (Button) view2.findViewById(R.id.pre8);
+ btnLeft[8] = (Button) view1.findViewById(R.id.pre9);
+ btnRigth[8] = (Button) view2.findViewById(R.id.pre9);
+ btnLeft[9] = (Button) view1.findViewById(R.id.pre10);
+ btnRigth[9] = (Button) view2.findViewById(R.id.pre10);
+ btnLeft[10] = (Button) view1.findViewById(R.id.pre11);
+ btnRigth[10] = (Button) view2.findViewById(R.id.pre11);
+ btnLeft[11] = (Button) view1.findViewById(R.id.pre12);
+ btnRigth[11] = (Button) view2.findViewById(R.id.pre12);
+ btnLeft[12] = (Button) view1.findViewById(R.id.pre13);
+ btnRigth[12] = (Button) view2.findViewById(R.id.pre13);
+ btnLeft[13] = (Button) view1.findViewById(R.id.pre14);
+ btnRigth[13] = (Button) view2.findViewById(R.id.pre14);
+ btnLeft[14] = (Button) view1.findViewById(R.id.pre15);
+ btnRigth[14] = (Button) view2.findViewById(R.id.pre15);
+ btnLeft[15] = (Button) view1.findViewById(R.id.pre16);
+ btnRigth[15] = (Button) view2.findViewById(R.id.pre16);
+ listViews.add(view1);
+ listViews.add(view2);
+ prePager.setAdapter(new ViewPagerAdapter(listViews));
+ prePager.setCurrentItem(0);
+ prePager.setOnPageChangeListener(new OnPageChangeListener() {
+ @Override
+ public void onPageSelected(int arg0) {
+ if (arg0 == 0) {
+ left.setTextColor(Color.BLUE);
+ rigth.setTextColor(0xffffffff);
+ } else {
+ rigth.setTextColor(Color.BLUE);
+ left.setTextColor(0xffffffff);
+ }
+ }
+
+ @Override
+ public void onPageScrolled(int arg0, float arg1, int arg2) {
+ }
+
+ @Override
+ public void onPageScrollStateChanged(int arg0) {
+ }
+ });
+ PresetListener listener = new PresetListener();
+ for (int i = 0; i < 16; i++) {
+ btnLeft[i].setOnClickListener(listener);
+ btnRigth[i].setOnClickListener(listener);
+ }
+ }
+
+ //预位置设置监听
+ private class PresetListener implements OnClickListener {
+ @Override
+ public void onClick(View arg0) {
+ int id = arg0.getId();
+ presetBitWindow.dismiss();
+ int currIndex = prePager.getCurrentItem();
+ switch (id) {
+ case R.id.pre1:
+ if (currIndex == 0) {
+ NativeCaller.PPPPPTZControl(strDID, 31);
+ } else {
+ NativeCaller.PPPPPTZControl(strDID, 30);
+ }
+ break;
+
+ case R.id.pre2:
+ if (currIndex == 0) {
+ NativeCaller.PPPPPTZControl(strDID, 33);
+ } else {
+ NativeCaller.PPPPPTZControl(strDID, 32);
+ }
+ break;
+
+ case R.id.pre3:
+ if (currIndex == 0) {
+ NativeCaller.PPPPPTZControl(strDID, 35);
+ } else {
+ NativeCaller.PPPPPTZControl(strDID, 34);
+ }
+
+ case R.id.pre4:
+ if (currIndex == 0) {
+ NativeCaller.PPPPPTZControl(strDID, 37);
+ } else {
+ NativeCaller.PPPPPTZControl(strDID, 36);
+ }
+ break;
+
+ case R.id.pre5:
+ if (currIndex == 0) {
+ NativeCaller.PPPPPTZControl(strDID, 39);
+ } else {
+ NativeCaller.PPPPPTZControl(strDID, 38);
+ }
+ break;
+
+ case R.id.pre6:
+ if (currIndex == 0) {
+ NativeCaller.PPPPPTZControl(strDID, 41);
+ } else {
+ NativeCaller.PPPPPTZControl(strDID, 40);
+ }
+ break;
+
+ case R.id.pre7:
+ if (currIndex == 0) {
+ NativeCaller.PPPPPTZControl(strDID, 43);
+ } else {
+ NativeCaller.PPPPPTZControl(strDID, 42);
+ }
+ break;
+
+ case R.id.pre8:
+ if (currIndex == 0) {
+ NativeCaller.PPPPPTZControl(strDID, 45);
+ } else {
+ NativeCaller.PPPPPTZControl(strDID, 44);
+ }
+ break;
+
+ case R.id.pre9:
+ if (currIndex == 0) {
+ NativeCaller.PPPPPTZControl(strDID, 47);
+ } else {
+ NativeCaller.PPPPPTZControl(strDID, 46);
+ }
+ break;
+
+ case R.id.pre10:
+ if (currIndex == 0) {
+ NativeCaller.PPPPPTZControl(strDID, 49);
+ } else {
+ NativeCaller.PPPPPTZControl(strDID, 48);
+ }
+ break;
+
+ case R.id.pre11:
+ if (currIndex == 0) {
+ NativeCaller.PPPPPTZControl(strDID, 51);
+ } else {
+ NativeCaller.PPPPPTZControl(strDID, 50);
+ }
+ break;
+
+ case R.id.pre12:
+ if (currIndex == 0) {
+ NativeCaller.PPPPPTZControl(strDID, 53);
+ } else {
+ NativeCaller.PPPPPTZControl(strDID, 52);
+ }
+ break;
+
+ case R.id.pre13:
+ if (currIndex == 0) {
+ NativeCaller.PPPPPTZControl(strDID, 55);
+ } else {
+ NativeCaller.PPPPPTZControl(strDID, 54);
+ }
+ break;
+
+ case R.id.pre14:
+ if (currIndex == 0) {
+ NativeCaller.PPPPPTZControl(strDID, 57);
+ } else {
+ NativeCaller.PPPPPTZControl(strDID, 56);
+ }
+ break;
+
+ case R.id.pre15:
+ if (currIndex == 0) {
+ NativeCaller.PPPPPTZControl(strDID, 59);
+ } else {
+ NativeCaller.PPPPPTZControl(strDID, 58);
+ }
+ break;
+
+ case R.id.pre16:
+ if (currIndex == 0) {
+ NativeCaller.PPPPPTZControl(strDID, 61);
+ } else {
+ NativeCaller.PPPPPTZControl(strDID, 60);
+ }
+ break;
+ }
+ }
+ }
+
+ //判断sd卡是否存在
+ private boolean existSdcard() {
+ if (Environment.getExternalStorageState().equals(
+ Environment.MEDIA_MOUNTED)) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ // 拍照
+ private void takePicture(final Bitmap bmp) {
+ if (!isPictSave) {
+ isPictSave = true;
+ new Thread() {
+ public void run() {
+
+ savePicToSDcard(bmp);
+ }
+ }.start();
+ } else {
+ return;
+ }
+ }
+
+ /*
+ * 保存到本地
+ * 注意:此处可以做本地数据库sqlit 保存照片,以便于到本地照片观看界面从SQLite取出照片
+ */
+ private synchronized void savePicToSDcard(final Bitmap bmp) {
+ String strDate = getStrDate();
+ //String date = strDate.substring(0, 10);
+ FileOutputStream fos = null;
+ try {
+ File div = new File(Environment.getExternalStorageDirectory(),
+ "ipcameradetect/takepic");
+ if (!div.exists()) {
+ div.mkdirs();
+ }
+ ++picNum;
+ File file = new File(div, strDate + "_" + strDID + "_" + picNum+ ".jpg");
+ fos = new FileOutputStream(file);
+ if (bmp.compress(Bitmap.CompressFormat.JPEG, 100, fos)) {
+ fos.flush();
+ Log.d("tag", "takepicture success");
+ runOnUiThread(new Runnable() {
+
+ @Override
+ public void run() {
+ showToast(R.string.ptz_takepic_ok);
+ }
+ });
+ }
+ } catch (Exception e) {
+ runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ showToast(R.string.ptz_takepic_fail);
+ }
+ });
+ Log.d("tag", "exception:" + e.getMessage());
+ e.printStackTrace();
+ } finally {
+ isPictSave = false;
+ if (fos != null) {
+ try {
+ fos.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ fos = null;
+ }
+ }
+ }
+
+ //时间格式
+ private String getStrDate() {
+ Date d = new Date();
+ SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd_HH_mm");
+ String strDate = f.format(d);
+ return strDate;
+ }
+
+ /*
+ * 录像
+ */
+ private void goTakeVideo() {
+ dismissBrightAndContrastProgress();
+ if (isTakeVideo) {
+ showToast(R.string.ptz_takevideo_end);
+ Log.d("tag", "停止录像 stop");
+
+ String strRecord = "";
+ NativeCaller.RecordLocal(strDID, strRecord, 0);
+ isTakeVideo = false;
+ ptzTake_vodeo.setImageResource(R.drawable.ptz_takevideo);
+ } else {
+ isTakeVideo = true;
+ showToast(R.string.ptz_takevideo_begin);
+ Log.d("tag", "开始录像 start");
+ videotime = (new Date()).getTime();
+ ptzTake_vodeo.setImageResource(R.drawable.ptz_takevideo_pressed);
+ File div = new File(Environment.getExternalStorageDirectory(),
+ "ipcameradetect/takepic");
+ if (!div.exists()) {
+ div.mkdirs();
+ }
+ File file = new File(div, strDID + "_" + getStrDate() + ".mp4");
+ NativeCaller.RecordLocal(strDID, file.getAbsolutePath(), 1);
+ NativeCaller.TransferMessage(strDID, "camera_control.cgi?param=26&value=" + 1 + "&loginuse=admin&loginpas=" + SystemValue.devicePass + "&user=admin&pwd=" + SystemValue.devicePass, 1);
+ //strRecord 录像文件路径,可以根据实际需求自行定义
+ }
+ }
+
+
+ private void stopTakevideo() {
+ if (isTakeVideo) {
+ showToast(R.string.ptz_takevideo_end);
+ Log.d("tag", "停止录像");
+ isTakeVideo = false;
+ // cameratakevideo.stopRecordVideo(strDID);
+ }
+ }
+
+ //讲话
+ private void StartTalk() {
+ if (customAudioRecorder != null) {
+ Log.i("info", "startTalk");
+ customAudioRecorder.StartRecord();
+ NativeCaller.PPPPStartTalk(strDID);
+ }
+ }
+
+ //停止讲话
+ private void StopTalk() {
+ if (customAudioRecorder != null) {
+ Log.i("info", "stopTalk");
+ customAudioRecorder.StopRecord();
+ NativeCaller.PPPPStopTalk(strDID);
+ }
+ }
+
+ //监听
+ private void StartAudio() {
+ synchronized (this) {
+ AudioBuffer.ClearAll();
+ audioPlayer.AudioPlayStart();
+ NativeCaller.PPPPStartAudio(strDID);
+ }
+ }
+
+ //停止监听
+ private void StopAudio() {
+ synchronized (this) {
+ audioPlayer.AudioPlayStop();
+ AudioBuffer.ClearAll();
+ NativeCaller.PPPPStopAudio(strDID);
+ }
+ }
+
+ /*
+ * 监听
+ */
+ private void goAudio() {
+ dismissBrightAndContrastProgress();
+ if (!isMcriophone) {
+ if (bAudioStart) {
+ Log.d("info", "没有声音");
+ isTalking = false;
+ bAudioStart = false;
+ ptzAudio.setImageResource(R.drawable.ptz_audio_off);
+ StopAudio();
+ } else {
+ Log.d("info", "有声");
+ isTalking = true;
+ bAudioStart = true;
+ ptzAudio.setImageResource(R.drawable.ptz_audio_on);
+ StartAudio();
+ }
+
+ } else {
+ isMcriophone = false;
+ bAudioRecordStart = false;
+ ptztalk.setImageResource(R.drawable.ptz_microphone_off);
+ StopTalk();
+ isTalking = true;
+ bAudioStart = true;
+ ptzAudio.setImageResource(R.drawable.ptz_audio_on);
+ StartAudio();
+ }
+
+ }
+
+ /*
+ * 对讲
+ */
+ private void goMicroPhone() {
+ dismissBrightAndContrastProgress();
+ if (!isTalking) {
+ if (bAudioRecordStart) {
+ Log.d("tag", "停止说话");
+ isMcriophone = false;
+ bAudioRecordStart = false;
+ ptztalk.setImageResource(R.drawable.ptz_microphone_off);
+ StopTalk();
+ } else {
+ Log.d("info", "开始说话");
+ isMcriophone = true;
+ bAudioRecordStart = true;
+ ptztalk.setImageResource(R.drawable.ptz_microphone_on);
+ StartTalk();
+ }
+ } else {
+ isTalking = false;
+ bAudioStart = false;
+ ptzAudio.setImageResource(R.drawable.ptz_audio_off);
+ StopAudio();
+ isMcriophone = true;
+ bAudioRecordStart = true;
+ ptztalk.setImageResource(R.drawable.ptz_microphone_on);
+ StartTalk();
+ }
+
+ }
+
+ /*
+ * 分辨率设置
+ */
+ private void showResolutionPopWindow() {
+
+ if (resolutionPopWindow != null && resolutionPopWindow.isShowing()) {
+ return;
+ }
+ if (nStreamCodecType == ContentCommon.PPPP_STREAM_TYPE_JPEG) {
+ // jpeg
+ LinearLayout layout = (LinearLayout) LayoutInflater.from(this)
+ .inflate(R.layout.ptz_resolution_jpeg, null);
+ TextView qvga = (TextView) layout
+ .findViewById(R.id.ptz_resolution_jpeg_qvga);
+ TextView vga = (TextView) layout
+ .findViewById(R.id.ptz_resolution_jpeg_vga);
+ if (reslutionlist.size() != 0) {
+ getReslution();
+ }
+ if (isvga) {
+ vga.setTextColor(Color.RED);
+ }
+ if (isqvga) {
+ qvga.setTextColor(Color.RED);
+ }
+ qvga.setOnClickListener(this);
+ vga.setOnClickListener(this);
+ resolutionPopWindow = new PopupWindow(layout, 100,
+ WindowManager.LayoutParams.WRAP_CONTENT);
+ int x_begin = getWindowManager().getDefaultDisplay().getWidth() / 6;
+ int y_begin = ptzResolutoin.getTop();
+ resolutionPopWindow.showAtLocation(findViewById(R.id.play),
+ Gravity.BOTTOM | Gravity.RIGHT, x_begin, y_begin);
+
+ } else {
+ // h264
+ LinearLayout layout = (LinearLayout) LayoutInflater.from(this)
+ .inflate(R.layout.ptz_resolution_h264, null);
+ TextView qvga1 = (TextView) layout
+ .findViewById(R.id.ptz_resolution_h264_qvga);
+ TextView vga1 = (TextView) layout
+ .findViewById(R.id.ptz_resolution_h264_vga);
+ TextView p720 = (TextView) layout
+ .findViewById(R.id.ptz_resolution_h264_720p);
+ TextView middle = (TextView) layout
+ .findViewById(R.id.ptz_resolution_h264_middle);
+ TextView high = (TextView) layout
+ .findViewById(R.id.ptz_resolution_h264_high);
+ TextView max = (TextView) layout
+ .findViewById(R.id.ptz_resolution_h264_max);
+
+ if (reslutionlist.size() != 0) {
+ getReslution();
+ }
+ if (ismax) {
+ max.setTextColor(Color.RED);
+ }
+ if (ishigh) {
+ high.setTextColor(Color.RED);
+ }
+ if (ismiddle) {
+ middle.setTextColor(Color.RED);
+ }
+ if (isqvga1) {
+ qvga1.setTextColor(Color.RED);
+ }
+ if (isvga1) {
+ vga1.setTextColor(Color.RED);
+ }
+ if (isp720) {
+ p720.setTextColor(Color.RED);
+ }
+ high.setOnClickListener(this);
+ middle.setOnClickListener(this);
+ max.setOnClickListener(this);
+ qvga1.setOnClickListener(this);
+ vga1.setOnClickListener(this);
+ p720.setOnClickListener(this);
+ resolutionPopWindow = new PopupWindow(layout, 100,
+ WindowManager.LayoutParams.WRAP_CONTENT);
+ Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE))
+ .getDefaultDisplay();
+ int oreation = display.getOrientation();
+ int x_begin = getWindowManager().getDefaultDisplay().getWidth() / 6;
+ int y_begin = ptzResolutoin.getTop();
+ resolutionPopWindow.showAtLocation(findViewById(R.id.play),
+ Gravity.BOTTOM | Gravity.RIGHT, x_begin, y_begin + 60);
+
+ }
+
+ }
+
+ /**
+ * 获取reslution
+ */
+ public static Map> reslutionlist = new HashMap>();
+
+ /**
+ * 增加reslution
+ */
+ private void addReslution(String mess, boolean isfast) {
+ if (reslutionlist.size() != 0) {
+ if (reslutionlist.containsKey(strDID)) {
+ reslutionlist.remove(strDID);
+ }
+ }
+ Map map = new HashMap();
+ map.put(mess, isfast);
+ reslutionlist.put(strDID, map);
+ }
+
+ private void getReslution() {
+ if (reslutionlist.containsKey(strDID)) {
+ Map map = reslutionlist.get(strDID);
+ if (map.containsKey("qvga")) {
+ isqvga = true;
+ } else if (map.containsKey("vga")) {
+ isvga = true;
+ } else if (map.containsKey("qvga1")) {
+ isqvga1 = true;
+ } else if (map.containsKey("vga1")) {
+ isvga1 = true;
+ } else if (map.containsKey("p720")) {
+ isp720 = true;
+ } else if (map.containsKey("high")) {
+ ishigh = true;
+ } else if (map.containsKey("middle")) {
+ ismiddle = true;
+ } else if (map.containsKey("max")) {
+ ismax = true;
+ }
+ }
+ }
+
+ /*
+ * @param type
+ * 亮度饱和对比度
+ */
+ private void setBrightOrContrast(final int type) {
+
+ if (!bInitCameraParam) {
+ return;
+ }
+ int width = getWindowManager().getDefaultDisplay().getWidth();
+ LinearLayout layout = (LinearLayout) LayoutInflater.from(this).inflate(
+ R.layout.brightprogress, null);
+ SeekBar seekBar = (SeekBar) layout.findViewById(R.id.brightseekBar1);
+ seekBar.setMax(255);
+ switch (type) {
+ case BRIGHT:
+ seekBar.setProgress(nBrightness);
+ break;
+ case CONTRAST:
+ seekBar.setProgress(nContrast);
+ break;
+ default:
+ break;
+ }
+ seekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
+
+ @Override
+ public void onStopTrackingTouch(SeekBar seekBar) {
+ int progress = seekBar.getProgress();
+ switch (type) {
+ case BRIGHT:// 亮度
+ nBrightness = progress;
+ NativeCaller.PPPPCameraControl(strDID, BRIGHT, nBrightness);
+ break;
+ case CONTRAST:// 对比度
+ nContrast = progress;
+ NativeCaller.PPPPCameraControl(strDID, CONTRAST, nContrast);
+ break;
+ default:
+ break;
+ }
+ }
+
+ @Override
+ public void onStartTrackingTouch(SeekBar arg0) {
+
+ }
+
+ @Override
+ public void onProgressChanged(SeekBar arg0, int progress,
+ boolean arg2) {
+
+ }
+ });
+ mPopupWindowProgress = new PopupWindow(layout, width / 2, 180);
+ mPopupWindowProgress.showAtLocation(findViewById(R.id.play),
+ Gravity.TOP, 0, 0);
+
+ }
+
+ @Override
+ protected synchronized void onDestroy() {
+ NativeCaller.StopPPPPLivestream(strDID);
+ StopAudio();
+ StopTalk();
+ stopTakevideo();
+ //mine
+ releaseAll();
+ classifier.close();
+ super.onDestroy();
+ }
+
+ public void releaseAll() {
+ timeHandler.removeMessages(INIT_MSG);
+ timeHandler.removeMessages(FATIGUE_MSG);
+ timeHandler.removeMessages(NOD_MSG);
+ if (alarmPlayer != null)
+ alarmPlayer.release();
+ if (timer4Init != null) {
+ timer4Init.cancel();
+ timer4Init = null;
+ }
+ if (timer4Fatigue != null) {
+ timer4Fatigue.cancel();
+ timer4Fatigue = null;
+ }
+ if (timer4Nod != null) {
+ timer4Nod.cancel();
+ timer4Nod = null;
+ }
+ if (timeHandler != null) {
+ timeHandler = null;
+ }
+ KitCore.release();
+ }
+
+ /***
+ * BridgeService callback 视频参数回调
+ *
+ * **/
+ @Override
+ public void callBackCameraParamNotify(String did, int resolution,
+ int brightness, int contrast, int hue, int saturation, int flip, int mode) {
+ //Log.e("设备返回的参数", resolution+","+brightness+","+contrast+","+hue+","+saturation+","+flip+","+mode);
+ nBrightness = brightness;
+ nContrast = contrast;
+ nResolution = resolution;
+ bInitCameraParam = true;
+ deviceParamsHandler.sendEmptyMessage(flip);
+ }
+
+ /**
+ * 视频流回调,并开启人脸检测
+ *
+ * @param videobuf
+ * @param h264Data
+ * @param len
+ * @param width
+ * @param height
+ */
+ @Override
+ public void callBackVideoData(final byte[] videobuf, int h264Data, int len, int width, int height) {
+ if (!bDisplayFinished)
+ return;
+ //mine
+ previewWidth = width;
+ previewHeight = height;
+ try {
+ if (mNV21Bytes == null) {
+ Init();
+ }
+ } catch (final Exception e) {
+ Log.e(LOG_TAG, "callBackVideoData: " + e);
+ return;
+ }
+ imageConverter = new Runnable() {
+ @Override
+ public void run() {
+ mNV21Bytes = videobuf;
+ }
+ };
+ processImage();
+ //mine
+ bDisplayFinished = false;
+ videodata = videobuf;
+ videoDataLen = len;
+ Message msg = new Message();
+ if (h264Data == 1) { // H264
+ nVideoWidths = width;
+ nVideoHeights = height;
+ if (isTakepic) {
+ isTakepic = false;
+ byte[] rgb = new byte[width * height * 2];
+ NativeCaller.YUV4202RGB565(videobuf, rgb, width, height);
+ ByteBuffer buffer = ByteBuffer.wrap(rgb);
+ mBmp = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);
+ mBmp.copyPixelsFromBuffer(buffer);
+ takePicture(mBmp);
+ }
+ isH264 = true;
+ msg.what = 1;
+ } else { // MJPEG
+ isJpeg = true;
+ msg.what = 2;
+ }
+ mHandler.sendMessage(msg);
+ //录像数据
+ if (isTakeVideo) {
+ Date date = new Date();
+ long times = date.getTime();
+ int tspan = (int) (times - videotime);
+ Log.d("tag", "play tspan:" + tspan);
+ videotime = times;
+ if (videoRecorder != null) {
+ if (isJpeg) {
+ videoRecorder.VideoRecordData(2, videobuf, width, height, tspan);
+ }
+ }
+ }
+ }
+
+ //mine
+ //得到最新的视频流bytes
+ protected void getCameraBytes() {
+ if (imageConverter != null) {
+ imageConverter.run();
+ }
+ }
+
+ //设置输出检测的屏幕大小
+ public void setScreenSize(int previewWidth, int previewHeight) {
+ final double width = getResources().getDisplayMetrics().widthPixels;
+ final double height = getResources().getDisplayMetrics().heightPixels;
+
+ if (width < height * previewWidth / previewHeight) {
+ ScreenWidth = width;
+ ScreenHeight = width * previewHeight / previewWidth;
+
+ } else {
+ ScreenWidth = height * previewWidth / previewHeight;
+ ScreenHeight = height;
+ }
+ }
+
+ //初始化人脸检测功能
+ public void Init() {
+ setScreenSize(previewWidth, previewHeight);
+ mNV21Bytes = new byte[previewHeight * previewWidth];
+ KitCore.init(
+ PlayActivity.this,
+ AndroidConfig
+ .create()
+ .setNormalMode()
+ .setDefaultFunc().openFunc(AndroidConfig.Func.FaceMesh).openFunc(AndroidConfig.Func.Iris)
+ .setDefaultInputImageFormat()
+ .setInputImageSize(previewWidth, previewHeight)
+ .setOutputImageSize((int) ScreenWidth, (int) ScreenHeight)
+ );
+ }
+
+ /**
+ * 获取人脸特征数据并获取疲劳检测的有关数值
+ */
+ protected void processImage() {
+ if (mNV21Bytes == null)
+ return;
+ //获得回调函数
+ getCameraBytes();
+ //设置镜头的旋转角,手机上设置比较复杂,需要考虑翻转,这里只需要普通设置就行
+ KitCore.Camera.setRotation(0, false, (int) PlayActivity.ScreenWidth, (int) PlayActivity.ScreenHeight);
+ //检测人脸
+ Face.FaceDetect faceDetect = Face.detect(mNV21Bytes);
+ //人脸检测信息
+ List faceDetectInfos = new ArrayList<>();
+ //人脸2d关键点信息
+ List faceLandmarkInfos = new ArrayList<>();
+ //人脸3d关键点信息
+ List faceLandmark3dInfos = new ArrayList<>();
+ //人脸瞳孔信息
+ List faceIrisInfo = new ArrayList<>();
+ if (faceDetect.getFaceCount() > 0) {//当检测到人脸时
+ notDetectFrame = 0;
+ faceDetectInfos = faceDetect.getDetectInfos();
+ faceLandmark3dInfos = faceDetect.landmark3d();
+ faceIrisInfo = faceDetect.iris3d();
+ faceLandmarkInfos = faceDetect.landmark2d();
+ FaceLandmarkInfo faceAttr = faceLandmarkInfos.get(0);
+ if (initPosition) {
+ initHeadPosition(faceAttr);
+ initParams();
+ } else {
+ //1分种内的帧数
+ totalFrameNumber = totalFrameNumber + 1;
+ judgeEyesClose(faceAttr);
+ judgeYawn(faceAttr);
+ judgeNod(faceAttr);
+ judgeNotice(faceIrisInfo.get(0), faceAttr);
+ }
+ } else {
+ if (notDetectFrame >= 50) {
+ notDetectFrame = 0;
+ if (initPosition) {//当处于初始姿态情况下
+ fail2Init = true;
+ }
+ makenotDetectFrameAlarm();
+ } else {
+ notDetectFrame = notDetectFrame + 1;
+ }
+ }
+ //绘制人脸矩形框图
+ if (faceDetectInfos != null && faceDetectInfos.size() > 0) {
+ Rect rect = new Rect();
+ //返回人脸识别的人脸框
+ rect = faceDetectInfos.get(0).asRect();
+ //重新设置参数
+ mFaceRect.setParams(rect, playSurface.getTop(), textosd.getMeasuredHeight());
+ //在主线程里更新视图
+ mFaceRect.invalidate();
+ }
+ }
+
+ private void initParams() {
+ totalFrameNumber = 0;
+ twiceTimes = 2;
+ fatigueDegree = 0;
+ perclosDegree = 0;
+ avgBlinkTime = 0;
+ eyesCloseNumber = 0;
+ blinkNumber = 0;
+ isEyesClose = false;
+ yawnNumber = 0;
+ isSmallYawn = false;
+ isBigYawn = false;
+ yawnFrame1 = 0;
+ yawnFrame2 = 0;
+ maxYawnFrame1 = 0;
+ maxYawnFrame2 = 0;
+ headNodFrame = 0;
+ headNormalFrame = 0;
+ loseNoticeFrame = 0;
+ }
+
+ /**
+ * 初始化头部姿态
+ *
+ * @param faceAttr
+ */
+ private void initHeadPosition(FaceLandmarkInfo faceAttr) {
+ totalPitch = totalPitch + faceAttr.pitch;
+ totalRoll = totalRoll + faceAttr.roll;
+ totalYaw = totalYaw + faceAttr.yaw;
+ initFrame = initFrame + 1;
+ }
+
+ /**
+ * 获取闭眼的帧数和眨眼的次数
+ *
+ * @param faceAttr
+ */
+ private void judgeEyesClose(FaceLandmarkInfo faceAttr) {
+ if (initPosition) return;
+ if (faceAttr.leftEyeClose >= eyesCloseThreshold
+ && faceAttr.rightEyeClose >= eyesCloseThreshold) {
+ eyesCloseNumber = eyesCloseNumber + 1;
+ isEyesClose = true;
+ } else if (isEyesClose) {
+ isEyesClose = false;
+ blinkNumber = blinkNumber + 1;
+ }
+ }
+
+ /**
+ * 获取一分钟打哈欠的个数
+ *
+ * @param faceAttr
+ */
+ private void judgeYawn(FaceLandmarkInfo faceAttr) {
+ if (initPosition) return;
+ if (faceAttr.mouseOpenBig >= yawnThreshold1) {//如果张嘴程度大于阈值1
+ if (isBigYawn) {//上一帧是处于张嘴程度大于阈值1的情况
+ //yawnFrame1、2分别是大于目前记录的连续大于阙值1和2的帧数
+ yawnFrame1 = yawnFrame1 + 1;
+ yawnFrame2 = yawnFrame2 + 1;
+ } else if (isSmallYawn) {//上一帧是处于张嘴程度小于阈值1,大于阙值2的情况
+ yawnFrame1 = yawnFrame1 + 1;
+ yawnFrame2 = yawnFrame2 + 1;
+ //改变张嘴的状态
+ isSmallYawn = false;
+ isBigYawn = true;
+ } else {//上一帧是小于阙值2的情况
+ yawnFrame1 = yawnFrame1 + 1;
+ yawnFrame2 = yawnFrame2 + 1;
+ isBigYawn = true;
+ }
+ } else if (faceAttr.mouseOpenBig >= yawnThreshold2) {//如果张嘴程度大于阈值2,小于阙值1
+ if (isBigYawn) {//上一帧是处于张嘴程度大于阈值1的情况
+ maxYawnFrame1 = Math.max(yawnFrame1, maxYawnFrame1);//记录连续的大于阙值1的最大帧数
+ yawnFrame1 = 0;
+ yawnFrame2 = yawnFrame2 + 1;
+ isSmallYawn = true;
+ isBigYawn = false;
+ } else if (isSmallYawn) {
+ yawnFrame2 = yawnFrame2 + 1;
+ } else {
+ isSmallYawn = true;
+ yawnFrame2 = yawnFrame2 + 1;
+ }
+ } else {//如果张嘴程度小于阙值2
+ if (isBigYawn || isSmallYawn) {//如果上一帧是张开嘴的
+ maxYawnFrame1 = Math.max(yawnFrame1, maxYawnFrame1);//记录连续的大于阙值1的最大帧数
+ maxYawnFrame2 = Math.max(yawnFrame2, maxYawnFrame2);//记录连续的大于阙值2的最大帧数
+ yawnFrame1 = 0;
+ yawnFrame2 = 0;
+ isBigYawn = false;
+ isSmallYawn = false;
+ //进行哈欠判定
+ if (maxYawnFrame1 >= yawnFrameThreshold2 ||
+ (maxYawnFrame1 >= yawnFrameThreshold1 && maxYawnFrame2 >= yawnFrameThreshold3)) {
+ yawnNumber = yawnNumber + 1;
+ }
+ maxYawnFrame1 = 0;
+ maxYawnFrame2 = 0;
+ }
+ }
+ }
+
+ /**
+ * 初始化头部姿态以及判定点头
+ *
+ * @param faceAttr
+ */
+ private void judgeNod(FaceLandmarkInfo faceAttr) {
+ if (initPosition) return;
+ if (Math.abs(faceAttr.pitch - normalPitch) >= 30 || Math.abs(faceAttr.roll - normalRoll) >= 25) {
+ headNodFrame = headNodFrame + 1;
+ } else {
+ headNormalFrame = headNormalFrame + 1;
+ }
+ }
+
+ /**
+ * 根据视线判定注意力
+ *
+ * @param faceIrisInfo
+ */
+ private void judgeNotice(FaceIrisInfo faceIrisInfo, FaceLandmarkInfo faceAttr) {
+ if (initPosition) return;
+ if (isEyesClose) {
+ loseNoticeFrame = 0;
+ return;
+ }
+ TenginekitPoint leftCenter = faceIrisInfo.leftEye.eyeIris.get(0);
+ TenginekitPoint leftCorner = faceIrisInfo.leftEye.eyeLandmark.get(8);
+ TenginekitPoint leftOuterCorner = faceIrisInfo.leftEye.eyeLandmark.get(0);
+ float deviation = (leftCenter.X - leftOuterCorner.X) / (leftCorner.X - leftOuterCorner.X);
+ //Log.d(LOG_TAG, "judgeNotice: devuation" + Float.toString(deviation));
+ if (deviation < noticeThreshold1 || deviation > noticeThreshold2 || Math.abs(faceAttr.yaw - normalYaw) > 20) {
+ loseNoticeFrame = loseNoticeFrame + 1;
+ } else {
+ loseNoticeFrame = 0;
+ }
+ if (loseNoticeFrame >= 40) {
+ makeNoticeAlarm();
+ loseNoticeFrame = 0;
+ }
+ }
+
+ //发出初始化提示
+ public void makeInitAlarm(int flag) {
+ if (isAlarming) return;
+ if (alarmPlayer != null) {
+ alarmPlayer.release();
+ }
+ switch (flag) {
+ case 0:
+ alarmPlayer = MediaPlayer.create(this, R.raw.init_fail);
+ alarmPlayer.setOnCompletionListener(onCompletionListener);
+ alarmPlayer.start();
+ isAlarming = true;
+ break;
+ case 1:
+ alarmPlayer = MediaPlayer.create(this, R.raw.init_success);
+ alarmPlayer.setOnCompletionListener(onCompletionListener);
+ alarmPlayer.start();
+ isAlarming = true;
+ break;
+ case 2:
+ alarmPlayer = MediaPlayer.create(this, R.raw.init_fail_notdetect);
+ alarmPlayer.setOnCompletionListener(onCompletionListener);
+ alarmPlayer.start();
+ isAlarming = true;
+ break;
+ case 3:
+ alarmPlayer = MediaPlayer.create(this, R.raw.reinit);
+ alarmPlayer.setOnCompletionListener(onCompletionListener);
+ alarmPlayer.start();
+ isAlarming = true;
+ break;
+ default:
+ break;
+ }
+ }
+
+ public void makenotDetectFrameAlarm() {
+ if (isAlarming || initPosition) return;
+ if (alarmPlayer != null) {
+ alarmPlayer.release();
+ }
+ alarmPlayer = MediaPlayer.create(this, R.raw.notdetect);
+ alarmPlayer.setOnCompletionListener(onCompletionListener);
+ alarmPlayer.start();
+ isAlarming = true;
+ }
+
+ //根据疲劳程度不同发出不同警报
+ public void makeFatigueAlarm() {
+ if (isAlarming || initPosition) return;
+ if (fatigueDegree <= fatigueThreshold1) {
+ twiceTimes = 2;
+ return;
+ }
+ if (fatigueDegree <= fatigueThreshold2) {
+ twiceTimes--;
+ if (twiceTimes == 0) {
+ if (alarmPlayer != null) {
+ alarmPlayer.release();
+ }
+ alarmPlayer = MediaPlayer.create(this, R.raw.fatigue1);
+ alarmPlayer.setOnCompletionListener(onCompletionListener);
+ alarmPlayer.start();
+ isAlarming = true;
+ twiceTimes = 2;
+ }
+ return;
+ }
+ if (fatigueDegree <= fatigueThreshold3) {
+ twiceTimes = 2;
+ if (alarmPlayer != null) {
+ alarmPlayer.release();
+ }
+ alarmPlayer = MediaPlayer.create(this, R.raw.fatigue2);
+ alarmPlayer.setOnCompletionListener(onCompletionListener);
+ alarmPlayer.start();
+ isAlarming = true;
+ return;
+ }
+ if (fatigueDegree <= fatigueThreshold4) {
+ twiceTimes = 2;
+ if (alarmPlayer != null) {
+ alarmPlayer.release();
+ }
+ alarmPlayer = MediaPlayer.create(this, R.raw.fatigue3);
+ alarmPlayer.setOnCompletionListener(onCompletionListener);
+ alarmPlayer.start();
+ isAlarming = true;
+ return;
+ }
+ twiceTimes = 2;
+ if (alarmPlayer != null) {
+ alarmPlayer.release();
+ }
+ alarmPlayer = MediaPlayer.create(this, R.raw.fatigue4);
+ alarmPlayer.setOnCompletionListener(onCompletionListener);
+ alarmPlayer.start();
+ isAlarming = true;
+ }
+
+ //发出头部位置不正常的警报
+ public void makeNodAlarm() {
+ if (isAlarming || initPosition) return;
+ if (alarmPlayer != null) {
+ alarmPlayer.release();
+ }
+ alarmPlayer = MediaPlayer.create(this, R.raw.headnod);
+ alarmPlayer.setOnCompletionListener(onCompletionListener);
+ alarmPlayer.start();
+ isAlarming = true;
+ }
+
+ //发出注意力不集中的警报
+ public void makeNoticeAlarm() {
+ if (isAlarming || initPosition) return;
+ if (alarmPlayer != null) {
+ alarmPlayer.release();
+ }
+ alarmPlayer = MediaPlayer.create(this, R.raw.notice);
+ alarmPlayer.setOnCompletionListener(onCompletionListener);
+ alarmPlayer.start();
+ isAlarming = true;
+ }
+
+ //重置疲劳检测的有关参数
+ private void reSetParameter() {
+ totalFrameNumber = 0;
+ twiceTimes = 2;
+ perclosDegree = 0;
+ avgBlinkTime = 0;
+ yawnNumber = 0;
+ eyesCloseNumber = 0;
+ blinkNumber = 0;
+ fatigueDegree = 0;
+ }
+
+ @Override
+ public synchronized void onResume() {
+ super.onResume();
+ handleTimeMsg();
+ }
+
+ @Override
+ public void onPause() {
+ stopBackgroundThread();
+ super.onPause();
+ }
+
+ public void handleTimeMsg() {
+ timeHandler = new Handler(new Handler.Callback() {
+ @Override
+ public boolean handleMessage(Message msg) {
+ switch (msg.what) {
+ case INIT_MSG:
+ if (initPosition) {
+ if (fail2Init) {
+ totalPitch = 0;
+ totalRoll = 0;
+ totalYaw = 0;
+ initFrame = 0;
+ timeHandler.sendEmptyMessageDelayed(INIT_MSG, 15000);// 15s后发msg
+ makeInitAlarm(2);
+ fail2Init = false;
+ break;
+ }
+ normalPitch = totalPitch / initFrame;
+ normalRoll = totalRoll / initFrame;
+ normalYaw = totalYaw / initFrame;
+ if (Math.abs(normalYaw) < 2) {
+ totalPitch = 0;
+ totalRoll = 0;
+ totalYaw = 0;
+ initFrame = 0;
+ initPosition = false;
+ startOtherSchedule();
+ makeInitAlarm(1);
+ showToast(R.string.init_success);
+ } else {
+ totalPitch = 0;
+ totalRoll = 0;
+ totalYaw = 0;
+ initFrame = 0;
+ timeHandler.sendEmptyMessageDelayed(INIT_MSG, 15000);// 15s后发msg
+ makeInitAlarm(0);
+ showToast(R.string.init_fail);
+ }
+ }
+ break;
+ case FATIGUE_MSG:
+ perclosDegree = (double) eyesCloseNumber / (double) totalFrameNumber;
+ avgBlinkTime = (perclosDegree * 60) / blinkNumber;
+ fatigueDegree = perclosDegree + 0.8 * avgBlinkTime + 0.5 * yawnNumber;
+ makeFatigueAlarm();
+ reSetParameter();
+ break;
+ case NOD_MSG:
+ if (0.7 * headNodFrame > 0.3 * headNormalFrame) {
+ makeNodAlarm();
+ }
+ headNodFrame = 0;
+ headNormalFrame = 0;
+ break;
+ default:
+ break;
+ }
+ return false;
+ }
+ });
+ timeHandler.sendEmptyMessageDelayed(INIT_MSG, 15000);// 15s后发msg
+ }
+
+ //开始其他定时检测
+ protected void startOtherSchedule() {
+ if (timer4Init != null) {
+ timer4Init.cancel();
+ timer4Init = null;
+ }
+ timer4Fatigue = new Timer();
+ timer4Fatigue.schedule(new TimerTask() {
+ @Override
+ public void run() {
+ // 使用handler发送消息
+ Message message = new Message();
+ message.what = FATIGUE_MSG;
+ timeHandler.sendMessage(message);
+ }
+ }, 60000, 60000);//每隔60秒使用handler发送一下消息
+
+ timer4Nod = new Timer();
+ timer4Nod.schedule(new TimerTask() {
+ @Override
+ public void run() {
+ // 使用handler发送消息
+ Message message = new Message();
+ message.what = NOD_MSG;
+ timeHandler.sendMessage(message);
+ }
+ }, 10000, 10000);//每隔10秒使用handler发送一下消息
+ startBackgroundThread();
+ }
+ //mine
+
+ /***
+ * BridgeService callback
+ *
+ * **/
+ @Override
+ public void callBackMessageNotify(String did, int msgType, int param) {
+ Log.d("tag", "MessageNotify did: " + did + " msgType: " + msgType
+ + " param: " + param);
+ if (bManualExit)
+ return;
+
+ if (msgType == ContentCommon.PPPP_MSG_TYPE_STREAM) {
+ nStreamCodecType = param;
+ return;
+ }
+
+ if (msgType != ContentCommon.PPPP_MSG_TYPE_PPPP_STATUS) {
+ return;
+ }
+
+ if (!did.equals(strDID)) {
+ return;
+ }
+
+ Message msg = new Message();
+ msg.what = 1;
+ msgHandler.sendMessage(msg);
+ }
+
+ /***
+ * BridgeService callback
+ *
+ * **/
+ @Override
+ public void callBackAudioData(byte[] pcm, int len) {
+ Log.d(LOG_TAG, "AudioData: len :+ " + len);
+
+ if (!audioPlayer.isAudioPlaying()) {
+ return;
+ }
+ CustomBufferHead head = new CustomBufferHead();
+ CustomBufferData data = new CustomBufferData();
+ head.length = len;
+ head.startcode = AUDIO_BUFFER_START_CODE;
+ data.head = head;
+ data.data = pcm;
+ AudioBuffer.addData(data);
+ }
+
+ /***
+ * BridgeService callback
+ *
+ * **/
+ @Override
+ public void callBackH264Data(byte[] h264, int type, int size) {
+ //Log.d("tag", "CallBack_H264Data" + " type:" + type + " size:" + size);
+ if (isTakeVideo) {
+ Date date = new Date();
+ long time = date.getTime();
+ int tspan = (int) (time - videotime);
+ Log.d("tag", "play tspan:" + tspan);
+ videotime = time;
+ if (videoRecorder != null) {
+ videoRecorder.VideoRecordData(type, h264, size, 0, tspan);
+ }
+ }
+ }
+
+ //对讲数据
+ @Override
+ public void AudioRecordData(byte[] data, int len) {
+ // TODO Auto-generated method stub
+ if (bAudioRecordStart && len > 0) {
+ NativeCaller.PPPPTalkAudioData(strDID, data, len);
+ }
+ }
+
+ //定义录像接口
+ public void setVideoRecord(VideoRecorder videoRecorder) {
+ this.videoRecorder = videoRecorder;
+ }
+
+ public VideoRecorder videoRecorder;
+
+ public interface VideoRecorder {
+ abstract public void VideoRecordData(int type, byte[] videodata, int width, int height, int time);
+ }
+
+ /**
+ * r
+ * 获取警笛和白光状态
+ *
+ * @param did
+ * @param pwd
+ */
+ public static void getLightAndSirenStatte(String did, String pwd) {
+ NativeCaller.TransferMessage(did, "trans_cmd_string.cgi?cmd=2109&command=2" + "&loginuse=" + "admin" + "&loginpas=" + pwd, 1);
+ }
+
+ /**
+ * 启动后台线程
+ */
+ private void startBackgroundThread() {
+ //开启名字为cameraBackground的子线程
+ backgroundThread = new HandlerThread(HANDLE_THREAD_NAME);
+ backgroundThread.start();
+ //将Handle绑定backgroundThread
+ backgroundHandler = new Handler(backgroundThread.getLooper());
+ //同步锁
+ synchronized (lock) {
+ runClassifier = true;
+ }
+
+ backgroundHandler.post(periodicClassify);
+ }
+
+ /**
+ * 停止后台线程
+ */
+ @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
+ private void stopBackgroundThread() {
+ backgroundThread.quitSafely();
+ try {
+ backgroundThread.join();
+ backgroundThread = null;
+ backgroundHandler = null;
+ synchronized (lock) {
+ runClassifier = false;
+ }
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * 定期拍照并识别
+ */
+ private Runnable periodicClassify =
+ new Runnable() {
+ @Override
+ public void run() {
+ synchronized (lock) {
+ if (runClassifier) {
+ classifyFrame();
+ }
+ }
+ backgroundHandler.post(periodicClassify);
+ }
+ };
+
+ /**
+ * tensorFlow识别
+ */
+ private void classifyFrame() {
+ if (classifier == null || initPosition || videodata == null) {
+ return;
+ }
+ byte[] rgb = new byte[nVideoWidths * nVideoHeights * 2];
+ NativeCaller.YUV4202RGB565(videodata, rgb, nVideoWidths, nVideoHeights);
+ ByteBuffer buffer = ByteBuffer.wrap(rgb);
+ Bitmap tmpBitmap = Bitmap.createBitmap( nVideoWidths, nVideoHeights, Bitmap.Config.RGB_565);
+ tmpBitmap.copyPixelsFromBuffer(buffer);
+ Bitmap recognBitmap = changeBitmapSize(tmpBitmap);
+ final List results = classifier.recognizeImage(recognBitmap);
+ tmpBitmap.recycle();
+ for (final Classifier.Recognition result : results) {
+ final RectF location = result.getLocation();
+ if (location != null && result.getConfidence() >= MINIMUM_CONFIDENCE_TF_OD_API) {
+ if (result.getTitle().equals("phone")) {
+ ;
+ } else if (result.getTitle().equals("smoke")) {
+ ;
+ } else if (result.getTitle().equals("safety belt")) {
+ ;
+ }
+ }
+ }
+ }
+ private Bitmap changeBitmapSize(Bitmap bitmap) {
+ int width = bitmap.getWidth();
+ int height = bitmap.getHeight();
+ int newWidth=TF_OD_API_INPUT_SIZE;
+ int newHeight=TF_OD_API_INPUT_SIZE;
+ //计算压缩的比率
+ float scaleWidth=((float)newWidth)/width;
+ float scaleHeight=((float)newHeight)/height;
+ // 获取想要缩放的matrix
+ Matrix matrix = new Matrix();
+ matrix.postScale(scaleWidth,scaleHeight);
+
+ //获取新的bitmap
+ bitmap=Bitmap.createBitmap(bitmap,0,0,width,height,matrix,true);
+ bitmap.getWidth();
+ bitmap.getHeight();
+ return bitmap;
+ }
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/PlayCommonManager.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/PlayCommonManager.java
new file mode 100644
index 0000000..623f3b5
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/PlayCommonManager.java
@@ -0,0 +1,698 @@
+package com.ipcamera.detect;
+
+import android.Manifest;
+import android.app.Activity;
+import android.app.ActivityManager;
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.Matrix;
+import android.graphics.PointF;
+import android.graphics.Shader;
+import android.graphics.drawable.BitmapDrawable;
+import android.media.MediaScannerConnection;
+import android.net.Uri;
+import android.os.Environment;
+import android.os.StatFs;
+import android.text.format.Formatter;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.animation.Animation;
+import android.view.animation.AnimationUtils;
+import android.widget.ImageView;
+import android.widget.RelativeLayout;
+import android.widget.Toast;
+import com.ipcamera.detect.utils.AudioPlayer;
+import com.ipcamera.detect.utils.CustomBuffer;
+import com.ipcamera.detect.utils.CustomBufferData;
+import com.ipcamera.detect.utils.CustomBufferHead;
+import com.ipcamer.detect.R;
+
+
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Locale;
+import java.util.TimeZone;
+
+import vstc2.nativecaller.NativeCaller;
+
+public class PlayCommonManager implements MediaScannerConnection.MediaScannerConnectionClient{
+
+ public static final int PLAY_MODE_LIVE = 0;
+ public static final int PLAY_MODE_RECORDED_SDCARD = 1;
+
+ private static final int AUDIO_BUFFER_START_CODE = 0xff00ff;
+
+ private Activity activity;
+ private ImageView videoView = null;
+
+ private int playMode;
+ private String strDID;
+
+ private MediaScannerConnection mediaScannerConnection;
+ private File snapshotFile;
+ private File videoFile;
+
+ private CustomBuffer AudioBuffer = null;
+ private AudioPlayer audioPlayer = null;
+
+ private String snapshotSaveFolderName = "";
+ private String snapshotSaveFileName = "";
+
+ private boolean isPictSave = false;
+ private boolean isBackPressed = false;
+
+ private static final int NONE = 0;
+ private static final int DRAG = 1;
+ private static final int ZOOM = 2;
+
+ ////////////////////////////////////
+ private BitmapDrawable drawable = null;
+ private RelativeLayout bottomView;
+ private RelativeLayout topbg;
+ private Animation showTopAnim;
+ private Animation dismissTopAnim;
+ private Animation showAnim;
+ private Animation dismissAnim;
+
+ private boolean isUpDownPressed = false;
+ private boolean isShowtoping = false;
+
+ private boolean isDown = false;
+ private boolean isSecondDown = false;
+ private float x1 = 0;
+ private float x2 = 0;
+ private float y1 = 0;
+ private float y2 = 0;
+ private int mode = NONE;
+
+ private float oldDist;
+ private Matrix matrix = new Matrix();
+ private Matrix savedMatrix = new Matrix();
+ private PointF start = new PointF();
+ private PointF mid = new PointF();
+ float mMaxZoom = 2.0f;
+ float mMinZoom = 0.3125f;
+ float originalScale;
+ float baseValue;
+ protected Matrix mBaseMatrix = new Matrix();
+ protected Matrix mSuppMatrix = new Matrix();
+ private Matrix mDisplayMatrix = new Matrix();
+ private final float[] mMatrixValues = new float[9];
+
+
+ public PlayCommonManager(Activity activity, ImageView videoView, int playMode, String strDID){
+ this.activity = activity;
+ this.playMode = playMode;
+ this.strDID = strDID;
+ this.videoView = videoView;
+
+ snapshotSaveFolderName = "wer";//activity.getIntent().getExtras().getString("snapshotSaveFolderName");
+ snapshotSaveFileName = "wer";//activity.getIntent().getExtras().getString("snapshotSaveFileName");
+
+ AudioBuffer = new CustomBuffer();
+ audioPlayer = new AudioPlayer(AudioBuffer);
+
+ initViews();
+
+ dismissTopAnim = AnimationUtils.loadAnimation(activity,
+ activity.getResources().getIdentifier("ptz_top_anim_dismiss", "anim", activity.getPackageName()));
+ showTopAnim = AnimationUtils.loadAnimation(activity,
+ activity.getResources().getIdentifier("ptz_top_anim_show", "anim", activity.getPackageName()));
+ showAnim = AnimationUtils.loadAnimation(activity,
+ activity.getResources().getIdentifier("ptz_otherset_anim_show", "anim", activity.getPackageName()));
+ dismissAnim = AnimationUtils.loadAnimation(activity,
+ activity.getResources().getIdentifier("ptz_otherset_anim_dismiss", "anim", activity.getPackageName()));
+ }
+
+ public void initViews(){
+ //底部菜单
+ bottomView=(RelativeLayout) activity.findViewById(R.id.bottom_view);
+ topbg = (RelativeLayout) activity.findViewById(R.id.top_bg);
+
+ Bitmap bitmap = BitmapFactory.decodeResource(activity.getResources(),
+ activity.getResources().getIdentifier("top_bg", "drawable", activity.getPackageName()));
+ drawable = new BitmapDrawable(bitmap);
+ drawable.setTileModeXY(Shader.TileMode.REPEAT, Shader.TileMode.REPEAT);
+ drawable.setDither(true);
+
+ topbg.setBackgroundDrawable(drawable);
+ bottomView.setBackgroundDrawable(drawable);
+ }
+
+ //显示顶部菜单
+ private void showTop() {
+ if (isShowtoping) {
+ isShowtoping = false;
+ topbg.setVisibility(View.GONE);
+ topbg.startAnimation(dismissTopAnim);
+ } else {
+ isShowtoping = true;
+ topbg.setVisibility(View.VISIBLE);
+ topbg.startAnimation(showTopAnim);
+ }
+ }
+
+ private void showBottom() {
+ if (isUpDownPressed) {
+ isUpDownPressed = false;
+ bottomView.startAnimation(dismissAnim);
+ bottomView.setVisibility(View.GONE);
+ } else {
+ isUpDownPressed = true;
+ bottomView.startAnimation(showAnim);
+ bottomView.setVisibility(View.VISIBLE);
+ }
+ }
+
+ public void onKeyDown(int keyCode, KeyEvent event) {
+ if (keyCode == KeyEvent.KEYCODE_BACK) {
+ isBackPressed = true;
+ }
+ }
+
+ public void onTouch(View v, MotionEvent event) {
+ if (!isDown) {
+ x1 = event.getX();
+ y1 = event.getY();
+ isDown = true;
+ }
+ switch (event.getAction() & MotionEvent.ACTION_MASK)
+ {
+ case MotionEvent.ACTION_DOWN:
+ savedMatrix.set(matrix);
+ start.set(event.getX(), event.getY());
+ mode = DRAG;
+ originalScale = getScale();
+ break;
+ case MotionEvent.ACTION_POINTER_UP:
+
+ break;
+ case MotionEvent.ACTION_UP:
+ if (Math.abs((x1 - x2)) < 25 && Math.abs((y1 - y2)) < 25)
+ {
+
+ if (playMode == PLAY_MODE_LIVE){
+ // ((PlayBackActivity)activity).dismissPopups();
+ }
+ if (!isSecondDown) {
+// if (!bProgress) {
+ showTop();
+ showBottom();
+// }
+ }
+ isSecondDown = false;
+ }
+ x1 = 0;
+ x2 = 0;
+ y1 = 0;
+ y2 = 0;
+ isDown = false;
+ break;
+ case MotionEvent.ACTION_POINTER_DOWN:
+ isSecondDown = true;
+ /*oldDist = spacing(event);
+ if (oldDist > 10f)
+ {
+ savedMatrix.set(matrix);
+ midPoint(mid, event);
+ mode = ZOOM;
+ }*/
+ break;
+
+ case MotionEvent.ACTION_MOVE:
+
+
+ }
+ }
+
+ protected void zoomTo(float scale, float centerX, float centerY)
+ {
+ Log.d("zoomTo", "zoomTo scale:" + scale);
+ if (scale > mMaxZoom) {
+ scale = mMaxZoom;
+ } else if (scale < mMinZoom) {
+ scale = mMinZoom;
+ }
+
+ float oldScale = getScale();
+ float deltaScale = scale / oldScale;
+ Log.d("deltaScale", "deltaScale:" + deltaScale);
+ mSuppMatrix.postScale(deltaScale, deltaScale, centerX, centerY);
+ videoView.setScaleType(ImageView.ScaleType.MATRIX);
+ videoView.setImageMatrix(getImageViewMatrix());
+ }
+
+ protected Matrix getImageViewMatrix() {
+ mDisplayMatrix.set(mBaseMatrix);
+ mDisplayMatrix.postConcat(mSuppMatrix);
+ return mDisplayMatrix;
+ }
+
+ protected float getScale(Matrix matrix) {
+ return getValue(matrix, Matrix.MSCALE_X);
+ }
+
+ protected float getScale() {
+ return getScale(mSuppMatrix);
+ }
+
+ protected float getValue(Matrix matrix, int whichValue) {
+ matrix.getValues(mMatrixValues);
+ return mMatrixValues[whichValue];
+ }
+
+ /*private float (MotionEvent event) {
+ try {
+ float x = event.getX(0) - event.getX(1);
+ float y = event.getY(0) - event.getY(1);
+ return FloatMath.sqrt(x * x + y * y);
+ } catch (Exception e) {
+ }
+ return 0;
+ }*/
+
+ private void midPoint(PointF point, MotionEvent event) {
+ float x = event.getX(0) + event.getX(1);
+ float y = event.getY(0) + event.getY(1);
+ point.set(x / 2, y / 2);
+ }
+
+ protected void onResume() {
+// ProvisionHandler.getInstance().getProvisionListener().onProvisionEvent(ProvisionListener.ProvisionEvent.EVENT_VIDEO_STARTED, null);
+ }
+
+ protected void onPause() {
+ activity.finish();
+ }
+
+ protected void onDestroy() {
+ if (playMode == PLAY_MODE_LIVE){
+ NativeCaller.StopPPPPLivestream(strDID);
+ }
+ else if (playMode == PLAY_MODE_RECORDED_SDCARD){
+ NativeCaller.StopPlayBack(strDID);
+ }
+
+ StopAudio();
+
+ if (!isBackPressed){
+// ProvisionHandler.getInstance().logout("all");
+ }
+ isBackPressed = false;
+
+// ProvisionHandler.getInstance().getProvisionListener().onProvisionEvent(ProvisionListener.ProvisionEvent.EVENT_VIDEO_STOPPED, null);
+ }
+
+ public void downloadVideo(){
+
+ if (mediaScannerConnection == null){
+ mediaScannerConnection = new MediaScannerConnection(activity, this);
+ }
+
+ String strDate = getStrDate();
+ String filePath = Environment.getExternalStorageDirectory() + "/" + "ipcam" + "/" + strDID +"_"+ strDate +".mp4";
+
+ File div = new File(Environment.getExternalStorageDirectory(),
+ "ipcam");
+ if (!div.exists()) {
+ div.mkdirs();
+ }
+
+ //videoFile = new File(div, "tf" + "_"+ strDate +".mp4");
+
+ NativeCaller.StrarRecordPlayBack(strDID, filePath);
+ }
+
+ public void onDownloadVideoFinished(){
+ if (!mediaScannerConnection.isConnected()){
+ mediaScannerConnection.connect();
+ } else {
+ if (videoFile != null) {
+ mediaScannerConnection.scanFile(videoFile.getAbsolutePath(), null);
+ videoFile = null;
+ }
+ }
+ }
+
+ public boolean canTakePhoto(){
+ if (existSdcard()) {// 判断sd卡是否存在
+ String permission = Manifest.permission.WRITE_EXTERNAL_STORAGE;
+// if(ProvisionPlugin.hasPermission(permission)) {
+ return true;
+// }
+// else{
+// showToast(ProvisionPlugin.getTranslation("messageStoragePermissionError"));
+// }
+ } else {
+// showToast("The device does not have an SDCard, photos are saved");
+ }
+ return false;
+ }
+
+ // 拍照
+ public void takePicture(final Bitmap bmp) {
+ if (mediaScannerConnection == null){
+ mediaScannerConnection = new MediaScannerConnection(activity, this);
+ }
+
+ if (!isPictSave) {
+ isPictSave = true;
+ new Thread() {
+ public void run() {
+ savePicToSDcard(bmp);
+ }
+ }.start();
+ } else {
+ return;
+ }
+ }
+
+ /*
+ * 保存到本地
+ * 注意:此处可以做本地数据库sqlit 保存照片,以便于到本地照片观看界面从SQLite取出照片
+ */
+ private synchronized void savePicToSDcard(final Bitmap bmp) {
+ String strDate = getStrDate();
+ //String date = strDate.substring(0, 10);
+ FileOutputStream fos = null;
+ try {
+ File div = new File(Environment.getExternalStorageDirectory(),
+ snapshotSaveFolderName);
+ if (!div.exists()) {
+ div.mkdirs();
+ }
+
+ snapshotFile = new File(div, snapshotSaveFileName + "_"+ strDate +".jpg");
+ fos = new FileOutputStream(snapshotFile);
+ if (bmp.compress(Bitmap.CompressFormat.JPEG, 100, fos))
+ {
+ fos.flush();
+ Log.d("tag", "takepicture success");
+ activity.runOnUiThread(new Runnable() {
+
+ @Override
+ public void run() {
+ showToast(("messageTakingSnapshotSuccess"));
+ }
+ });
+ }
+ } catch (Exception e) {
+ activity.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ showToast(("messageVideoParamsResetToDefault"));
+ }
+ });
+ Log.d("tag", "exception:" + e.getMessage());
+ e.printStackTrace();
+ } finally {
+ isPictSave = false;
+ if (fos != null) {
+ try {
+ fos.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ fos = null;
+ }
+ }
+
+ if (!mediaScannerConnection.isConnected()){
+ mediaScannerConnection.connect();
+ } else {
+ if (snapshotFile != null) {
+ mediaScannerConnection.scanFile(snapshotFile.getAbsolutePath(), null);
+ snapshotFile = null;
+ }
+ }
+ }
+ //时间格式
+ private String getStrDate() {
+ Date d = new Date();
+ SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd_HH_mm_ss");
+ String strDate = f.format(d);
+ return strDate;
+ }
+
+ public String getTimeZone(int tz) {
+ String tzStr = null;
+ switch (tz) {
+ case 39600:
+ tzStr = "GMT-11:00";
+ break;
+ case 36000:
+ tzStr = "GMT-10:00";
+ break;
+ case 32400:
+ tzStr = "GMT-09:00";
+ break;
+ case 28800:
+ tzStr = "GMT-08:00";
+ break;
+ case 25200:
+ tzStr = "GMT-07:00";
+ break;
+ case 21600:
+ tzStr = "GMT-06:00";
+ break;
+ case 18000:
+ tzStr = "GMT-05:00";
+ break;
+ case 14400:
+ tzStr = "GMT-04:00";
+ break;
+ case 12600:
+ tzStr = "GMT-03:30";
+ break;
+ case 10800:
+ tzStr = "GMT-03:00";
+ break;
+ case 7200:
+ tzStr = "GMT-02:00";
+ break;
+ case 3600:
+ tzStr = "GMT-01:00";
+ break;
+ case 0:
+ tzStr = "GMT";
+ break;
+ case -3600:
+ tzStr = "GMT+01:00";
+ break;
+ case -7200:
+ tzStr = "GMT+02:00";
+ break;
+ case -10800:
+ tzStr = "GMT+03:00";
+ break;
+ case -12600:
+ tzStr = "GMT+03:30";
+ break;
+ case -14400:
+ tzStr = "GMT+04:00";
+ break;
+ case -16200:
+ tzStr = "GMT+04:30";
+ break;
+ case -18000:
+ tzStr = "GMT+05:00";
+ break;
+ case -19800:
+ tzStr = "GMT+05:30";
+ break;
+
+ case -21600:
+ tzStr = "GMT+06:00";
+ break;
+ case -25200:
+ tzStr = "GMT+07:00";
+ break;
+ case -28800:
+ tzStr = "GMT+08:00";
+ break;
+ case -32400:
+ tzStr = "GMT+09:00";
+ break;
+ case -34200:
+ tzStr = "GMT+09:30";
+ break;
+ case -36000:
+ tzStr = "GMT+10:00";
+ break;
+ case -39600:
+ tzStr = "GMT+11:00";
+ break;
+ case -43200:
+ tzStr = "GMT+12:00";
+ break;
+ default:
+ break;
+ }
+ return tzStr;
+ }
+
+ public String getDeviceTime(long millisutc, String tz) {
+
+ TimeZone timeZone = TimeZone.getTimeZone(tz);
+ Calendar calendar = Calendar.getInstance(timeZone);
+ calendar.setTimeInMillis(millisutc);
+
+ int second = calendar.get(Calendar.SECOND);
+
+
+ DateFormat dateFormat = android.text.format.DateFormat.getDateFormat(activity);
+
+ Locale locale = Locale.getDefault();
+ boolean use24Hour = android.text.format.DateFormat.is24HourFormat(activity);
+// final String skeleton = use24Hour ? "Hm" : "hm";
+// final String pattern = android.text.format.DateFormat.getBestDateTimePattern(locale, skeleton);
+ DateFormat formatter = new SimpleDateFormat(use24Hour ? "HH:mm:ss" : "hh:mm:ss a", locale);
+ return dateFormat.format(calendar.getTime()) + " " + formatter.format(calendar.getTime()).replace("am", "AM").replace("pm","PM");
+
+ }
+
+ @Override
+ public void onMediaScannerConnected() {
+ if (snapshotFile != null) {
+ mediaScannerConnection.scanFile(snapshotFile.getAbsolutePath(), null);
+ }
+ if (videoFile != null) {
+ mediaScannerConnection.scanFile(videoFile.getAbsolutePath(), null);
+ }
+ }
+
+ @Override
+ public void onScanCompleted(String path, Uri uri) {
+ mediaScannerConnection.disconnect();;
+ }
+
+ private void showToast(String i)
+ {
+ Toast.makeText(activity, i, Toast.LENGTH_LONG).show();
+ }
+
+ public void addAudioData(byte[] videobuf, int len){
+ CustomBufferHead head = new CustomBufferHead();
+ CustomBufferData data = new CustomBufferData();
+ head.length = len;
+ head.startcode = AUDIO_BUFFER_START_CODE;
+ data.head = head;
+ data.data = videobuf;
+ AudioBuffer.addData(data);
+ }
+
+ public boolean isAudioPlaying(){
+ return audioPlayer.isAudioPlaying();
+ }
+
+ //监听
+ public void StartAudio() {
+ synchronized (this) {
+ AudioBuffer.ClearAll();
+ audioPlayer.AudioPlayStart();
+ if (playMode == PLAY_MODE_LIVE) {
+ NativeCaller.PPPPStartAudio(strDID);
+ }
+ }
+ }
+ //停止监听
+ public void StopAudio() {
+ synchronized (this) {
+ audioPlayer.AudioPlayStop();
+ AudioBuffer.ClearAll();
+ if (playMode == PLAY_MODE_LIVE) {
+ NativeCaller.PPPPStopAudio(strDID);
+ }
+ }
+ }
+
+ /**
+ * 获取系统内存大小
+ * @return
+ */
+ public String getSysteTotalMemorySize(Context context){
+ ActivityManager mActivityManager = (ActivityManager)activity.getSystemService(Context.ACTIVITY_SERVICE);
+ ActivityManager.MemoryInfo memoryInfo = new ActivityManager.MemoryInfo() ;
+ mActivityManager.getMemoryInfo(memoryInfo) ;
+ long memSize = memoryInfo.totalMem ;
+ String availMemStr = Formatter.formatFileSize(context,memSize);
+ return availMemStr ;
+ }
+
+ /**
+
+ * 获取手机内部可用空间大小
+
+ * @return
+
+ */
+ public static String getAvailableInternalMemorySize(Context context) {
+ File path = Environment.getDataDirectory();
+ Log.i("zzz", path.getAbsolutePath());
+ StatFs stat = new StatFs(path.getPath());
+ long blockSize = stat.getBlockSize();
+ long availableBlocks = stat.getAvailableBlocks();
+ return Formatter.formatFileSize(context, availableBlocks * blockSize);
+ }
+
+ /**
+ * 获取手机内部空间大小
+ * @return
+ */
+ public static String getTotalInternalMemorySize(Context context) {
+ File path = Environment.getDataDirectory();//Gets the Android data directory
+ Log.i("zzz", path.getAbsolutePath());
+ StatFs stat = new StatFs(path.getPath());
+ long blockSize = stat.getBlockSize(); //每个block 占字节数
+ long totalBlocks = stat.getBlockCount(); //block总数
+ return Formatter.formatFileSize(context, totalBlocks * blockSize);
+ }
+
+ public static String getDiskCacheDir(Context mContext){
+ String cachePath;
+ if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {
+ cachePath = mContext.getExternalCacheDir().getPath();
+ } else {
+ cachePath = mContext.getCacheDir().getPath();
+ }
+ // 防止不存在目录文件,自动创建
+ createFile(cachePath);
+ // 返回文件存储地址
+ return cachePath;
+ }
+
+ public static File createFile(String fPath){
+ try {
+ File file = new File(fPath);
+ // 当这个文件夹不存在的时候则创建文件夹
+ if(!file.exists()){
+ // 允许创建多级目录
+ file.mkdirs();
+ // 这个无法创建多级目录
+ // rootFile.mkdir();
+ }
+ return file;
+ } catch (Exception e) {
+ }
+ return null;
+ }
+
+ //判断sd卡是否存在
+ public boolean existSdcard() {
+ if (Environment.getExternalStorageState().equals(
+ Environment.MEDIA_MOUNTED)) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/SCameraSetPlanVideoTiming.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/SCameraSetPlanVideoTiming.java
new file mode 100644
index 0000000..f929270
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/SCameraSetPlanVideoTiming.java
@@ -0,0 +1,681 @@
+package com.ipcamera.detect;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.Map.Entry;
+
+
+
+
+
+
+import com.ipcamer.detect.R;
+import com.ipcamera.detect.bean.DefenseConstant;
+import com.ipcamera.detect.utils.SensorTimeUtil;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.Window;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.LinearLayout;
+import android.widget.NumberPicker;
+import android.widget.TextView;
+import android.widget.TimePicker;
+import android.widget.Toast;
+import android.widget.CompoundButton.OnCheckedChangeListener;
+import android.widget.TimePicker.OnTimeChangedListener;
+
+public class SCameraSetPlanVideoTiming extends BaseActivity implements
+ OnClickListener{
+ private LinearLayout timing_backlayout; //返回
+ private TextView timing_textView1, timing_textView2; //开始时间结束时间
+ private TimePicker timing_timePicker1 , timing_timePicker2; //时间选择器
+ private CheckBox timing_id1,timing_id2,timing_id3,timing_id4,timing_id5,timing_id6,timing_id7; //选择星期
+ private Button timing_start_delete,timing_start_save,timing_save;
+ private String startTime = "00:00", endTime = "24:00";
+ private int status = 1;
+ private TreeSet dateset;
+ private int type = 0;
+ private int value, key;
+ private int absValue;
+ private LinearLayout timing_edit_layout; //编辑布局
+ private TextView tv_camera_timingaddplan; //标题
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ // TODO Auto-generated method stub
+ super.onCreate(savedInstanceState);
+ requestWindowFeature(Window.FEATURE_NO_TITLE);
+ setContentView(R.layout.videotape_timing_setting);
+ getDate();
+ findview();
+
+ }
+
+ private void getDate() {
+ // TODO Auto-generated method stub
+ Intent it = getIntent();
+ type = it.getIntExtra("type", 0);
+ absValue = it.getIntExtra("value", 0);
+ value = Math.abs(absValue);
+ key = it.getIntExtra("key", 0);
+ dateset = new TreeSet(new Comparator() {
+
+ @Override
+ public int compare(Integer c1, Integer c2) {
+ // TODO Auto-generated method stub
+ if (c1 > c2) {
+ return -1;
+ } else if (c1 == c2) {
+ return 0;
+ } else {
+ return 1;
+ }
+
+ }
+
+ });
+ }
+
+ //初始化数据
+ public void findview(){
+ timing_backlayout = (LinearLayout) findViewById(R.id.timing_backlayout);
+ timing_textView1 = (TextView) findViewById(R.id.timing_textView1);
+ timing_textView2 = (TextView) findViewById(R.id.timing_textView2);
+ timing_timePicker1 = (TimePicker) findViewById(R.id.timing_timePicker1);
+ timing_timePicker2 = (TimePicker) findViewById(R.id.timing_timePicker2);
+ timing_id1 = (CheckBox) findViewById(R.id.timing_id1);
+ timing_id2 = (CheckBox) findViewById(R.id.timing_id2);
+ timing_id3 = (CheckBox) findViewById(R.id.timing_id3);
+ timing_id4 = (CheckBox) findViewById(R.id.timing_id4);
+ timing_id5 = (CheckBox) findViewById(R.id.timing_id5);
+ timing_id6 = (CheckBox) findViewById(R.id.timing_id6);
+ timing_id7 = (CheckBox) findViewById(R.id.timing_id7);
+ timing_start_delete = (Button) findViewById(R.id.timing_start_delete);
+ timing_start_save = (Button) findViewById(R.id.timing_start_save);
+ timing_save = (Button) findViewById(R.id.timing_save);
+ timing_edit_layout = (LinearLayout) findViewById(R.id.timing_edit_layout);
+ tv_camera_timingaddplan = (TextView) findViewById(R.id.tv_camera_timingaddplan);
+ timing_textView1.setText(getResources().getString(
+ R.string.camera_defense_starttime)
+ + ":" + startTime);
+ timing_textView2.setText(getResources().getString(
+ R.string.camera_defense_endtime)
+ + ":" + endTime);
+ //开始时间
+ timing_timePicker1.setIs24HourView(true);
+ timing_timePicker1.setCurrentHour(0);
+ timing_timePicker1.setCurrentMinute(0);
+ timing_timePicker1.setOnTimeChangedListener(new OnTimeChangedListener() {
+ @Override
+ public void onTimeChanged(TimePicker view, int hourOfDay, int minute) {
+ String myMinute = "00";
+ String myHour = "00";
+ if (hourOfDay < 10) {
+ myHour = "0" + hourOfDay;
+ } else {
+ myHour = hourOfDay + "";
+ }
+ if (minute < 10) {
+ myMinute = "0" + minute;
+ } else {
+ myMinute = "" + minute;
+ }
+
+ startTime = myHour + ":" + myMinute;
+ timing_textView1.setText(getResources().getString(
+ R.string.camera_defense_starttime)
+ + ":" + startTime);
+ }
+ });
+ //结束时间
+ timing_timePicker2.setIs24HourView(true);
+ timing_timePicker2.setCurrentHour(0);
+ timing_timePicker2.setCurrentMinute(0);
+ timing_timePicker2.setOnTimeChangedListener(new OnTimeChangedListener() {
+ @Override
+ public void onTimeChanged(TimePicker view, int hourOfDay, int minute) {
+ String myMinute = "00";
+ String myHour = "00";
+ if (hourOfDay < 10) {
+ myHour = "0" + hourOfDay;
+ } else {
+ myHour = hourOfDay + "";
+ }
+ if (minute < 10) {
+ myMinute = "0" + minute;
+ } else {
+ myMinute = "" + minute;
+ }
+
+ endTime = myHour + ":" + myMinute;
+
+ if (hourOfDay == 0 && minute == 0) {
+ endTime = "24:00";
+ }
+ timing_textView2.setText(getResources().getString(
+ R.string.camera_defense_endtime)
+ + ":" + endTime);
+ }
+ });
+
+ if (type == 0) {
+ tv_camera_timingaddplan.setText(getResources().getString(
+ R.string.add_valid_time));
+ } else {
+ timing_edit_layout.setVisibility(View.VISIBLE);
+ timing_save.setVisibility(View.GONE);
+ tv_camera_timingaddplan.setText(getResources().getString(
+ R.string.edit_valid_time));
+ if (value != 0) {
+ int bStarttime = value & 0x7ff;
+ int bEndTime = (value >> 12) & 0x7ff;
+ int tp1H = getTimeHour(bStarttime);
+ int tp1M = getTimeMinute(bStarttime);
+ timing_timePicker1.setCurrentHour(tp1H);
+ timing_timePicker1.setCurrentMinute(tp1M);
+ int tp2H = getTimeHour(bEndTime);
+ int tp2M = getTimeMinute(bEndTime);
+ timing_timePicker2.setCurrentHour(tp2H);
+ timing_timePicker2.setCurrentMinute(tp2M);
+// LogTools.logW(tp1H + "," + tp1M);
+// LogTools.logW(tp2H + "," + tp2M);
+ }
+ }
+ timing_backlayout.setOnClickListener(this);
+ timing_start_delete.setOnClickListener(this);
+ timing_start_save.setOnClickListener(this);
+ timing_save.setOnClickListener(this);
+ CheckBoxListener listener = new CheckBoxListener();
+ timing_id1.setOnCheckedChangeListener(listener);
+ timing_id2.setOnCheckedChangeListener(listener);
+ timing_id3.setOnCheckedChangeListener(listener);
+ timing_id4.setOnCheckedChangeListener(listener);
+ timing_id5.setOnCheckedChangeListener(listener);
+ timing_id6.setOnCheckedChangeListener(listener);
+ timing_id7.setOnCheckedChangeListener(listener);
+ if (type == 1) {
+ getWeekPlan(value);
+ }
+ }
+
+ private void getWeekPlan(int time) {
+ for (int i = 24; i < 31; i++) {
+ int weeks = (time >> i) & 1;
+ switch (i) {
+ case 24:
+ if (weeks == 1) {
+ timing_id7.setChecked(true);
+ } else {
+ timing_id7.setChecked(false);
+ }
+ break;
+ case 25:
+ if (weeks == 1) {
+ timing_id1.setChecked(true);
+ } else {
+ timing_id1.setChecked(false);
+ }
+ break;
+ case 26:
+ if (weeks == 1) {
+ timing_id2.setChecked(true);
+ } else {
+ timing_id2.setChecked(false);
+ }
+ break;
+ case 27:
+ if (weeks == 1) {
+ timing_id3.setChecked(true);
+ } else {
+ timing_id3.setChecked(false);
+ }
+ break;
+ case 28:
+ if (weeks == 1) {
+ timing_id4.setChecked(true);
+ } else {
+ timing_id4.setChecked(false);
+ }
+ break;
+ case 29:
+ if (weeks == 1) {
+ timing_id5.setChecked(true);
+ } else {
+ timing_id5.setChecked(false);
+ }
+ break;
+ case 30:
+ if (weeks == 1) {
+ timing_id6.setChecked(true);
+ } else {
+ timing_id6.setChecked(false);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ }
+
+ private int getTimeMinute(int time) {
+ if (time < 60) {
+ return time;
+ }
+ int h = time / 60;
+ int m = time - (h * 60);
+ return m;
+
+ }
+
+ private int getTimeHour(int time) {
+ if (time < 60) {
+ return 0;
+ }
+ int h = time / 60;
+ return h;
+
+ }
+
+ /**
+ * 得到timePicker里面的android.widget.NumberPicker组件
+ * (有两个android.widget.NumberPicker组件--hour,minute)
+ *
+ * @param viewGroup
+ * @return
+ */
+ private List findNumberPicker(ViewGroup viewGroup) {
+ List npList = new ArrayList();
+ View child = null;
+
+ if (null != viewGroup) {
+ for (int i = 0; i < viewGroup.getChildCount(); i++) {
+ child = viewGroup.getChildAt(i);
+ if (child instanceof NumberPicker) {
+ npList.add((NumberPicker) child);
+ } else if (child instanceof LinearLayout) {
+ List result = findNumberPicker((ViewGroup) child);
+ if (result.size() > 0) {
+ return result;
+ }
+ }
+ }
+ }
+
+ return npList;
+ }
+
+ class CheckBoxListener implements OnCheckedChangeListener {
+
+ @Override
+ public void onCheckedChanged(CompoundButton arg0, boolean arg1) {
+ // TODO Auto-generated method stub
+ CompoundButton box = (CompoundButton) arg0;
+ switch (box.getId()) {
+ case R.id.timing_id1:
+ if (box.isChecked()) {
+ timing_id1.setTextColor(getResources().getColor(
+ R.color.color_startcode_bg));
+ dateset.add(1);
+ } else {
+ timing_id1.setTextColor(getResources().getColor(
+ R.color.color_alarm_textcolor));
+ if (dateset.contains(1)) {
+ dateset.remove(1);
+ }
+ }
+ break;
+ case R.id.timing_id2:
+ if (box.isChecked()) {
+ timing_id2.setTextColor(getResources().getColor(
+ R.color.color_startcode_bg));
+ dateset.add(2);
+ } else {
+ timing_id2.setTextColor(getResources().getColor(
+ R.color.color_alarm_textcolor));
+ if (dateset.contains(2)) {
+ dateset.remove(2);
+ }
+ }
+ break;
+ case R.id.timing_id3:
+ if (box.isChecked()) {
+ dateset.add(3);
+ timing_id3.setTextColor(getResources().getColor(
+ R.color.color_startcode_bg));
+ } else {
+ timing_id3.setTextColor(getResources().getColor(
+ R.color.color_alarm_textcolor));
+ if (dateset.contains(3)) {
+ dateset.remove(3);
+ }
+ }
+ break;
+ case R.id.timing_id4:
+ if (box.isChecked()) {
+ dateset.add(4);
+ timing_id4.setTextColor(getResources().getColor(
+ R.color.color_startcode_bg));
+ } else {
+ timing_id4.setTextColor(getResources().getColor(
+ R.color.color_alarm_textcolor));
+ if (dateset.contains(4)) {
+ dateset.remove(4);
+ }
+ }
+ break;
+ case R.id.timing_id5:
+ if (box.isChecked()) {
+ dateset.add(5);
+ timing_id5.setTextColor(getResources().getColor(
+ R.color.color_startcode_bg));
+ } else {
+ timing_id5.setTextColor(getResources().getColor(
+ R.color.color_alarm_textcolor));
+ if (dateset.contains(5)) {
+ dateset.remove(5);
+ }
+ }
+ break;
+ case R.id.timing_id6:
+ if (box.isChecked()) {
+ dateset.add(6);
+ timing_id6.setTextColor(getResources().getColor(
+ R.color.color_startcode_bg));
+ } else {
+ timing_id6.setTextColor(getResources().getColor(
+ R.color.color_alarm_textcolor));
+ if (dateset.contains(6)) {
+ dateset.remove(6);
+ }
+ }
+ break;
+ case R.id.timing_id7:
+ if (box.isChecked()) {
+ dateset.add(0);
+ timing_id7.setTextColor(getResources().getColor(
+ R.color.color_startcode_bg));
+ } else {
+ timing_id7.setTextColor(getResources().getColor(
+ R.color.color_alarm_textcolor));
+ if (dateset.contains(0)) {
+ dateset.remove(0);
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ }
+
+ private int passStartTime, passEndTime;
+ private void checkTime() {
+ // TODO Auto-generated method stub
+
+// LogTools.LogWe("startTime:" + startTime + ",endTime:" + endTime
+// + "date:" + dateset.toString());
+ Log.e("vst","startTime:" + startTime + ",endTime:" + endTime
+ + "date:" + dateset.toString());
+ // if (startTime.equals(endTime) || startTime == endTime) {
+ // showToast(getResources().getString(R.string.defense_sametime));
+ // return;
+ // }
+ passStartTime = SensorTimeUtil.getPassMinutes(timing_timePicker1.getCurrentHour(),
+ timing_timePicker1.getCurrentMinute());
+ passEndTime = 0;
+ int endtimeH = timing_timePicker2.getCurrentHour();
+ int endtimeM = timing_timePicker2.getCurrentMinute();
+ if (endtimeH == 0 && endtimeM == 0) {
+ passEndTime = SensorTimeUtil.getPassMinutes(24, 0);
+ } else {
+ passEndTime = SensorTimeUtil.getPassMinutes(timing_timePicker2.getCurrentHour(),
+ timing_timePicker2.getCurrentMinute());
+ }
+ Log.e("vst","passStartTime"+passStartTime + "*passEndTime*"+passEndTime);
+ if (passEndTime <= passStartTime) {
+ //判断结束时间大于开始时间
+ //showToast(getResources().getString(R.string.defense_timeoutride));
+ //return;
+ }
+
+ if (dateset.size() == 0) {
+ showToast(getResources().getString(R.string.defense_nodate));
+ return;
+ }
+
+ // if(SensorTimeUtil.checkTime(startTime, endTime)){
+ // showToast("该时间内已经有其他计划了");
+ // return;
+ // }
+
+ // getPlanTime();
+ getPlanTimerInt();
+
+ }
+
+ private void getPlanTimerInt() {
+
+ String weeks = "0000000";
+ if (dateset.size() != 0) {
+ Iterator it = dateset.iterator();
+ while (it.hasNext()) {
+ int weekday = (Integer) it.next();
+ weeks = SensorTimeUtil.replaceIndex(6 - weekday, weeks);
+ }
+ }
+
+ Log.e("vst","weeks"+weeks);
+ String string23 = SensorTimeUtil.getMinutesString(passEndTime,
+ passStartTime);
+ String string32 = SensorTimeUtil.get2Strings(0 + "", weeks, string23);
+ int int32 = SensorTimeUtil.string32toInt(string32);
+
+ Intent its = new Intent();
+ if (type == 1) {
+ if (absValue < 0)
+ int32 = 0 - int32;
+ its.putExtra("jnitime", int32);
+ its.putExtra("key", key);
+ setResult(2019, its);
+ finish();
+ } else {
+ its.putExtra("jnitime", int32);
+ setResult(2018, its);
+ finish();
+ }
+
+ }
+// private void getPlanTime() {
+//
+// ArrayList> planlist = new ArrayList>();
+// for (int i = 1; i < 8; i++) {
+// if (!dateset.contains(i)) {
+// String key = getMapKey(i);
+// if (key.trim().length() != 0) {
+// Map map = new HashMap();
+// map.put(key, DefenseConstant.key_allDisAlarm);
+// planlist.add(map);
+// }
+// }
+// }
+//
+// if (dateset.size() != 0) {
+// Iterator it = dateset.iterator();
+// while (it.hasNext()) {
+// int weekday = (Integer) it.next();
+// String key = getMapKey(weekday);
+// Map map = new HashMap();
+// if (startTime.equals("00:00") && endTime.equals("24:00")) {
+// map.put(key, DefenseConstant.key_allAlarm);
+// planlist.add(map);
+// } else {
+// if (!SensorTimeUtil.checkTime(startTime, endTime, key)) {
+// String op2 = SensorTimeUtil.getOneDay96Strings(
+// startTime, endTime);
+// LogTools.LogWe("op2:" + op2);
+// map.put(key, op2);
+// planlist.add(map);
+// } else {
+// showToast(getResources().getString(
+// R.string.camera_defense_plan_clash));
+// return;
+// }
+// }
+// }
+// }
+//
+// int plansize = planlist.size();
+// if (plansize != 0) {
+// for (int i = 0; i < plansize; i++) {
+// Map map = planlist.get(i);
+// Set entries = map.entrySet();
+// if (entries != null) {
+// Iterator iterator = entries.iterator();
+// while (iterator.hasNext()) {
+// Map.Entry entry = (Entry) iterator.next();
+// String key = (String) entry.getKey();
+// String value = (String) entry.getValue();
+// SensorTimeUtil.addNewDayToMap(key, value);
+// }
+// }
+// }
+// }
+//
+// LogTools.LogWe("添加完成:" + SensorTimeUtil.planMap.toString());
+//
+// dateset.comparator();
+//
+// Intent its = new Intent();
+// its.putExtra("time", startTime + "-" + endTime);
+// its.putExtra("alarm", status);
+// its.putExtra("set", dateset);
+// setResult(2015, its);
+// finish();
+//
+// }
+
+ private String getMapKey(int day) {
+ String key = "";
+ switch (day) {
+ case 1:
+ key = DefenseConstant.key_Monday;
+ break;
+ case 2:
+ key = DefenseConstant.key_Tuesday;
+ break;
+ case 3:
+ key = DefenseConstant.key_Wednesday;
+ break;
+ case 4:
+ key = DefenseConstant.key_Thursday;
+ break;
+ case 5:
+ key = DefenseConstant.key_Friday;
+ break;
+ case 6:
+ key = DefenseConstant.key_Saturday;
+ break;
+ case 7:
+ key = DefenseConstant.key_Sunday;
+ break;
+
+ default:
+ break;
+ }
+ return key;
+ }
+
+ public void showToast(String t) {
+ Toast.makeText(SCameraSetPlanVideoTiming.this, t, 1000).show();
+ }
+
+ @Override
+ public void onClick(View v) {
+ // TODO Auto-generated method stub
+ switch (v.getId()) {
+ case R.id.timing_backlayout:
+ finish();
+ break;
+ case R.id.timing_start_delete:
+ showDefaultSetDialog();
+ break;
+ case R.id.timing_start_save:
+ checkTime();
+ break;
+ case R.id.timing_save:
+
+ checkTime();
+// Toast.makeText(
+// CameraSetSDTiming.this,
+// CameraSetSDTiming.this.getResources().getString(
+// R.string.camera_function_notsupport), Toast.LENGTH_SHORT)
+// .show();
+// finish();
+ break;
+
+ default:
+ break;
+ }
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+ private AlertDialog dialog = null;
+
+ private void showDefaultSetDialog() {
+ if (dialog != null && dialog.isShowing()) {
+ dialog.dismiss();
+ return;
+ }
+ AlertDialog.Builder builder = new AlertDialog.Builder(SCameraSetPlanVideoTiming.this);
+ builder.setMessage(R.string.del_ok);
+ builder.setPositiveButton(R.string.str_ok,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int whichButton) {
+ Intent its = new Intent();
+ its.putExtra("key", key);
+ setResult(2020, its);
+ finish();
+ }
+ });
+ builder.setNegativeButton(R.string.str_cancel,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int whichButton) {
+ dialog.dismiss();
+
+ }
+ });
+ dialog = builder.create();
+ dialog.show();
+
+ }
+
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/SCameraSetPushVideoTiming.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/SCameraSetPushVideoTiming.java
new file mode 100644
index 0000000..fd4de4c
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/SCameraSetPushVideoTiming.java
@@ -0,0 +1,673 @@
+package com.ipcamera.detect;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.Map.Entry;
+
+import com.ipcamer.detect.R;
+import com.ipcamera.detect.bean.DefenseConstant;
+import com.ipcamera.detect.utils.SensorTimeUtil;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.LinearLayout;
+import android.widget.NumberPicker;
+import android.widget.TextView;
+import android.widget.TimePicker;
+import android.widget.Toast;
+import android.widget.CompoundButton.OnCheckedChangeListener;
+import android.widget.TimePicker.OnTimeChangedListener;
+
+public class SCameraSetPushVideoTiming extends BaseActivity implements
+ OnClickListener{
+ private LinearLayout timing_backlayout; //返回
+ private TextView timing_textView1, timing_textView2; //开始时间结束时间
+ private TimePicker timing_timePicker1 , timing_timePicker2; //时间选择器
+ private CheckBox timing_id1,timing_id2,timing_id3,timing_id4,timing_id5,timing_id6,timing_id7; //选择星期
+ private Button timing_start_delete,timing_start_save,timing_save;
+ private String startTime = "00:00", endTime = "24:00";
+ private int status = 1;
+ private TreeSet dateset;
+ private int type = 0;
+ private int value, key;
+ private int absValue;
+ private LinearLayout timing_edit_layout; //编辑布局
+ private TextView tv_camera_timingaddplan; //标题
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ // TODO Auto-generated method stub
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.videotape_timing_setting);
+ getDate();
+ findview();
+
+ }
+
+ private void getDate() {
+ // TODO Auto-generated method stub
+ Intent it = getIntent();
+ type = it.getIntExtra("type", 0);
+ absValue = it.getIntExtra("value", 0);
+ value = Math.abs(absValue);
+ key = it.getIntExtra("key", 0);
+ dateset = new TreeSet(new Comparator() {
+
+ @Override
+ public int compare(Integer c1, Integer c2) {
+ // TODO Auto-generated method stub
+ if (c1 > c2) {
+ return -1;
+ } else if (c1 == c2) {
+ return 0;
+ } else {
+ return 1;
+ }
+
+ }
+
+ });
+ }
+
+ //初始化数据
+ public void findview(){
+ timing_backlayout = (LinearLayout) findViewById(R.id.timing_backlayout);
+ timing_textView1 = (TextView) findViewById(R.id.timing_textView1);
+ timing_textView2 = (TextView) findViewById(R.id.timing_textView2);
+ timing_timePicker1 = (TimePicker) findViewById(R.id.timing_timePicker1);
+ timing_timePicker2 = (TimePicker) findViewById(R.id.timing_timePicker2);
+ timing_id1 = (CheckBox) findViewById(R.id.timing_id1);
+ timing_id2 = (CheckBox) findViewById(R.id.timing_id2);
+ timing_id3 = (CheckBox) findViewById(R.id.timing_id3);
+ timing_id4 = (CheckBox) findViewById(R.id.timing_id4);
+ timing_id5 = (CheckBox) findViewById(R.id.timing_id5);
+ timing_id6 = (CheckBox) findViewById(R.id.timing_id6);
+ timing_id7 = (CheckBox) findViewById(R.id.timing_id7);
+ timing_start_delete = (Button) findViewById(R.id.timing_start_delete);
+ timing_start_save = (Button) findViewById(R.id.timing_start_save);
+ timing_save = (Button) findViewById(R.id.timing_save);
+ timing_edit_layout = (LinearLayout) findViewById(R.id.timing_edit_layout);
+ tv_camera_timingaddplan = (TextView) findViewById(R.id.tv_camera_timingaddplan);
+ timing_textView1.setText(getResources().getString(
+ R.string.camera_defense_starttime)
+ + ":" + startTime);
+ timing_textView2.setText(getResources().getString(
+ R.string.camera_defense_endtime)
+ + ":" + endTime);
+ //开始时间
+ timing_timePicker1.setIs24HourView(true);
+ timing_timePicker1.setCurrentHour(0);
+ timing_timePicker1.setCurrentMinute(0);
+ timing_timePicker1.setOnTimeChangedListener(new OnTimeChangedListener() {
+ @Override
+ public void onTimeChanged(TimePicker view, int hourOfDay, int minute) {
+ String myMinute = "00";
+ String myHour = "00";
+ if (hourOfDay < 10) {
+ myHour = "0" + hourOfDay;
+ } else {
+ myHour = hourOfDay + "";
+ }
+ if (minute < 10) {
+ myMinute = "0" + minute;
+ } else {
+ myMinute = "" + minute;
+ }
+
+ startTime = myHour + ":" + myMinute;
+ timing_textView1.setText(getResources().getString(
+ R.string.camera_defense_starttime)
+ + ":" + startTime);
+ }
+ });
+ //结束时间
+ timing_timePicker2.setIs24HourView(true);
+ timing_timePicker2.setCurrentHour(0);
+ timing_timePicker2.setCurrentMinute(0);
+ timing_timePicker2.setOnTimeChangedListener(new OnTimeChangedListener() {
+ @Override
+ public void onTimeChanged(TimePicker view, int hourOfDay, int minute) {
+ String myMinute = "00";
+ String myHour = "00";
+ if (hourOfDay < 10) {
+ myHour = "0" + hourOfDay;
+ } else {
+ myHour = hourOfDay + "";
+ }
+ if (minute < 10) {
+ myMinute = "0" + minute;
+ } else {
+ myMinute = "" + minute;
+ }
+
+ endTime = myHour + ":" + myMinute;
+
+ if (hourOfDay == 0 && minute == 0) {
+ endTime = "24:00";
+ }
+ timing_textView2.setText(getResources().getString(
+ R.string.camera_defense_endtime)
+ + ":" + endTime);
+ }
+ });
+
+ if (type == 0) {
+ tv_camera_timingaddplan.setText(getResources().getString(
+ R.string.add_period));
+ } else {
+ timing_edit_layout.setVisibility(View.VISIBLE);
+ timing_save.setVisibility(View.GONE);
+ tv_camera_timingaddplan.setText(getResources().getString(
+ R.string.edit_valid_time));
+ if (value != 0) {
+ int bStarttime = value & 0x7ff;
+ int bEndTime = (value >> 12) & 0x7ff;
+ int tp1H = getTimeHour(bStarttime);
+ int tp1M = getTimeMinute(bStarttime);
+ timing_timePicker1.setCurrentHour(tp1H);
+ timing_timePicker1.setCurrentMinute(tp1M);
+ int tp2H = getTimeHour(bEndTime);
+ int tp2M = getTimeMinute(bEndTime);
+ timing_timePicker2.setCurrentHour(tp2H);
+ timing_timePicker2.setCurrentMinute(tp2M);
+ }
+ }
+ timing_backlayout.setOnClickListener(this);
+ timing_start_delete.setOnClickListener(this);
+ timing_start_save.setOnClickListener(this);
+ timing_save.setOnClickListener(this);
+ CheckBoxListener listener = new CheckBoxListener();
+ timing_id1.setOnCheckedChangeListener(listener);
+ timing_id2.setOnCheckedChangeListener(listener);
+ timing_id3.setOnCheckedChangeListener(listener);
+ timing_id4.setOnCheckedChangeListener(listener);
+ timing_id5.setOnCheckedChangeListener(listener);
+ timing_id6.setOnCheckedChangeListener(listener);
+ timing_id7.setOnCheckedChangeListener(listener);
+ if (type == 1) {
+ getWeekPlan(value);
+ }
+ }
+
+ private void getWeekPlan(int time) {
+ for (int i = 24; i < 31; i++) {
+ int weeks = (time >> i) & 1;
+ switch (i) {
+ case 24:
+ if (weeks == 1) {
+ timing_id7.setChecked(true);
+ } else {
+ timing_id7.setChecked(false);
+ }
+ break;
+ case 25:
+ if (weeks == 1) {
+ timing_id1.setChecked(true);
+ } else {
+ timing_id1.setChecked(false);
+ }
+ break;
+ case 26:
+ if (weeks == 1) {
+ timing_id2.setChecked(true);
+ } else {
+ timing_id2.setChecked(false);
+ }
+ break;
+ case 27:
+ if (weeks == 1) {
+ timing_id3.setChecked(true);
+ } else {
+ timing_id3.setChecked(false);
+ }
+ break;
+ case 28:
+ if (weeks == 1) {
+ timing_id4.setChecked(true);
+ } else {
+ timing_id4.setChecked(false);
+ }
+ break;
+ case 29:
+ if (weeks == 1) {
+ timing_id5.setChecked(true);
+ } else {
+ timing_id5.setChecked(false);
+ }
+ break;
+ case 30:
+ if (weeks == 1) {
+ timing_id6.setChecked(true);
+ } else {
+ timing_id6.setChecked(false);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ }
+
+ private int getTimeMinute(int time) {
+ if (time < 60) {
+ return time;
+ }
+ int h = time / 60;
+ int m = time - (h * 60);
+ return m;
+
+ }
+
+ private int getTimeHour(int time) {
+ if (time < 60) {
+ return 0;
+ }
+ int h = time / 60;
+ return h;
+
+ }
+
+ /**
+ * 得到timePicker里面的android.widget.NumberPicker组件
+ * (有两个android.widget.NumberPicker组件--hour,minute)
+ *
+ * @param viewGroup
+ * @return
+ */
+ private List findNumberPicker(ViewGroup viewGroup) {
+ List npList = new ArrayList();
+ View child = null;
+
+ if (null != viewGroup) {
+ for (int i = 0; i < viewGroup.getChildCount(); i++) {
+ child = viewGroup.getChildAt(i);
+ if (child instanceof NumberPicker) {
+ npList.add((NumberPicker) child);
+ } else if (child instanceof LinearLayout) {
+ List result = findNumberPicker((ViewGroup) child);
+ if (result.size() > 0) {
+ return result;
+ }
+ }
+ }
+ }
+
+ return npList;
+ }
+
+ class CheckBoxListener implements OnCheckedChangeListener {
+
+ @Override
+ public void onCheckedChanged(CompoundButton arg0, boolean arg1) {
+ // TODO Auto-generated method stub
+ CompoundButton box = (CompoundButton) arg0;
+ switch (box.getId()) {
+ case R.id.timing_id1:
+ if (box.isChecked()) {
+ timing_id1.setTextColor(getResources().getColor(
+ R.color.color_startcode_bg));
+ dateset.add(1);
+ } else {
+ timing_id1.setTextColor(getResources().getColor(
+ R.color.color_alarm_textcolor));
+ if (dateset.contains(1)) {
+ dateset.remove(1);
+ }
+ }
+ break;
+ case R.id.timing_id2:
+ if (box.isChecked()) {
+ timing_id2.setTextColor(getResources().getColor(
+ R.color.color_startcode_bg));
+ dateset.add(2);
+ } else {
+ timing_id2.setTextColor(getResources().getColor(
+ R.color.color_alarm_textcolor));
+ if (dateset.contains(2)) {
+ dateset.remove(2);
+ }
+ }
+ break;
+ case R.id.timing_id3:
+ if (box.isChecked()) {
+ dateset.add(3);
+ timing_id3.setTextColor(getResources().getColor(
+ R.color.color_startcode_bg));
+ } else {
+ timing_id3.setTextColor(getResources().getColor(
+ R.color.color_alarm_textcolor));
+ if (dateset.contains(3)) {
+ dateset.remove(3);
+ }
+ }
+ break;
+ case R.id.timing_id4:
+ if (box.isChecked()) {
+ dateset.add(4);
+ timing_id4.setTextColor(getResources().getColor(
+ R.color.color_startcode_bg));
+ } else {
+ timing_id4.setTextColor(getResources().getColor(
+ R.color.color_alarm_textcolor));
+ if (dateset.contains(4)) {
+ dateset.remove(4);
+ }
+ }
+ break;
+ case R.id.timing_id5:
+ if (box.isChecked()) {
+ dateset.add(5);
+ timing_id5.setTextColor(getResources().getColor(
+ R.color.color_startcode_bg));
+ } else {
+ timing_id5.setTextColor(getResources().getColor(
+ R.color.color_alarm_textcolor));
+ if (dateset.contains(5)) {
+ dateset.remove(5);
+ }
+ }
+ break;
+ case R.id.timing_id6:
+ if (box.isChecked()) {
+ dateset.add(6);
+ timing_id6.setTextColor(getResources().getColor(
+ R.color.color_startcode_bg));
+ } else {
+ timing_id6.setTextColor(getResources().getColor(
+ R.color.color_alarm_textcolor));
+ if (dateset.contains(6)) {
+ dateset.remove(6);
+ }
+ }
+ break;
+ case R.id.timing_id7:
+ if (box.isChecked()) {
+ dateset.add(0);
+ timing_id7.setTextColor(getResources().getColor(
+ R.color.color_startcode_bg));
+ } else {
+ timing_id7.setTextColor(getResources().getColor(
+ R.color.color_alarm_textcolor));
+ if (dateset.contains(0)) {
+ dateset.remove(0);
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ }
+
+ private int passStartTime, passEndTime;
+ private void checkTime() {
+ // TODO Auto-generated method stub
+
+ Log.e("vst","startTime:" + startTime + ",endTime:" + endTime
+ + "date:" + dateset.toString());
+ // if (startTime.equals(endTime) || startTime == endTime) {
+ // showToast(getResources().getString(R.string.defense_sametime));
+ // return;
+ // }
+ passStartTime = SensorTimeUtil.getPassMinutes(timing_timePicker1.getCurrentHour(),
+ timing_timePicker1.getCurrentMinute());
+ passEndTime = 0;
+ int endtimeH = timing_timePicker2.getCurrentHour();
+ int endtimeM = timing_timePicker2.getCurrentMinute();
+ if (endtimeH == 0 && endtimeM == 0) {
+ passEndTime = SensorTimeUtil.getPassMinutes(24, 0);
+ } else {
+ passEndTime = SensorTimeUtil.getPassMinutes(timing_timePicker2.getCurrentHour(),
+ timing_timePicker2.getCurrentMinute());
+ }
+ Log.e("vst","passStartTime"+passStartTime + "*passEndTime*"+passEndTime);
+ if (passEndTime <= passStartTime) {
+ //判断结束时间大于开始时间
+ //showToast(getResources().getString(R.string.defense_timeoutride));
+ //return;
+ }
+
+ if (dateset.size() == 0) {
+ showToast(getResources().getString(R.string.defense_nodate));
+ return;
+ }
+
+ // if(SensorTimeUtil.checkTime(startTime, endTime)){
+ // showToast("该时间内已经有其他计划了");
+ // return;
+ // }
+
+ // getPlanTime();
+ getPlanTimerInt();
+
+ }
+
+ private void getPlanTimerInt() {
+
+ String weeks = "0000000";
+ if (dateset.size() != 0) {
+ Iterator it = dateset.iterator();
+ while (it.hasNext()) {
+ int weekday = (Integer) it.next();
+ weeks = SensorTimeUtil.replaceIndex(6 - weekday, weeks);
+ }
+ }
+
+ Log.e("vst","weeks"+weeks);
+ String string23 = SensorTimeUtil.getMinutesString(passEndTime,
+ passStartTime);
+ String string32 = SensorTimeUtil.get2Strings(0 + "", weeks, string23);
+ int int32 = SensorTimeUtil.string32toInt(string32);
+
+ Intent its = new Intent();
+ if (type == 1) {
+ if (absValue < 0)
+ int32 = 0 - int32;
+ its.putExtra("jnitime", int32);
+ its.putExtra("key", key);
+// setResult(2016, its);
+ setResult(2012, its);
+ finish();
+ } else {
+ its.putExtra("jnitime", int32);
+// setResult(2015, its);
+ setResult(2011, its);
+ finish();
+ }
+
+ }
+// private void getPlanTime() {
+//
+// ArrayList> planlist = new ArrayList>();
+// for (int i = 1; i < 8; i++) {
+// if (!dateset.contains(i)) {
+// String key = getMapKey(i);
+// if (key.trim().length() != 0) {
+// Map map = new HashMap();
+// map.put(key, DefenseConstant.key_allDisAlarm);
+// planlist.add(map);
+// }
+// }
+// }
+//
+// if (dateset.size() != 0) {
+// Iterator it = dateset.iterator();
+// while (it.hasNext()) {
+// int weekday = (Integer) it.next();
+// String key = getMapKey(weekday);
+// Map map = new HashMap();
+// if (startTime.equals("00:00") && endTime.equals("24:00")) {
+// map.put(key, DefenseConstant.key_allAlarm);
+// planlist.add(map);
+// } else {
+// if (!SensorTimeUtil.checkTime(startTime, endTime, key)) {
+// String op2 = SensorTimeUtil.getOneDay96Strings(
+// startTime, endTime);
+// LogTools.LogWe("op2:" + op2);
+// map.put(key, op2);
+// planlist.add(map);
+// } else {
+// showToast(getResources().getString(
+// R.string.camera_defense_plan_clash));
+// return;
+// }
+// }
+// }
+// }
+//
+// int plansize = planlist.size();
+// if (plansize != 0) {
+// for (int i = 0; i < plansize; i++) {
+// Map map = planlist.get(i);
+// Set entries = map.entrySet();
+// if (entries != null) {
+// Iterator iterator = entries.iterator();
+// while (iterator.hasNext()) {
+// Map.Entry entry = (Entry) iterator.next();
+// String key = (String) entry.getKey();
+// String value = (String) entry.getValue();
+// SensorTimeUtil.addNewDayToMap(key, value);
+// }
+// }
+// }
+// }
+//
+// LogTools.LogWe("添加完成:" + SensorTimeUtil.planMap.toString());
+//
+// dateset.comparator();
+//
+// Intent its = new Intent();
+// its.putExtra("time", startTime + "-" + endTime);
+// its.putExtra("alarm", status);
+// its.putExtra("set", dateset);
+// setResult(2015, its);
+// finish();
+//
+// }
+
+ private String getMapKey(int day) {
+ String key = "";
+ switch (day) {
+ case 1:
+ key = DefenseConstant.key_Monday;
+ break;
+ case 2:
+ key = DefenseConstant.key_Tuesday;
+ break;
+ case 3:
+ key = DefenseConstant.key_Wednesday;
+ break;
+ case 4:
+ key = DefenseConstant.key_Thursday;
+ break;
+ case 5:
+ key = DefenseConstant.key_Friday;
+ break;
+ case 6:
+ key = DefenseConstant.key_Saturday;
+ break;
+ case 7:
+ key = DefenseConstant.key_Sunday;
+ break;
+
+ default:
+ break;
+ }
+ return key;
+ }
+
+ public void showToast(String t) {
+ Toast.makeText(SCameraSetPushVideoTiming.this, t, 1000).show();
+ }
+
+ @Override
+ public void onClick(View v) {
+ // TODO Auto-generated method stub
+ switch (v.getId()) {
+ case R.id.timing_backlayout:
+ finish();
+ break;
+ case R.id.timing_start_delete:
+ showDefaultSetDialog();
+ break;
+ case R.id.timing_start_save:
+ checkTime();
+ break;
+ case R.id.timing_save:
+
+ checkTime();
+// Toast.makeText(
+// CameraSetSDTiming.this,
+// CameraSetSDTiming.this.getResources().getString(
+// R.string.camera_function_notsupport), Toast.LENGTH_SHORT)
+// .show();
+// finish();
+ break;
+
+ default:
+ break;
+ }
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+ private AlertDialog dialog = null;
+
+ private void showDefaultSetDialog() {
+ if (dialog != null && dialog.isShowing()) {
+ dialog.dismiss();
+ return;
+ }
+ AlertDialog.Builder builder = new AlertDialog.Builder(SCameraSetPushVideoTiming.this);
+ builder.setMessage(R.string.del_ok);
+ builder.setPositiveButton(R.string.str_ok,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int whichButton) {
+ Intent its = new Intent();
+ its.putExtra("key", key);
+// setResult(2017, its);
+ setResult(2013, its);
+ finish();
+ }
+ });
+ builder.setNegativeButton(R.string.str_cancel,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int whichButton) {
+ dialog.dismiss();
+
+ }
+ });
+ dialog = builder.create();
+ dialog.show();
+
+ }
+
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/SCameraSetSDTiming.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/SCameraSetSDTiming.java
new file mode 100644
index 0000000..b04a851
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/SCameraSetSDTiming.java
@@ -0,0 +1,677 @@
+package com.ipcamera.detect;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.Map.Entry;
+
+import com.ipcamer.detect.R;
+import com.ipcamera.detect.bean.DefenseConstant;
+import com.ipcamera.detect.utils.SensorTimeUtil;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.Window;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.LinearLayout;
+import android.widget.NumberPicker;
+import android.widget.TextView;
+import android.widget.TimePicker;
+import android.widget.Toast;
+import android.widget.CompoundButton.OnCheckedChangeListener;
+import android.widget.TimePicker.OnTimeChangedListener;
+
+public class SCameraSetSDTiming extends BaseActivity implements
+ OnClickListener{
+ private LinearLayout timing_backlayout; //返回
+ private TextView timing_textView1, timing_textView2; //开始时间结束时间
+ private TimePicker timing_timePicker1 , timing_timePicker2; //时间选择器
+ private CheckBox timing_id1,timing_id2,timing_id3,timing_id4,timing_id5,timing_id6,timing_id7; //选择星期
+ private Button timing_start_delete,timing_start_save,timing_save;
+ private String startTime = "00:00", endTime = "24:00";
+ private int status = 1;
+ private TreeSet dateset;
+ private int type = 0;
+ private int value, key;
+ private int absValue;
+ private LinearLayout timing_edit_layout; //编辑布局
+ private TextView tv_camera_timingaddplan; //标题
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ // TODO Auto-generated method stub
+ super.onCreate(savedInstanceState);
+ requestWindowFeature(Window.FEATURE_NO_TITLE);
+ setContentView(R.layout.videotape_timing_setting);
+ getDate();
+ findview();
+
+ }
+
+ private void getDate() {
+ // TODO Auto-generated method stub
+ Intent it = getIntent();
+ type = it.getIntExtra("type", 0);
+ absValue = it.getIntExtra("value", 0);
+ value = Math.abs(absValue);
+ key = it.getIntExtra("key", 0);
+ dateset = new TreeSet(new Comparator() {
+
+ @Override
+ public int compare(Integer c1, Integer c2) {
+ // TODO Auto-generated method stub
+ if (c1 > c2) {
+ return -1;
+ } else if (c1 == c2) {
+ return 0;
+ } else {
+ return 1;
+ }
+
+ }
+
+ });
+ }
+
+ //初始化数据
+ public void findview(){
+ timing_backlayout = (LinearLayout) findViewById(R.id.timing_backlayout);
+ timing_textView1 = (TextView) findViewById(R.id.timing_textView1);
+ timing_textView2 = (TextView) findViewById(R.id.timing_textView2);
+ timing_timePicker1 = (TimePicker) findViewById(R.id.timing_timePicker1);
+ timing_timePicker2 = (TimePicker) findViewById(R.id.timing_timePicker2);
+ timing_id1 = (CheckBox) findViewById(R.id.timing_id1);
+ timing_id2 = (CheckBox) findViewById(R.id.timing_id2);
+ timing_id3 = (CheckBox) findViewById(R.id.timing_id3);
+ timing_id4 = (CheckBox) findViewById(R.id.timing_id4);
+ timing_id5 = (CheckBox) findViewById(R.id.timing_id5);
+ timing_id6 = (CheckBox) findViewById(R.id.timing_id6);
+ timing_id7 = (CheckBox) findViewById(R.id.timing_id7);
+ timing_start_delete = (Button) findViewById(R.id.timing_start_delete);
+ timing_start_save = (Button) findViewById(R.id.timing_start_save);
+ timing_save = (Button) findViewById(R.id.timing_save);
+ timing_edit_layout = (LinearLayout) findViewById(R.id.timing_edit_layout);
+ tv_camera_timingaddplan = (TextView) findViewById(R.id.tv_camera_timingaddplan);
+ timing_textView1.setText(getResources().getString(
+ R.string.camera_defense_starttime)
+ + ":" + startTime);
+ timing_textView2.setText(getResources().getString(
+ R.string.camera_defense_endtime)
+ + ":" + endTime);
+ //开始时间
+ timing_timePicker1.setIs24HourView(true);
+ timing_timePicker1.setCurrentHour(0);
+ timing_timePicker1.setCurrentMinute(0);
+ timing_timePicker1.setOnTimeChangedListener(new OnTimeChangedListener() {
+ @Override
+ public void onTimeChanged(TimePicker view, int hourOfDay, int minute) {
+ String myMinute = "00";
+ String myHour = "00";
+ if (hourOfDay < 10) {
+ myHour = "0" + hourOfDay;
+ } else {
+ myHour = hourOfDay + "";
+ }
+ if (minute < 10) {
+ myMinute = "0" + minute;
+ } else {
+ myMinute = "" + minute;
+ }
+
+ startTime = myHour + ":" + myMinute;
+ timing_textView1.setText(getResources().getString(
+ R.string.camera_defense_starttime)
+ + ":" + startTime);
+ }
+ });
+ //结束时间
+ timing_timePicker2.setIs24HourView(true);
+ timing_timePicker2.setCurrentHour(0);
+ timing_timePicker2.setCurrentMinute(0);
+ timing_timePicker2.setOnTimeChangedListener(new OnTimeChangedListener() {
+ @Override
+ public void onTimeChanged(TimePicker view, int hourOfDay, int minute) {
+ String myMinute = "00";
+ String myHour = "00";
+ if (hourOfDay < 10) {
+ myHour = "0" + hourOfDay;
+ } else {
+ myHour = hourOfDay + "";
+ }
+ if (minute < 10) {
+ myMinute = "0" + minute;
+ } else {
+ myMinute = "" + minute;
+ }
+
+ endTime = myHour + ":" + myMinute;
+
+ if (hourOfDay == 0 && minute == 0) {
+ endTime = "24:00";
+ }
+ timing_textView2.setText(getResources().getString(
+ R.string.camera_defense_endtime)
+ + ":" + endTime);
+ }
+ });
+
+ if (type == 0) {
+ tv_camera_timingaddplan.setText(getResources().getString(
+ R.string.add_valid_time));
+ } else {
+ timing_edit_layout.setVisibility(View.VISIBLE);
+ timing_save.setVisibility(View.GONE);
+ tv_camera_timingaddplan.setText(getResources().getString(
+ R.string.edit_valid_time));
+ if (value != 0) {
+ int bStarttime = value & 0x7ff;
+ int bEndTime = (value >> 12) & 0x7ff;
+ int tp1H = getTimeHour(bStarttime);
+ int tp1M = getTimeMinute(bStarttime);
+ timing_timePicker1.setCurrentHour(tp1H);
+ timing_timePicker1.setCurrentMinute(tp1M);
+ int tp2H = getTimeHour(bEndTime);
+ int tp2M = getTimeMinute(bEndTime);
+ timing_timePicker2.setCurrentHour(tp2H);
+ timing_timePicker2.setCurrentMinute(tp2M);
+// LogTools.logW(tp1H + "," + tp1M);
+//
+// LogTools.logW(tp2H + "," + tp2M);
+ }
+ }
+ timing_backlayout.setOnClickListener(this);
+ timing_start_delete.setOnClickListener(this);
+ timing_start_save.setOnClickListener(this);
+ timing_save.setOnClickListener(this);
+ CheckBoxListener listener = new CheckBoxListener();
+ timing_id1.setOnCheckedChangeListener(listener);
+ timing_id2.setOnCheckedChangeListener(listener);
+ timing_id3.setOnCheckedChangeListener(listener);
+ timing_id4.setOnCheckedChangeListener(listener);
+ timing_id5.setOnCheckedChangeListener(listener);
+ timing_id6.setOnCheckedChangeListener(listener);
+ timing_id7.setOnCheckedChangeListener(listener);
+ if (type == 1) {
+ getWeekPlan(value);
+ }
+ }
+
+ private void getWeekPlan(int time) {
+ for (int i = 24; i < 31; i++) {
+ int weeks = (time >> i) & 1;
+ switch (i) {
+ case 24:
+ if (weeks == 1) {
+ timing_id7.setChecked(true);
+ } else {
+ timing_id7.setChecked(false);
+ }
+ break;
+ case 25:
+ if (weeks == 1) {
+ timing_id1.setChecked(true);
+ } else {
+ timing_id1.setChecked(false);
+ }
+ break;
+ case 26:
+ if (weeks == 1) {
+ timing_id2.setChecked(true);
+ } else {
+ timing_id2.setChecked(false);
+ }
+ break;
+ case 27:
+ if (weeks == 1) {
+ timing_id3.setChecked(true);
+ } else {
+ timing_id3.setChecked(false);
+ }
+ break;
+ case 28:
+ if (weeks == 1) {
+ timing_id4.setChecked(true);
+ } else {
+ timing_id4.setChecked(false);
+ }
+ break;
+ case 29:
+ if (weeks == 1) {
+ timing_id5.setChecked(true);
+ } else {
+ timing_id5.setChecked(false);
+ }
+ break;
+ case 30:
+ if (weeks == 1) {
+ timing_id6.setChecked(true);
+ } else {
+ timing_id6.setChecked(false);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ }
+
+ private int getTimeMinute(int time) {
+ if (time < 60) {
+ return time;
+ }
+ int h = time / 60;
+ int m = time - (h * 60);
+ return m;
+
+ }
+
+ private int getTimeHour(int time) {
+ if (time < 60) {
+ return 0;
+ }
+ int h = time / 60;
+ return h;
+
+ }
+
+ /**
+ * 得到timePicker里面的android.widget.NumberPicker组件
+ * (有两个android.widget.NumberPicker组件--hour,minute)
+ *
+ * @param viewGroup
+ * @return
+ */
+ private List findNumberPicker(ViewGroup viewGroup) {
+ List npList = new ArrayList();
+ View child = null;
+
+ if (null != viewGroup) {
+ for (int i = 0; i < viewGroup.getChildCount(); i++) {
+ child = viewGroup.getChildAt(i);
+ if (child instanceof NumberPicker) {
+ npList.add((NumberPicker) child);
+ } else if (child instanceof LinearLayout) {
+ List result = findNumberPicker((ViewGroup) child);
+ if (result.size() > 0) {
+ return result;
+ }
+ }
+ }
+ }
+
+ return npList;
+ }
+
+ class CheckBoxListener implements OnCheckedChangeListener {
+
+ @Override
+ public void onCheckedChanged(CompoundButton arg0, boolean arg1) {
+ // TODO Auto-generated method stub
+ CompoundButton box = (CompoundButton) arg0;
+ switch (box.getId()) {
+ case R.id.timing_id1:
+ if (box.isChecked()) {
+ timing_id1.setTextColor(getResources().getColor(
+ R.color.color_startcode_bg));
+ dateset.add(1);
+ } else {
+ timing_id1.setTextColor(getResources().getColor(
+ R.color.color_alarm_textcolor));
+ if (dateset.contains(1)) {
+ dateset.remove(1);
+ }
+ }
+ break;
+ case R.id.timing_id2:
+ if (box.isChecked()) {
+ timing_id2.setTextColor(getResources().getColor(
+ R.color.color_startcode_bg));
+ dateset.add(2);
+ } else {
+ timing_id2.setTextColor(getResources().getColor(
+ R.color.color_alarm_textcolor));
+ if (dateset.contains(2)) {
+ dateset.remove(2);
+ }
+ }
+ break;
+ case R.id.timing_id3:
+ if (box.isChecked()) {
+ dateset.add(3);
+ timing_id3.setTextColor(getResources().getColor(
+ R.color.color_startcode_bg));
+ } else {
+ timing_id3.setTextColor(getResources().getColor(
+ R.color.color_alarm_textcolor));
+ if (dateset.contains(3)) {
+ dateset.remove(3);
+ }
+ }
+ break;
+ case R.id.timing_id4:
+ if (box.isChecked()) {
+ dateset.add(4);
+ timing_id4.setTextColor(getResources().getColor(
+ R.color.color_startcode_bg));
+ } else {
+ timing_id4.setTextColor(getResources().getColor(
+ R.color.color_alarm_textcolor));
+ if (dateset.contains(4)) {
+ dateset.remove(4);
+ }
+ }
+ break;
+ case R.id.timing_id5:
+ if (box.isChecked()) {
+ dateset.add(5);
+ timing_id5.setTextColor(getResources().getColor(
+ R.color.color_startcode_bg));
+ } else {
+ timing_id5.setTextColor(getResources().getColor(
+ R.color.color_alarm_textcolor));
+ if (dateset.contains(5)) {
+ dateset.remove(5);
+ }
+ }
+ break;
+ case R.id.timing_id6:
+ if (box.isChecked()) {
+ dateset.add(6);
+ timing_id6.setTextColor(getResources().getColor(
+ R.color.color_startcode_bg));
+ } else {
+ timing_id6.setTextColor(getResources().getColor(
+ R.color.color_alarm_textcolor));
+ if (dateset.contains(6)) {
+ dateset.remove(6);
+ }
+ }
+ break;
+ case R.id.timing_id7:
+ if (box.isChecked()) {
+ dateset.add(0);
+ timing_id7.setTextColor(getResources().getColor(
+ R.color.color_startcode_bg));
+ } else {
+ timing_id7.setTextColor(getResources().getColor(
+ R.color.color_alarm_textcolor));
+ if (dateset.contains(0)) {
+ dateset.remove(0);
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ }
+
+ private int passStartTime, passEndTime;
+ private void checkTime() {
+ // TODO Auto-generated method stub
+
+// LogTools.LogWe("startTime:" + startTime + ",endTime:" + endTime
+// + "date:" + dateset.toString());
+ Log.e("vst","startTime:" + startTime + ",endTime:" + endTime
+ + "date:" + dateset.toString());
+ // if (startTime.equals(endTime) || startTime == endTime) {
+ // showToast(getResources().getString(R.string.defense_sametime));
+ // return;
+ // }
+ passStartTime = SensorTimeUtil.getPassMinutes(timing_timePicker1.getCurrentHour(),
+ timing_timePicker1.getCurrentMinute());
+ passEndTime = 0;
+ int endtimeH = timing_timePicker2.getCurrentHour();
+ int endtimeM = timing_timePicker2.getCurrentMinute();
+ if (endtimeH == 0 && endtimeM == 0) {
+ passEndTime = SensorTimeUtil.getPassMinutes(24, 0);
+ } else {
+ passEndTime = SensorTimeUtil.getPassMinutes(timing_timePicker2.getCurrentHour(),
+ timing_timePicker2.getCurrentMinute());
+ }
+ Log.e("vst","passStartTime"+passStartTime + "*passEndTime*"+passEndTime);
+ if (passEndTime <= passStartTime) {
+ //判断结束时间大于开始时间
+ //showToast(getResources().getString(R.string.defense_timeoutride));
+ //return;
+ }
+
+ if (dateset.size() == 0) {
+ showToast(getResources().getString(R.string.defense_nodate));
+ return;
+ }
+
+ // if(SensorTimeUtil.checkTime(startTime, endTime)){
+ // showToast("该时间内已经有其他计划了");
+ // return;
+ // }
+
+ // getPlanTime();
+ getPlanTimerInt();
+
+ }
+
+ private void getPlanTimerInt() {
+
+ String weeks = "0000000";
+ if (dateset.size() != 0) {
+ Iterator it = dateset.iterator();
+ while (it.hasNext()) {
+ int weekday = (Integer) it.next();
+ weeks = SensorTimeUtil.replaceIndex(6 - weekday, weeks);
+ }
+ }
+
+ Log.e("vst","weeks"+weeks);
+ String string23 = SensorTimeUtil.getMinutesString(passEndTime,
+ passStartTime);
+ String string32 = SensorTimeUtil.get2Strings(0 + "", weeks, string23);
+ int int32 = SensorTimeUtil.string32toInt(string32);
+
+ Intent its = new Intent();
+ if (type == 1) {
+ if (absValue < 0)
+ int32 = 0 - int32;
+ its.putExtra("jnitime", int32);
+ its.putExtra("key", key);
+ setResult(2016, its);
+ finish();
+ } else {
+ its.putExtra("jnitime", int32);
+ setResult(2015, its);
+ finish();
+ }
+
+ }
+// private void getPlanTime() {
+//
+// ArrayList> planlist = new ArrayList>();
+// for (int i = 1; i < 8; i++) {
+// if (!dateset.contains(i)) {
+// String key = getMapKey(i);
+// if (key.trim().length() != 0) {
+// Map map = new HashMap();
+// map.put(key, DefenseConstant.key_allDisAlarm);
+// planlist.add(map);
+// }
+// }
+// }
+//
+// if (dateset.size() != 0) {
+// Iterator it = dateset.iterator();
+// while (it.hasNext()) {
+// int weekday = (Integer) it.next();
+// String key = getMapKey(weekday);
+// Map map = new HashMap();
+// if (startTime.equals("00:00") && endTime.equals("24:00")) {
+// map.put(key, DefenseConstant.key_allAlarm);
+// planlist.add(map);
+// } else {
+// if (!SensorTimeUtil.checkTime(startTime, endTime, key)) {
+// String op2 = SensorTimeUtil.getOneDay96Strings(
+// startTime, endTime);
+// LogTools.LogWe("op2:" + op2);
+// map.put(key, op2);
+// planlist.add(map);
+// } else {
+// showToast(getResources().getString(
+// R.string.camera_defense_plan_clash));
+// return;
+// }
+// }
+// }
+// }
+//
+// int plansize = planlist.size();
+// if (plansize != 0) {
+// for (int i = 0; i < plansize; i++) {
+// Map map = planlist.get(i);
+// Set entries = map.entrySet();
+// if (entries != null) {
+// Iterator iterator = entries.iterator();
+// while (iterator.hasNext()) {
+// Map.Entry entry = (Entry) iterator.next();
+// String key = (String) entry.getKey();
+// String value = (String) entry.getValue();
+// SensorTimeUtil.addNewDayToMap(key, value);
+// }
+// }
+// }
+// }
+//
+// LogTools.LogWe("添加完成:" + SensorTimeUtil.planMap.toString());
+//
+// dateset.comparator();
+//
+// Intent its = new Intent();
+// its.putExtra("time", startTime + "-" + endTime);
+// its.putExtra("alarm", status);
+// its.putExtra("set", dateset);
+// setResult(2015, its);
+// finish();
+//
+// }
+
+ private String getMapKey(int day) {
+ String key = "";
+ switch (day) {
+ case 1:
+ key = DefenseConstant.key_Monday;
+ break;
+ case 2:
+ key = DefenseConstant.key_Tuesday;
+ break;
+ case 3:
+ key = DefenseConstant.key_Wednesday;
+ break;
+ case 4:
+ key = DefenseConstant.key_Thursday;
+ break;
+ case 5:
+ key = DefenseConstant.key_Friday;
+ break;
+ case 6:
+ key = DefenseConstant.key_Saturday;
+ break;
+ case 7:
+ key = DefenseConstant.key_Sunday;
+ break;
+
+ default:
+ break;
+ }
+ return key;
+ }
+
+ public void showToast(String t) {
+ Toast.makeText(SCameraSetSDTiming.this, t, 1000).show();
+ }
+
+ @Override
+ public void onClick(View v) {
+ // TODO Auto-generated method stub
+ switch (v.getId()) {
+ case R.id.timing_backlayout:
+ finish();
+ break;
+ case R.id.timing_start_delete:
+ showDefaultSetDialog();
+ break;
+ case R.id.timing_start_save:
+ checkTime();
+ break;
+ case R.id.timing_save:
+
+ checkTime();
+// Toast.makeText(
+// CameraSetSDTiming.this,
+// CameraSetSDTiming.this.getResources().getString(
+// R.string.camera_function_notsupport), Toast.LENGTH_SHORT)
+// .show();
+// finish();
+ break;
+
+ default:
+ break;
+ }
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+ private AlertDialog dialog = null;
+
+ private void showDefaultSetDialog() {
+ if (dialog != null && dialog.isShowing()) {
+ dialog.dismiss();
+ return;
+ }
+ AlertDialog.Builder builder = new AlertDialog.Builder(SCameraSetSDTiming.this);
+ builder.setMessage(R.string.del_ok);
+ builder.setPositiveButton(R.string.str_ok,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int whichButton) {
+ Intent its = new Intent();
+ its.putExtra("key", key);
+ setResult(2017, its);
+ finish();
+ }
+ });
+ builder.setNegativeButton(R.string.str_cancel,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int whichButton) {
+ dialog.dismiss();
+
+ }
+ });
+ dialog = builder.create();
+ dialog.show();
+
+ }
+
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/SensorStartCodeActivity.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/SensorStartCodeActivity.java
new file mode 100644
index 0000000..dea0020
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/SensorStartCodeActivity.java
@@ -0,0 +1,313 @@
+package com.ipcamera.detect;
+
+import java.util.Timer;
+import java.util.TimerTask;
+
+import com.ipcamer.detect.R;
+import com.ipcamera.detect.BridgeService.SensorSetCodeInterface;
+
+import vstc2.nativecaller.NativeCaller;
+import android.app.Activity;
+import android.content.Intent;
+import android.graphics.drawable.AnimationDrawable;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewTreeObserver.OnPreDrawListener;
+import android.view.Window;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+public class SensorStartCodeActivity extends Activity implements OnClickListener,SensorSetCodeInterface
+{
+ private ImageView sucess_code_imageview,code_imageview_type;
+ private Button cancleCode;
+ private TextView tv_note;
+ private RelativeLayout cancle_layout;
+ private LinearLayout code_sucess_layout;
+ private EditText sensor_name_edit;
+ private Button add_sensor_ok;
+
+ private String sensortype, did, pwd;
+ private Intent backdata = null;
+ private int id1, id2, id3;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ // TODO Auto-generated method stub
+ super.onCreate(savedInstanceState);
+ requestWindowFeature(Window.FEATURE_NO_TITLE);
+ setContentView(R.layout.startcode_layout);
+ getData();
+ findview();
+ backdata = new Intent();
+ }
+
+ @Override
+ protected void onStart() {
+ // TODO Auto-generated method stub
+ super.onStart();
+
+ }
+
+ private void getData()
+ {
+ // TODO Auto-generated method stub
+ Intent it = getIntent();
+ sensortype = it.getStringExtra("type");
+ did = it.getStringExtra("did");
+ pwd = it.getStringExtra("pwd");
+ NativeCaller.TransferMessage(did,"set_sensorstatus.cgi?cmd=2&loginuse=admin&loginpas=" + pwd + "&user=admin&pwd=" + pwd, 1);
+ NativeCaller.TransferMessage(did,
+ "trans_cmd_string.cgi?loginuse=admin&loginpas=" + pwd
+ + "&user=admin&pwd=" + pwd + "&cmd=2002&sensor_type="
+ + sensortype, 1);
+ startTimer();
+ BridgeService.setCodeInterface(this);
+ }
+
+ private void findview() {
+ // TODO Auto-generated method stub
+ code_imageview_type = (ImageView) findViewById(R.id.code_imageview_type);
+
+ cancle_layout = (RelativeLayout) findViewById(R.id.cancle_code_layout);
+ code_sucess_layout = (LinearLayout) findViewById(R.id.code_sucess_layout);
+
+ sensor_name_edit = (EditText) findViewById(R.id.sensor_name_edit);
+ add_sensor_ok = (Button) findViewById(R.id.add_sensor_ok);
+ add_sensor_ok.setOnClickListener(this);
+
+ tv_note = (TextView) findViewById(R.id.note);
+ cancleCode = (Button) findViewById(R.id.cancel_code);
+ cancleCode.setOnClickListener(this);
+
+ sucess_code_imageview = (ImageView) findViewById(R.id.sucess_code);
+
+ }
+
+
+ @Override
+ public void onClick(View v) {
+ // TODO Auto-generated method stub
+ switch (v.getId()) {
+ case R.id.cancel_code:
+ System.out.println("对码完成,退出对码、、、");
+ closeTimer(0);
+ break;
+ case R.id.add_sensor_ok:
+ goBack();
+ break;
+ default:
+ break;
+ }
+ }
+
+ private void goBack() {
+ String sensorname = sensor_name_edit.getText().toString().trim();
+ if (sensorname.equals("")) {
+// sensorname = getString(R.string.sensor_list_sensor);
+ sensorname=getNullSensorName(id1, id2, id3, type);
+ }
+ backdata.putExtra("sensorname", sensorname);
+ setResult(2013, backdata);
+ finish();
+
+ }
+
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
+ // TODO Auto-generated method stub
+ if (keyCode == KeyEvent.KEYCODE_BACK) {
+ closeTimer(0);
+ finish();
+ }
+ return super.onKeyDown(keyCode, event);
+
+ }
+
+ /** Timer对象 **/
+ private Timer timer = null;
+ /** TimerTask对象 **/
+ private TimerTask timerTask = null;
+
+ private void startTimer() {
+ if (timerTask == null) {
+ timerTask = new TimerTask() {
+ @Override
+ public void run() {
+ System.out.println("=---------------");
+ closeTimer(0);
+ }
+ };
+ timer = new Timer();
+ // schedule(TimerTask task, long delay, long period)
+ // 安排指定的任务从指定的延迟后开始进行重复的固定延迟执行。
+ // task - 所要安排的任务。
+ // delay - 执行任务前的延迟时间,单位是毫秒。
+ // period - 执行各后续任务之间的时间间隔,单位是毫秒。
+ System.out.println("对码中、、、");
+ timer.schedule(timerTask, 30*1000);
+ }
+ }
+
+ private void reStart() {
+ if (timer != null) {
+ timer.cancel();
+ timer = null;
+ }
+ if (timerTask != null) {
+ timerTask = null;
+ }
+ }
+
+ private void closeTimer(int type) {
+ if (timer != null) {
+ timer.cancel();
+ timer = null;
+ }
+ if (timerTask != null) {
+ timerTask = null;
+ }
+ System.out.println("时间到对码完成,退出对码、、、");
+ stopCode();
+ if (type == 0) {
+ finish();
+ }
+
+ }
+
+ public void stopCode() {
+ NativeCaller.TransferMessage(did,
+ "set_sensorstatus.cgi?cmd=3&loginuse=admin&loginpas=" + pwd
+ + "&user=admin&pwd=" + pwd, 1);
+ }
+
+ /*
+ * 设置返回空名称的传感器名称
+ */
+ private String getNullSensorName(int sensorid1, int sensorid2,
+ int sensorid3, int snesortype) {
+ String sensortype = null;
+ if (snesortype == 1) {
+ sensortype = getString(R.string.sensor_type_door);
+ }
+ else if (snesortype == 2) {
+ sensortype = getString(R.string.sensor_type_infrared);
+ }
+ else if (snesortype == 3) {
+ sensortype = getString(R.string.sensor_type_smoke);
+ }
+ else if (snesortype == 4) {
+ sensortype = getString(R.string.sensor_type_gas);
+ }
+ else if (snesortype == 7) {
+ sensortype = getString(R.string.sensor_type_remote);
+ }
+ else if (snesortype == 10) {
+ sensortype = getString(R.string.sensor_type_camera);
+ }
+ else if (snesortype == 11) {
+ sensortype = getString(R.string.sensor_type_curtain);
+ }
+ else if (snesortype == 8) {
+ sensortype = getString(R.string.sensor_type_siren);
+ }
+ String list = changeTo16(sensorid1) + changeTo16(sensorid2)
+ + changeTo16(sensorid3);
+ return sensortype + "-" + list;
+ }
+
+ public String changeTo16(int id) {
+ String b = Integer.toHexString(id).toUpperCase();
+
+ return id < 10 ? "0" + b : b;
+ }
+
+ private void setSensorName(String name, int id) {
+ Log.i("info", "list 设置默认名称id:" + id);
+ NativeCaller.TransferMessage(did, "set_sensorname.cgi?" + "&sensorid="
+ + id + "&sensorname=" + name + "&loginuse=admin&loginpas="
+ + pwd, 1);
+ }
+
+ private Handler myHandler = new Handler() {
+ public void handleMessage(android.os.Message msg) {
+ int what = msg.what;
+ String name = (String) msg.obj;
+ if (what == 1) {
+ code_imageview_type.setBackgroundResource(R.drawable.magnetic);
+ }
+ else if (what == 3) {
+ code_imageview_type.setBackgroundResource(R.drawable.somke);
+ }
+ else if (what == 4) {
+ code_imageview_type.setBackgroundResource(R.drawable.gas);
+ }
+ else if (what == 7) {
+ code_imageview_type.setBackgroundResource(R.drawable.control);
+ }
+ else if (what == 8){
+ code_imageview_type.setBackgroundResource(R.drawable.sensor_siren_icon);
+ }
+ else{
+ code_imageview_type.setBackgroundResource(R.drawable.infrared);
+ }
+
+ sensor_name_edit.setText(name);
+ sucess_code_imageview.setVisibility(View.VISIBLE);
+ cancle_layout.setVisibility(View.GONE);
+ code_sucess_layout.setVisibility(View.VISIBLE);
+ };
+ };
+
+ public int type;
+
+ @Override
+ public void CallBackReCodeMessage(String did, String name, int headcmd,
+ int selfcmd, int linkpreset, int sensortype, int sensoraction,
+ int channel, int sensorid1, int sensorid2, int sensorid3) {
+ // TODO Auto-generated method stub
+ if (sensorid1 == 0 && sensorid2 == 0 && sensorid3 == 0 || sensorid1 == 255 && sensorid2 == 255 && sensorid3 == 255)
+ {
+ return;
+ }
+ Log.i("info", "SensorStartCodeActivity:" + did);
+ System.out.println("重新对码返回---------------!" + did + ",id1" + sensorid1);
+ closeTimer(1);
+
+ Log.i("info", "对码返回数据都不为空,有有效的ID");
+
+ if (name.trim().length() == 0 || name.trim().equals("")) {
+ Log.i("info", "对码返回的名称为空值,设置为默认值");
+ name = getNullSensorName(sensorid1, sensorid2, sensorid3,
+ sensortype);
+ Log.i("info", "1---new name:" + name);
+ }
+ Message msg = new Message();
+ msg.what = sensortype;
+ msg.obj = name;
+ myHandler.sendMessage(msg);
+ id1 = sensorid1;
+ id2 = sensorid2;
+ id3 = sensorid3;
+ type = sensortype;
+
+ backdata.putExtra("linkpreset", linkpreset);
+ backdata.putExtra("sensorid1", sensorid1);
+ backdata.putExtra("sensorid2", sensorid2);
+ backdata.putExtra("sensorid3", sensorid3);
+ backdata.putExtra("sensortype", sensortype);
+ backdata.putExtra("sensorname", name);
+ backdata.putExtra("id", channel);
+
+ }
+
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/SettingActivity.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/SettingActivity.java
new file mode 100644
index 0000000..2aa1a82
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/SettingActivity.java
@@ -0,0 +1,109 @@
+package com.ipcamera.detect;
+import com.ipcamer.detect.R;
+import com.ipcamera.detect.utils.ContentCommon;
+import com.ipcamera.detect.utils.SystemValue;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.Window;
+import android.view.WindowManager;
+import android.widget.Button;
+import android.widget.RelativeLayout;
+
+
+/**
+ *
+ * @author
+ * 设备系统设置
+ */
+public class SettingActivity extends Activity implements OnClickListener
+{
+
+ private String strDID;
+ private String cameraName;
+ private String cameraPwd;
+ //控件声明
+ private RelativeLayout pwd_Relat,alarm_Relat,sd_Relat;
+ private Button back_btn;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ // TODO Auto-generated method stub
+ super.onCreate(savedInstanceState);
+ getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
+ WindowManager.LayoutParams.FLAG_FULLSCREEN);
+ requestWindowFeature(Window.FEATURE_NO_TITLE);
+ setContentView(R.layout.setting);
+ getDataFromOther();
+ initView();
+ }
+
+ //获取activity传过来的数据
+ private void getDataFromOther()
+ {
+ Intent intent = getIntent();
+ strDID = intent.getStringExtra(ContentCommon.STR_CAMERA_ID);
+ cameraName = intent.getStringExtra(ContentCommon.STR_CAMERA_NAME);
+ cameraPwd=intent.getStringExtra(ContentCommon.STR_CAMERA_PWD);
+ }
+ //初始化控件
+ private void initView()
+ {
+ pwd_Relat=(RelativeLayout) findViewById(R.id.pwd_setting);
+ alarm_Relat=(RelativeLayout) findViewById(R.id.alarm_setting);
+ sd_Relat=(RelativeLayout) findViewById(R.id.sd_setting);
+ back_btn=(Button) findViewById(R.id.back);
+
+ pwd_Relat.setOnClickListener(this);
+ alarm_Relat.setOnClickListener(this);
+ sd_Relat.setOnClickListener(this);
+ back_btn.setOnClickListener(this);
+ }
+ @Override
+ protected void onDestroy() {
+ // TODO Auto-generated method stub
+ super.onDestroy();
+
+ }
+
+ @Override
+ public void onClick(View arg0) {
+ // TODO Auto-generated method stub
+ switch (arg0.getId())
+ {
+ case R.id.pwd_setting:
+ Intent intent2 = new Intent(SettingActivity.this,SettingUserActivity.class);
+ intent2.putExtra(ContentCommon.STR_CAMERA_ID,SystemValue.deviceId);
+ intent2.putExtra(ContentCommon.STR_CAMERA_NAME,SystemValue.deviceName);
+ intent2.putExtra(ContentCommon.STR_CAMERA_PWD, SystemValue.devicePass);
+ startActivity(intent2);
+ overridePendingTransition(R.anim.in_from_right,R.anim.out_to_left);
+ break;
+ case R.id.alarm_setting:
+ Intent intent3 = new Intent(SettingActivity.this,SettingAlarmActivity.class);
+ intent3.putExtra(ContentCommon.STR_CAMERA_ID,SystemValue.deviceId);
+ intent3.putExtra(ContentCommon.STR_CAMERA_NAME,SystemValue.deviceName);
+ intent3.putExtra(ContentCommon.STR_CAMERA_PWD, SystemValue.devicePass);
+ startActivity(intent3);
+ overridePendingTransition(R.anim.in_from_right,R.anim.out_to_left);
+ break;
+ case R.id.sd_setting:
+ Intent intent5= new Intent(SettingActivity.this,SettingSDCardActivity.class);
+ intent5.putExtra(ContentCommon.STR_CAMERA_ID,SystemValue.deviceId);
+ intent5.putExtra(ContentCommon.STR_CAMERA_NAME,SystemValue.deviceName);
+ intent5.putExtra(ContentCommon.STR_CAMERA_PWD, SystemValue.devicePass);
+ startActivity(intent5);
+ overridePendingTransition(R.anim.in_from_right,R.anim.out_to_left);
+ break;
+ case R.id.back:
+ finish();
+ overridePendingTransition(R.anim.out_to_right, R.anim.in_from_left);
+ default:
+ break;
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/SettingAlarmActivity.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/SettingAlarmActivity.java
new file mode 100644
index 0000000..7ed32d3
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/SettingAlarmActivity.java
@@ -0,0 +1,435 @@
+package com.ipcamera.detect;
+import vstc2.nativecaller.NativeCaller;
+
+import com.ipcamer.detect.R;
+import com.ipcamera.detect.BridgeService.AlarmInterface;
+import com.ipcamera.detect.bean.AlermBean;
+import com.ipcamera.detect.utils.ContentCommon;
+
+import android.app.ProgressDialog;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.DialogInterface.OnKeyListener;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.Shader.TileMode;
+import android.graphics.drawable.BitmapDrawable;
+import android.os.Bundle;
+import android.os.Handler;
+import android.text.Editable;
+import android.text.TextUtils;
+import android.text.TextWatcher;
+import android.util.Log;
+import android.view.GestureDetector;
+import android.view.GestureDetector.OnGestureListener;
+import android.view.KeyEvent;
+import android.view.LayoutInflater;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.View.OnTouchListener;
+import android.view.Window;
+import android.view.WindowManager;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.CompoundButton.OnCheckedChangeListener;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.PopupWindow;
+import android.widget.ScrollView;
+import android.widget.TextView;
+
+public class SettingAlarmActivity extends BaseActivity implements
+ OnClickListener, OnCheckedChangeListener, OnGestureListener,
+ OnTouchListener, AlarmInterface {
+ // private String TAG = "SettingAlermActivity";
+ private String strDID = null;
+ private boolean successFlag = false;
+ private final int TIMEOUT = 3000;
+ private final int ALERMPARAMS = 3;
+ private final int UPLOADTIMETOOLONG = 4;
+ private int cameraType = 0;
+ private GestureDetector gt = new GestureDetector(this);
+ private Handler mHandler = new Handler() {
+ public void handleMessage(android.os.Message msg) {
+ switch (msg.what) {
+ case 0:
+ showToast(R.string.alerm_set_failed);
+ break;
+ case 1:
+ showToast(R.string.setting_aler_sucess);
+ finish();
+ break;
+ case ALERMPARAMS:
+ successFlag = true;
+ progressDialog.cancel();
+ if (0 == alermBean.getMotion_armed()) {
+ motionAlermView.setVisibility(View.GONE);
+
+ } else {
+ cbxMotionAlerm.setChecked(true);
+ motionAlermView.setVisibility(View.VISIBLE);
+ }
+ tvSensitivity.setText(String.valueOf(alermBean
+ .getMotion_sensitivity()));
+ break;
+ default:
+ break;
+ }
+ }
+ };
+
+ private Button btnOk = null;
+ private Button btnCancel = null;
+ private View motionAlermView = null;
+
+ private ImageView imgSensitiveDrop = null;
+
+ private TextView tvSensitivity = null;
+
+ private CheckBox cbxMotionAlerm = null;
+ private AlermBean alermBean = null;
+
+ private PopupWindow sensitivePopWindow = null;
+ private PopupWindow triggerLevelPopWindow = null;
+ private PopupWindow ioOutLevelPopWindow = null;
+ private PopupWindow presteMovePopWindow = null;
+ private PopupWindow audioPopWindow = null;
+
+ private ProgressDialog progressDialog = null;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ requestWindowFeature(Window.FEATURE_NO_TITLE);
+ overridePendingTransition(R.anim.in_from_right, R.anim.out_to_left);
+ getDataFromOther();
+ setContentView(R.layout.settingalarm);
+ NativeCaller.PPPPGetSystemParams(strDID,
+ ContentCommon.MSG_TYPE_GET_PARAMS);
+ progressDialog = new ProgressDialog(this);
+ progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
+ progressDialog.setMessage(getString(R.string.alerm_getparams));
+ progressDialog.show();
+ mHandler.postDelayed(runnable, TIMEOUT);
+ alermBean = new AlermBean();
+ findView();
+ setListener();
+ BridgeService.setAlarmInterface(this);
+
+ initMovePopupWindow();
+ }
+
+ @Override
+ protected void onPause() {
+ overridePendingTransition(R.anim.out_to_right, R.anim.in_from_left);
+ super.onPause();
+ }
+
+ private Runnable runnable = new Runnable() {
+
+ @Override
+ public void run() {
+ if (!successFlag) {
+ progressDialog.dismiss();
+ }
+ }
+ };
+
+ private void setListener() {
+ btnOk.setOnClickListener(this);
+ btnCancel.setOnClickListener(this);
+ imgSensitiveDrop.setOnClickListener(this);
+ cbxMotionAlerm.setOnCheckedChangeListener(this);
+ scrollView.setOnTouchListener(this);
+ progressDialog.setOnKeyListener(new OnKeyListener() {
+ @Override
+ public boolean onKey(DialogInterface dialog, int keyCode,
+ KeyEvent event) {
+
+ if (keyCode == KeyEvent.KEYCODE_BACK) {
+ return true;
+ }
+ return false;
+ }
+ });
+ }
+
+ @Override
+ public void onClick(View v) {
+ switch (v.getId()) {
+ case R.id.alerm_ok:
+ setAlerm();
+ break;
+ case R.id.alerm_cancel:
+ finish();
+ break;
+ case R.id.alerm_img_sensitive_drop://
+ dismissPopupWindow();
+ sensitivePopWindow.showAsDropDown(imgSensitiveDrop, -120, 10);
+ break;
+ case R.id.sensitive_10:
+ sensitivePopWindow.dismiss();
+ alermBean.setMotion_sensitivity(10);
+ tvSensitivity.setText(String.valueOf(10));
+ break;
+
+ case R.id.sensitive_9:
+ sensitivePopWindow.dismiss();
+ alermBean.setMotion_sensitivity(9);
+ tvSensitivity.setText(String.valueOf(9));
+ break;
+
+ case R.id.sensitive_8:
+ sensitivePopWindow.dismiss();
+ alermBean.setMotion_sensitivity(8);
+ tvSensitivity.setText(String.valueOf(8));
+ break;
+
+ case R.id.sensitive_7:
+ sensitivePopWindow.dismiss();
+ alermBean.setMotion_sensitivity(7);
+ tvSensitivity.setText(String.valueOf(7));
+ break;
+
+ case R.id.sensitive_6:
+ sensitivePopWindow.dismiss();
+ alermBean.setMotion_sensitivity(6);
+ tvSensitivity.setText(String.valueOf(6));
+ break;
+ case R.id.sensitive_5:
+ sensitivePopWindow.dismiss();
+ alermBean.setMotion_sensitivity(5);
+ tvSensitivity.setText(String.valueOf(5));
+ break;
+ case R.id.sensitive_4:
+ sensitivePopWindow.dismiss();
+ alermBean.setMotion_sensitivity(4);
+ tvSensitivity.setText(String.valueOf(4));
+ break;
+ case R.id.sensitive_3:
+ sensitivePopWindow.dismiss();
+ alermBean.setMotion_sensitivity(3);
+ tvSensitivity.setText(String.valueOf(3));
+ break;
+ case R.id.sensitive_2:
+ sensitivePopWindow.dismiss();
+ alermBean.setMotion_sensitivity(2);
+ tvSensitivity.setText(String.valueOf(2));
+ break;
+ case R.id.sensitive_1:
+ sensitivePopWindow.dismiss();
+ alermBean.setMotion_sensitivity(1);
+ tvSensitivity.setText(String.valueOf(1));
+ break;
+ default:
+ break;
+ }
+ }
+
+ private void setAlerm() {
+ if (successFlag) {
+ Log.e("setAlerm", "setAlermTemp: " + alermBean.getAlarm_temp());
+ NativeCaller.PPPPAlarmSetting(strDID, alermBean.getAlarm_audio(),
+ alermBean.getMotion_armed(),
+ alermBean.getMotion_sensitivity(),
+ alermBean.getInput_armed(), alermBean.getIoin_level(),
+ alermBean.getIoout_level(), alermBean.getIolinkage(),
+ alermBean.getAlermpresetsit(), alermBean.getMail(),
+ alermBean.getSnapshot(), alermBean.getRecord(),
+ alermBean.getUpload_interval(),
+ alermBean.getSchedule_enable(),
+ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
+ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
+ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
+ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
+ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
+ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
+ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
+ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
+ 0xFFFFFFFF,0xFFFFFFFF,-1);
+ } else {
+ showToast(R.string.alerm_set_failed);
+ }
+ }
+
+ private ScrollView scrollView;
+
+ @Override
+ public boolean onTouchEvent(MotionEvent event) {
+ return gt.onTouchEvent(event);
+ }
+
+ private void findView() {
+
+ cbxMotionAlerm = (CheckBox) findViewById(R.id.alerm_cbx_move_layout);
+
+ tvSensitivity = (TextView) findViewById(R.id.alerm_tv_sensitivity);
+
+ imgSensitiveDrop = (ImageView) findViewById(R.id.alerm_img_sensitive_drop);
+
+ motionAlermView = findViewById(R.id.alerm_moveview);
+
+ btnOk = (Button) findViewById(R.id.alerm_ok);
+ btnCancel = (Button) findViewById(R.id.alerm_cancel);
+
+ scrollView = (ScrollView) findViewById(R.id.scrollView1);
+
+ Bitmap bitmap = BitmapFactory.decodeResource(getResources(),
+ R.drawable.top_bg);
+ BitmapDrawable drawable = new BitmapDrawable(bitmap);
+ drawable.setTileModeXY(TileMode.REPEAT, TileMode.REPEAT);
+ drawable.setDither(true);
+ }
+
+ @Override
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+ switch (buttonView.getId()) {
+ case R.id.alerm_cbx_move_layout:
+ if (isChecked) {
+ alermBean.setMotion_armed(1);
+ motionAlermView.setVisibility(View.VISIBLE);
+ } else {
+ alermBean.setMotion_armed(0);
+ motionAlermView.setVisibility(View.GONE);
+ }
+ break;
+ }
+ }
+
+ private void getDataFromOther() {
+ Intent intent = getIntent();
+ strDID = intent.getStringExtra(ContentCommon.STR_CAMERA_ID);
+ cameraType = intent.getIntExtra(ContentCommon.STR_CAMERA_TYPE, 0);
+ }
+
+ @Override
+ protected void onDestroy() {
+ super.onDestroy();
+ dismissPopupWindow();
+ }
+
+ @Override
+ public boolean onDown(MotionEvent e) {
+ dismissPopupWindow();
+ return false;
+ }
+
+ @Override
+ public void onShowPress(MotionEvent e) {
+ }
+
+ @Override
+ public boolean onSingleTapUp(MotionEvent e) {
+ return false;
+ }
+
+ @Override
+ public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,
+ float distanceY) {
+ return false;
+ }
+
+ @Override
+ public void onLongPress(MotionEvent e) {
+ }
+
+ @Override
+ public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
+ float velocityY) {
+ return false;
+ }
+
+ @Override
+ public void callBackAlarmParams(String did, int alarm_audio, int motion_armed,
+ int motion_sensitivity, int input_armed, int ioin_level,
+ int iolinkage, int ioout_level, int alarmpresetsit, int mail,
+ int snapshot, int record, int upload_interval,
+ int schedule_enable, int schedule_sun_0, int schedule_sun_1,
+ int schedule_sun_2, int schedule_mon_0, int schedule_mon_1,
+ int schedule_mon_2, int schedule_tue_0, int schedule_tue_1,
+ int schedule_tue_2, int schedule_wed_0, int schedule_wed_1,
+ int schedule_wed_2, int schedule_thu_0, int schedule_thu_1,
+ int schedule_thu_2, int schedule_fri_0, int schedule_fri_1,
+ int schedule_fri_2, int schedule_sat_0, int schedule_sat_1,
+ int schedule_sat_2) {
+
+ alermBean.setDid(did);
+ alermBean.setMotion_armed(motion_armed);
+ alermBean.setMotion_sensitivity(motion_sensitivity);
+ alermBean.setInput_armed(input_armed);
+ alermBean.setIoin_level(ioin_level);
+ alermBean.setIolinkage(iolinkage);
+ alermBean.setIoout_level(ioout_level);
+ alermBean.setAlermpresetsit(alarmpresetsit);
+ alermBean.setMail(mail);
+ alermBean.setSnapshot(snapshot);
+ alermBean.setRecord(record);
+ alermBean.setUpload_interval(upload_interval);
+ alermBean.setAlarm_audio(alarm_audio);
+ alermBean.setAlarm_temp(input_armed);
+ alermBean.setSchedule_enable(schedule_enable);
+ mHandler.sendEmptyMessage(ALERMPARAMS);
+ }
+
+ @Override
+ public void callBackSetSystemParamsResult(String did, int paramType,
+ int result) {
+ mHandler.sendEmptyMessage(result);
+ }
+
+ @Override
+ public boolean onTouch(View v, MotionEvent event) {
+ dismissPopupWindow();
+ return false;
+ }
+
+ private void dismissPopupWindow() {
+ if (presteMovePopWindow != null && presteMovePopWindow.isShowing()) {
+ presteMovePopWindow.dismiss();
+ }
+ if (sensitivePopWindow != null && sensitivePopWindow.isShowing()) {
+ sensitivePopWindow.dismiss();
+ }
+ if (triggerLevelPopWindow != null && triggerLevelPopWindow.isShowing()) {
+ triggerLevelPopWindow.dismiss();
+ }
+ if (ioOutLevelPopWindow != null && ioOutLevelPopWindow.isShowing()) {
+ ioOutLevelPopWindow.dismiss();
+ }
+ if (audioPopWindow != null && audioPopWindow.isShowing()) {
+ audioPopWindow.dismiss();
+ }
+ }
+
+ private void initMovePopupWindow() {
+
+ LinearLayout layout1 = (LinearLayout) LayoutInflater.from(this)
+ .inflate(R.layout.alermsensitivepopwindow, null);
+ TextView sensitive10 = (TextView) layout1
+ .findViewById(R.id.sensitive_10);
+ TextView sensitive9 = (TextView) layout1.findViewById(R.id.sensitive_9);
+ TextView sensitive8 = (TextView) layout1.findViewById(R.id.sensitive_8);
+ TextView sensitive7 = (TextView) layout1.findViewById(R.id.sensitive_7);
+ TextView sensitive6 = (TextView) layout1.findViewById(R.id.sensitive_6);
+ TextView sensitive5 = (TextView) layout1.findViewById(R.id.sensitive_5);
+ TextView sensitive4 = (TextView) layout1.findViewById(R.id.sensitive_4);
+ TextView sensitive3 = (TextView) layout1.findViewById(R.id.sensitive_3);
+ TextView sensitive2 = (TextView) layout1.findViewById(R.id.sensitive_2);
+ TextView sensitive1 = (TextView) layout1.findViewById(R.id.sensitive_1);
+ sensitive10.setOnClickListener(this);
+ sensitive9.setOnClickListener(this);
+ sensitive8.setOnClickListener(this);
+ sensitive7.setOnClickListener(this);
+ sensitive6.setOnClickListener(this);
+ sensitive5.setOnClickListener(this);
+ sensitive4.setOnClickListener(this);
+ sensitive3.setOnClickListener(this);
+ sensitive2.setOnClickListener(this);
+ sensitive1.setOnClickListener(this);
+ sensitivePopWindow = new PopupWindow(layout1, 160,
+ WindowManager.LayoutParams.WRAP_CONTENT);
+ }
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/SettingSDCardActivity.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/SettingSDCardActivity.java
new file mode 100644
index 0000000..bcf95e9
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/SettingSDCardActivity.java
@@ -0,0 +1,1032 @@
+package com.ipcamera.detect;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.ipcamer.detect.R;
+import com.ipcamera.detect.BridgeService.AlarmInterface;
+import com.ipcamera.detect.BridgeService.CallBack_AlarmParamsInterface;
+import com.ipcamera.detect.BridgeService.SDCardInterface;
+import com.ipcamera.detect.BridgeService.TimingInterface;
+import com.ipcamera.detect.BridgeService.VideoTimingInterface;
+import com.ipcamera.detect.adapter.MoveVideoTimingAdapter;
+import com.ipcamera.detect.adapter.VideoTimingAdapter;
+import com.ipcamera.detect.bean.AlermBean;
+import com.ipcamera.detect.bean.SdcardBean;
+import com.ipcamera.detect.bean.SwitchBean;
+import com.ipcamera.detect.utils.ContentCommon;
+
+import vstc2.nativecaller.NativeCaller;
+import android.app.AlertDialog;
+import android.app.ProgressDialog;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.Shader.TileMode;
+import android.graphics.drawable.BitmapDrawable;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.util.Log;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.view.Window;
+import android.widget.AdapterView;
+import android.widget.AdapterView.OnItemClickListener;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.CompoundButton.OnCheckedChangeListener;
+import android.widget.EditText;
+import android.widget.ListAdapter;
+import android.widget.ListView;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+public class SettingSDCardActivity extends BaseActivity implements
+ OnClickListener, OnCheckedChangeListener, SDCardInterface,VideoTimingInterface,TimingInterface,CallBack_AlarmParamsInterface{
+ private TextView tvSdTotal = null;
+ private TextView tvSdRemain = null;
+ private TextView tvSdStatus = null;
+ private Button btnFormat = null;
+ private CheckBox cbxConverage = null;
+ private EditText editRecordLength = null;
+ private CheckBox cbxRecordTime = null;
+ private Button btnBack = null;
+ private Button btnOk = null;
+ private final int TIMEOUT = 3000;
+ private static String strDID = null;// camera id
+ private static String strPWD = null;// camera pwd
+ // private String cameraName = null;
+ private ProgressDialog progressDialog = null;
+ private boolean successFlag = false;// 获取和设置的结果
+ private final int FAILED = 0;
+ private final int SUCCESS = 1;
+ private final int PARAMS = 2;
+ private CheckBox iv_video_mode; //录像模式
+ private RelativeLayout rl_add_plan; //点击添加录像计划
+ private RelativeLayout rl_add_move_plan; //点击添加移动侦测录像
+ private RelativeLayout rl_plan_all; //录像模式整个布局
+ private static String cmark = "147258369"; //APP唯一标示
+ private static SwitchBean switchBean;
+ private static AlermBean alermBean;
+ /**
+ * 添加计划录像
+ */
+ private MyListView lv_video_plan; //计划录像列表
+ private VideoTimingAdapter adapter = null;
+ private Map planmap;
+ /**
+ * 移动侦测录像
+ */
+ private MyListView lv_move_plan; //移动侦测录像列表
+ private MoveVideoTimingAdapter moveAdapter = null;
+ private Map moveplanmap;
+
+ private Handler handler = new Handler() {
+ public void handleMessage(android.os.Message msg) {
+ switch (msg.what) {
+ case FAILED:
+ showToast(R.string.sdcard_set_failed);
+ break;
+ case SUCCESS:
+ showToast(R.string.sdcard_set_success);
+ finish();
+ break;
+ case PARAMS:
+ successFlag = true;
+ progressDialog.dismiss();
+ tvSdTotal.setText(sdcardBean.getSdtotal() + "MB");
+ tvSdRemain.setText(sdcardBean.getSdfree() + "MB");
+
+ if (sdcardBean.getRecord_sd_status() == 1)
+ {
+ tvSdStatus
+ .setText(SettingSDCardActivity.this.getResources()
+ .getString(R.string.sdcard_inserted));
+ }
+ else if (sdcardBean.getRecord_sd_status() == 2)
+ {
+ tvSdStatus.setText(getString(R.string.sdcard_video));
+ }
+ else if(sdcardBean.getRecord_sd_status() == 3)
+ {
+ tvSdStatus.setText(getString(R.string.sdcard_file_error));
+ }
+ else if(sdcardBean.getRecord_sd_status() == 4)
+ {
+ tvSdStatus.setText(getString(R.string.sdcard_isformatting));
+ }
+ else {
+ tvSdStatus.setText(SettingSDCardActivity.this
+ .getResources().getString(
+ R.string.sdcard_status_info));
+ }
+ cbxConverage.setChecked(true);
+ if (sdcardBean.getRecord_time_enable() == 1) {
+ cbxRecordTime.setChecked(true);
+ } else {
+ cbxRecordTime.setChecked(false);
+ }
+ // editRecordLength.setText(sdcardBean.getRecord_timer() + "");
+ editRecordLength.setText(15 + "");
+ break;
+ default:
+ break;
+ }
+
+ }
+ };
+
+// @Override
+// protected void onPause() {
+// overridePendingTransition(R.anim.out_to_right, R.anim.in_from_left);//动画
+// super.onPause();
+// }
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ getDataFromOther();
+ requestWindowFeature(Window.FEATURE_NO_TITLE);
+ setContentView(R.layout.settingsdcard);
+ progressDialog = new ProgressDialog(this);
+ progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
+ progressDialog.setMessage(getString(R.string.sdcard_getparams));
+ progressDialog.show();
+ sdcardBean = new SdcardBean();
+ switchBean = new SwitchBean();
+ alermBean = new AlermBean();
+ handler.postDelayed(runnable, TIMEOUT);
+ findView();
+ setLister();
+ BridgeService.setSDCardInterface(this);
+ BridgeService.setVideoTimingInterface(this);
+ BridgeService.setTimingInterface(this);
+ BridgeService.setCallBack_AlarmParamsInterface(this);
+ waitHandler.sendEmptyMessageDelayed(3, 100);
+ waitHandler.sendEmptyMessageDelayed(1, 100);
+ waitHandler.sendEmptyMessageDelayed(2, 100);
+ waitHandler.sendEmptyMessageDelayed(4, 100);
+ }
+
+ private void getDataFromOther() {
+ Intent intent = getIntent();
+ strDID = intent.getStringExtra(ContentCommon.STR_CAMERA_ID);
+ strPWD = intent.getStringExtra(ContentCommon.STR_CAMERA_PWD);
+ Log.i("info", "did:" + strDID);
+ // cameraName = intent.getStringExtra(ContentCommon.STR_CAMERA_NAME);
+ }
+
+ private Runnable runnable = new Runnable() {
+
+ @Override
+ public void run() {
+ if (!successFlag) {
+ successFlag = false;
+ progressDialog.dismiss();
+ }
+ }
+ };
+ private SdcardBean sdcardBean;
+
+ private void setLister() {
+ btnBack.setOnClickListener(this);
+ btnOk.setOnClickListener(this);
+ btnFormat.setOnClickListener(this);
+ rl_add_plan.setOnClickListener(this);
+ rl_add_move_plan.setOnClickListener(this);
+ cbxConverage.setOnCheckedChangeListener(this);
+ cbxRecordTime.setOnCheckedChangeListener(this);
+ iv_video_mode.setOnCheckedChangeListener(this);
+
+ }
+
+ private void findView() {
+ tvSdTotal = (TextView) findViewById(R.id.tv_sd_total);
+ tvSdRemain = (TextView) findViewById(R.id.tv_sd_remain);
+ tvSdStatus = (TextView) findViewById(R.id.tv_state);
+ btnFormat = (Button) findViewById(R.id.btn_format);
+ cbxConverage = (CheckBox) findViewById(R.id.cbx_coverage);
+ editRecordLength = (EditText) findViewById(R.id.edit_record_length);
+ cbxRecordTime = (CheckBox) findViewById(R.id.cbx_record_time);
+ btnBack = (Button) findViewById(R.id.back);
+ btnOk = (Button) findViewById(R.id.ok);
+
+ RelativeLayout layout = (RelativeLayout) findViewById(R.id.top);
+ Bitmap bitmap = BitmapFactory.decodeResource(getResources(),
+ R.drawable.top_bg);
+ BitmapDrawable drawable = new BitmapDrawable(bitmap);
+ drawable.setTileModeXY(TileMode.REPEAT, TileMode.REPEAT);
+ drawable.setDither(true);
+ layout.setBackgroundDrawable(drawable);
+ iv_video_mode = (CheckBox) findViewById(R.id.iv_video_mode);
+ rl_add_plan = (RelativeLayout) findViewById(R.id.rl_add_plan);
+ rl_add_move_plan = (RelativeLayout) findViewById(R.id.rl_add_move_plan);
+ rl_plan_all = (RelativeLayout) findViewById(R.id.rl_plan_all);
+
+ lv_video_plan = (MyListView) findViewById(R.id.lv_video_plan);
+ lv_move_plan = (MyListView) findViewById(R.id.lv_move_plan);
+ //计划录像
+ adapter = new VideoTimingAdapter(SettingSDCardActivity.this);
+ lv_video_plan.setAdapter(adapter);
+ planmap = new HashMap();
+ lv_video_plan.setOnItemClickListener(new OnItemClickListener(){
+
+ @Override
+ public void onItemClick(AdapterView> arg0, View arg1, int position,
+ long id) {
+ // TODO Auto-generated method stub
+ Map item = adapter.sdtiming.get(position);
+ int itemplan = item.entrySet().iterator().next().getValue();
+ int itemplanKey = item.entrySet().iterator().next().getKey();
+ Intent it = new Intent(SettingSDCardActivity.this,
+ SCameraSetSDTiming.class);
+ it.putExtra("type", 1);
+ it.putExtra("value", itemplan);
+ it.putExtra("key", itemplanKey);
+ startActivityForResult(it, 1);
+ }
+
+ });
+ //移动侦测录像
+ moveAdapter = new MoveVideoTimingAdapter(SettingSDCardActivity.this);
+ lv_move_plan.setAdapter(moveAdapter);
+ moveplanmap = new HashMap(); //移动侦测录像
+ lv_move_plan.setOnItemClickListener(new OnItemClickListener(){
+
+ @Override
+ public void onItemClick(AdapterView> arg0, View arg1, int position,
+ long id) {
+ // TODO Auto-generated method stub
+ Map moveitem = moveAdapter.movevideotiming.get(position);
+ int moveitemplan = moveitem.entrySet().iterator().next().getValue();
+ int moveitemplanKey = moveitem.entrySet().iterator().next().getKey();
+ Intent itent = new Intent(SettingSDCardActivity.this,
+ SCameraSetPlanVideoTiming.class);
+ itent.putExtra("type", 1);
+ itent.putExtra("value", moveitemplan);
+ itent.putExtra("key", moveitemplanKey);
+ startActivityForResult(itent, 1);
+ }
+
+ });
+
+
+ }
+
+ private static Handler waitHandler = new Handler() {
+
+ public void handleMessage(android.os.Message msg) {
+
+ switch (msg.what) {
+ case 1:
+
+ NativeCaller.TransferMessage(strDID,
+ "trans_cmd_string.cgi?cmd=2017&command=11&mark="+cmark+"&type=3&loginuse="
+ + "admin" + "&loginpas=" + strPWD, 1);
+
+ break;
+ case 2:
+ NativeCaller.TransferMessage(strDID,
+ "trans_cmd_string.cgi?cmd=2017&command=11&mark="+cmark+"&type=1&loginuse="
+ + "admin" + "&loginpas=" + strPWD, 1);
+ break;
+ case 3:
+ NativeCaller.PPPPGetSystemParams(strDID,
+ ContentCommon.MSG_TYPE_GET_RECORD);
+ break;
+ case 4:
+ NativeCaller.PPPPGetSystemParams(strDID, ContentCommon.MSG_TYPE_GET_PARAMS);
+ break;
+ default:
+ break;
+ }
+ }
+ };
+
+ @Override
+ public void onClick(View v) {
+ switch (v.getId()) {
+ case R.id.back:
+ finish();
+ break;
+ case R.id.ok:
+ setSDCardSchedule();
+ break;
+ case R.id.btn_format:
+ showFormatDialog();
+ break;
+ case R.id.rl_add_plan: //计划录像
+ Intent it = new Intent(SettingSDCardActivity.this,
+ SCameraSetSDTiming.class);
+ it.putExtra("type", 0);
+ startActivityForResult(it, 0);
+ overridePendingTransition(R.anim.in_from_right,R.anim.out_to_left);
+ break;
+ case R.id.rl_add_move_plan: //移动侦测计划
+ Intent intent = new Intent(SettingSDCardActivity.this,SCameraSetPlanVideoTiming.class);
+ intent.putExtra("type", 0);
+ startActivityForResult(intent, 0);
+ overridePendingTransition(R.anim.in_from_right,R.anim.out_to_left);
+ break;
+ default:
+ break;
+ }
+ }
+
+ void showFormatDialog() {
+ AlertDialog.Builder adb = new AlertDialog.Builder(this);
+ adb.setMessage(R.string.sdcard_formatsd);
+ adb.setPositiveButton(R.string.str_ok,
+ new DialogInterface.OnClickListener() {
+
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ // TODO Auto-generated method stub
+ Log.i("info", "格式化");
+ NativeCaller.FormatSD(strDID);
+ dialog.dismiss();
+ }
+
+ })
+ .setNegativeButton(R.string.str_cancel,
+ new DialogInterface.OnClickListener() {
+
+ @Override
+ public void onClick(DialogInterface dialog,
+ int which) {
+ // TODO Auto-generated method stub
+ dialog.dismiss();
+ }
+ }).create().show();
+ }
+
+ // 20140226修改测试
+
+ private void setSDCardSchedule() {
+
+ if (sdcardBean.getRecord_time_enable() == 0) {
+ sdcardBean.setSun_0(0);
+ sdcardBean.setSun_1(0);
+ sdcardBean.setSun_2(0);
+ sdcardBean.setMon_0(0);
+ sdcardBean.setMon_1(0);
+ sdcardBean.setMon_2(0);
+ sdcardBean.setTue_0(0);
+ sdcardBean.setTue_1(0);
+ sdcardBean.setTue_2(0);
+ sdcardBean.setWed_0(0);
+ sdcardBean.setWed_1(0);
+ sdcardBean.setWed_2(0);
+ sdcardBean.setThu_0(0);
+ sdcardBean.setThu_1(0);
+ sdcardBean.setThu_2(0);
+ sdcardBean.setFri_0(0);
+ sdcardBean.setFri_1(0);
+ sdcardBean.setFri_2(0);
+ sdcardBean.setSat_0(0);
+ sdcardBean.setSat_1(0);
+ sdcardBean.setSat_2(0);
+ } else {
+ sdcardBean.setSun_0(-1);
+ sdcardBean.setSun_1(-1);
+ sdcardBean.setSun_2(-1);
+ sdcardBean.setMon_0(-1);
+ sdcardBean.setMon_1(-1);
+ sdcardBean.setMon_2(-1);
+ sdcardBean.setTue_0(-1);
+ sdcardBean.setTue_1(-1);
+ sdcardBean.setTue_2(-1);
+ sdcardBean.setWed_0(-1);
+ sdcardBean.setWed_1(-1);
+ sdcardBean.setWed_2(-1);
+ sdcardBean.setThu_0(-1);
+ sdcardBean.setThu_1(-1);
+ sdcardBean.setThu_2(-1);
+ sdcardBean.setFri_0(-1);
+ sdcardBean.setFri_1(-1);
+ sdcardBean.setFri_2(-1);
+ sdcardBean.setSat_0(-1);
+ sdcardBean.setSat_1(-1);
+ sdcardBean.setSat_2(-1);
+ }
+
+ sdcardBean.setRecord_timer(15);
+ NativeCaller.PPPPSDRecordSetting(strDID,
+ sdcardBean.getRecord_conver_enable(),
+ sdcardBean.getRecord_timer(), sdcardBean.getRecord_size(),sdcardBean.getRecord_chnl(),
+ sdcardBean.getRecord_time_enable(), sdcardBean.getSun_0(),
+ sdcardBean.getSun_1(), sdcardBean.getSun_2(),
+ sdcardBean.getMon_0(), sdcardBean.getMon_1(),
+ sdcardBean.getMon_2(), sdcardBean.getTue_0(),
+ sdcardBean.getTue_1(), sdcardBean.getTue_2(),
+ sdcardBean.getWed_0(), sdcardBean.getWed_1(),
+ sdcardBean.getWed_2(), sdcardBean.getThu_0(),
+ sdcardBean.getThu_1(), sdcardBean.getThu_2(),
+ sdcardBean.getFri_0(), sdcardBean.getFri_1(),
+ sdcardBean.getFri_2(), sdcardBean.getSat_0(),
+ sdcardBean.getSat_1(), sdcardBean.getSat_2(),sdcardBean.getEnable_audio());
+
+ }
+
+ @Override
+ protected void onDestroy() {
+ super.onDestroy();
+ }
+
+ @Override
+ public void onCheckedChanged(CompoundButton v, boolean isChecked) {
+ switch (v.getId()) {
+ // case R.id.cbx_coverage:
+ // if (isChecked) {
+ // sdcardBean.setRecord_conver_enable(1);
+ // } else {
+ // sdcardBean.setRecord_conver_enable(0);
+ // }
+ // break;
+ case R.id.cbx_record_time:
+ if (isChecked) {
+ sdcardBean.setRecord_time_enable(1);
+ } else {
+ sdcardBean.setRecord_time_enable(0);
+ }
+ break;
+ case R.id.iv_video_mode:
+ if(isChecked){
+ rl_plan_all.setVisibility(View.VISIBLE);
+ }else{
+ rl_plan_all.setVisibility(View.GONE);
+ }
+ break;
+ default:
+ break;
+ }
+
+ }
+
+ @Override
+ public void callBackRecordSchParams(String did, int record_cover_enable,
+ int record_timer, int record_size, int record_time_enable,
+ int record_schedule_sun_0, int record_schedule_sun_1,
+ int record_schedule_sun_2, int record_schedule_mon_0,
+ int record_schedule_mon_1, int record_schedule_mon_2,
+ int record_schedule_tue_0, int record_schedule_tue_1,
+ int record_schedule_tue_2, int record_schedule_wed_0,
+ int record_schedule_wed_1, int record_schedule_wed_2,
+ int record_schedule_thu_0, int record_schedule_thu_1,
+ int record_schedule_thu_2, int record_schedule_fri_0,
+ int record_schedule_fri_1, int record_schedule_fri_2,
+ int record_schedule_sat_0, int record_schedule_sat_1,
+ int record_schedule_sat_2, int record_sd_status, int sdtotal,
+ int sdfree,int enable_audio) {
+ Log.i("info", "---record_cover_enable" + record_cover_enable
+ + "---record_time_enable" + record_time_enable
+ + "---record_timer" + record_timer);
+ Log.i("info", "record_schedule_sun_0:" + record_schedule_sun_0
+ + ",record_schedule_sun_1:" + record_schedule_sun_1
+ + ",record_schedule_sun_2:" + record_schedule_sun_2
+ + ",record_schedule_mon_0:" + record_schedule_mon_0
+ + ",record_schedule_mon_1:" + record_schedule_mon_1
+ + ",record_schedule_mon_2:" + record_schedule_mon_2);
+ sdcardBean.setDid(did);
+ sdcardBean.setRecord_conver_enable(record_cover_enable);
+ sdcardBean.setRecord_timer(record_timer);
+ sdcardBean.setRecord_size(record_size);
+ sdcardBean.setRecord_time_enable(record_time_enable);
+ sdcardBean.setRecord_sd_status(record_sd_status);
+ sdcardBean.setSdtotal(sdtotal);
+ sdcardBean.setSdfree(sdfree);
+ sdcardBean.setSun_0(record_schedule_sun_0);
+ sdcardBean.setSun_1(record_schedule_sun_1);
+ sdcardBean.setSun_2(record_schedule_sun_2);
+ sdcardBean.setMon_0(record_schedule_mon_0);
+ sdcardBean.setMon_1(record_schedule_mon_1);
+ sdcardBean.setMon_2(record_schedule_mon_2);
+ sdcardBean.setTue_0(record_schedule_tue_0);
+ sdcardBean.setTue_1(record_schedule_tue_1);
+ sdcardBean.setTue_2(record_schedule_tue_2);
+ sdcardBean.setWed_0(record_schedule_wed_0);
+ sdcardBean.setWed_1(record_schedule_wed_1);
+ sdcardBean.setWed_2(record_schedule_wed_2);
+ sdcardBean.setThu_0(record_schedule_thu_0);
+ sdcardBean.setThu_1(record_schedule_thu_1);
+ sdcardBean.setThu_2(record_schedule_thu_2);
+ sdcardBean.setFri_0(record_schedule_fri_0);
+ sdcardBean.setFri_1(record_schedule_fri_1);
+ sdcardBean.setFri_2(record_schedule_fri_2);
+ sdcardBean.setSat_0(record_schedule_sat_0);
+ sdcardBean.setSat_1(record_schedule_sat_1);
+ sdcardBean.setSat_2(record_schedule_sat_2);
+ sdcardBean.setEnable_audio(enable_audio);
+ handler.sendEmptyMessage(PARAMS);
+ }
+
+ @Override
+ public void callBackSetSystemParamsResult(String did, int paramType,
+ int result) {
+ Log.d("tag", "result:" + result + " paramType:" + paramType);
+ if (strDID.equals(did)) {
+ handler.sendEmptyMessage(result);
+ }
+ }
+
+
+
+ @Override
+ public void onActivityResult(int requestCode, int resultCode, Intent data) {
+ // TODO Auto-generated method stub
+ if (resultCode == 2015) {
+ int time = data.getIntExtra("jnitime", 1);
+ Message msg = new Message();
+ msg.what = 0;
+ msg.arg1 = time;
+ upHandler.sendMessage(msg);
+ }
+ if (resultCode == 2016) {
+ int time = data.getIntExtra("jnitime", 1);
+ int key = data.getIntExtra("key", -1);
+ if (key == -1)
+ return;
+ Message msg = new Message();
+ msg.what = 1;
+ msg.arg1 = time;
+ msg.arg2 = key;
+ upHandler.sendMessage(msg);
+
+ }
+ if(resultCode==2017){
+ int key = data.getIntExtra("key", -1);
+ if(key==-1)
+ return;
+ Message msg = new Message();
+ msg.what = 1;
+ msg.arg1 = key;
+ deleteHandler.sendMessage(msg);
+ }
+ if (resultCode == 2018) {
+ int time = data.getIntExtra("jnitime", 1);
+ Message msg = new Message();
+ msg.what = 0;
+ msg.arg1 = time;
+ moveHandler.sendMessage(msg);
+ }
+ if (resultCode == 2019) {
+ int time = data.getIntExtra("jnitime", 1);
+ int key = data.getIntExtra("key", -1);
+ if (key == -1)
+ return;
+ Message msg = new Message();
+ msg.what = 1;
+ msg.arg1 = time;
+ msg.arg2 = key;
+ moveHandler.sendMessage(msg);
+
+ }
+ if(resultCode==2020){
+ int key = data.getIntExtra("key", -1);
+ if(key==-1)
+ return;
+ Message msg = new Message();
+ msg.what = 2;
+ msg.arg1 = key;
+ deleteHandler.sendMessage(msg);
+ }
+ }
+ //计划录像
+ private Handler upHandler = new Handler() {
+ public void handleMessage(android.os.Message msg) {
+ int what = msg.what;
+ int time = msg.arg1;
+ switch (what) {
+ case 0:
+ for (int i = 1; i < 22; i++) {
+ int value = planmap.get(i);
+
+ if (value == -1 || value == 0) {
+ planmap.put(i, time);
+ adapter.addPlan(i, time);
+ break;
+ }
+ }
+
+ adapter.notifyDataSetChanged();
+ setAlarmHandler.sendEmptyMessage(1);
+ break;
+ case 1:
+ int key = msg.arg2;
+ planmap.put(key, time);
+ adapter.notify(key, time);
+ adapter.notifyDataSetChanged();
+ setAlarmHandler.sendEmptyMessage(1);
+ break;
+
+ default:
+ break;
+ }
+
+ };
+ };
+ //移动侦测录像
+ private Handler moveHandler = new Handler() {
+ public void handleMessage(android.os.Message msg) {
+ int what = msg.what;
+ int time = msg.arg1;
+ switch (what) {
+ case 0:
+ for (int i = 1; i < 22; i++) {
+ int value = moveplanmap.get(i);
+
+ if (value == -1 || value == 0) {
+ moveplanmap.put(i, time);
+ moveAdapter.addPlan(i, time);
+ break;
+ }
+ }
+
+ moveAdapter.notifyDataSetChanged();
+
+ setAlarmHandler.sendEmptyMessage(2);
+ break;
+ case 1:
+ int key = msg.arg2;
+ moveplanmap.put(key, time);
+ moveAdapter.notify(key, time);
+ moveAdapter.notifyDataSetChanged();
+ setAlarmHandler.sendEmptyMessage(2);
+ break;
+
+ default:
+ break;
+ }
+
+ };
+ };
+ /**
+ * 删除计划
+ */
+ private Handler deleteHandler = new Handler() {
+ public void handleMessage(Message msg) {
+ switch (msg.what) {
+ case 1:
+ int key = msg.arg1;
+ adapter.removePlan(key);
+ planmap.put(key, -1);
+ adapter.notifyDataSetChanged();
+ setAlarmHandler.sendEmptyMessage(1);
+ break;
+ case 2:
+ int movekey = msg.arg1;
+ moveAdapter.removePlan(movekey);
+ moveplanmap.put(movekey, -1);
+ moveAdapter.notifyDataSetChanged();
+ setAlarmHandler.sendEmptyMessage(2);
+ break;
+ default:
+ break;
+ }
+ };
+ };
+ private Handler setAlarmHandler=new Handler(){
+ public void handleMessage(Message msg) {
+ switch (msg.what) {
+ case 1:
+ setTiming(strDID , strPWD);
+ break;
+ case 2:
+ setMoveTiming(strDID , strPWD);
+ break;
+ default:
+ break;
+ }
+ };
+ };
+
+ //设置计划录像
+ private void setTiming(String udid, String pwd ) {
+ NativeCaller
+ .TransferMessage(udid,
+ "trans_cmd_string.cgi?cmd=2017&command=3&mark="+cmark+"&record_plan1="
+ + planmap.get(1) + "&record_plan2="+ planmap.get(2) + "&record_plan3="
+ + planmap.get(3) + "&record_plan4="+ planmap.get(4) + "&record_plan5="
+ + planmap.get(5) + "&record_plan6="+ planmap.get(6) + "&record_plan7="
+ + planmap.get(7) + "&record_plan8="+ planmap.get(8) + "&record_plan9="
+ + planmap.get(9) + "&record_plan10="+ planmap.get(10) + "&record_plan11="
+ + planmap.get(11) + "&record_plan12="+ planmap.get(12) + "&record_plan13="
+ + planmap.get(13) + "&record_plan14="+ planmap.get(14) + "&record_plan15="
+ + planmap.get(15) + "&record_plan16="+ planmap.get(16) + "&record_plan17="
+ + planmap.get(17) + "&record_plan18="+ planmap.get(18) + "&record_plan19="
+ + planmap.get(19) + "&record_plan20="+ planmap.get(20) + "&record_plan21="
+ + planmap.get(21) + "&record_plan_enable="+ switchBean.getRecord_plan_enable()+"&loginuse=" + "admin" + "&loginpas="
+ + pwd, -1);
+ }
+ //设置移动侦测录像
+ private void setMoveTiming(String udid, String pwd ) {
+ NativeCaller
+ .TransferMessage(udid,
+ "trans_cmd_string.cgi?cmd=2017&command=1&mark="+cmark+"&motion_record_plan1="
+ + moveplanmap.get(1) + "&motion_record_plan2="+ moveplanmap.get(2) + "&motion_record_plan3="
+ + moveplanmap.get(3) + "&motion_record_plan4="+ moveplanmap.get(4) + "&motion_record_plan5="
+ + moveplanmap.get(5) + "&motion_record_plan6="+ moveplanmap.get(6) + "&motion_record_plan7="
+ + moveplanmap.get(7) + "&motion_record_plan8="+ moveplanmap.get(8) + "&motion_record_plan9="
+ + moveplanmap.get(9) + "&motion_record_plan10="+ moveplanmap.get(10) + "&motion_record_plan11="
+ + moveplanmap.get(11) + "&motion_record_plan12="+ moveplanmap.get(12) + "&motion_record_plan13="
+ + moveplanmap.get(13) + "&motion_record_plan14="+ moveplanmap.get(14) + "&motion_record_plan15="
+ + moveplanmap.get(15) + "&motion_record_plan16="+ moveplanmap.get(16) + "&motion_record_plan17="
+ + moveplanmap.get(17) + "&motion_record_plan18="+ moveplanmap.get(18) + "&motion_record_plan19="
+ + moveplanmap.get(19) + "&motion_record_plan20="+ moveplanmap.get(20) + "&motion_record_plan21="
+ + moveplanmap.get(21) + "&motion_record_plan_enable="+ switchBean.getMotion_record_plan_enable()+
+ "&loginuse=" + "admin" + "&loginpas="
+ + pwd, -1);
+ }
+ @Override
+ public void TimingCallback(String did, String command, String mask,
+ String record_plan1, String record_plan2, String record_plan3,
+ String record_plan4, String record_plan5, String record_plan6,
+ String record_plan7, String record_plan8, String record_plan9,
+ String record_plan10, String record_plan11, String record_plan12,
+ String record_plan13, String record_plan14, String record_plan15,
+ String record_plan16, String record_plan17, String record_plan18,
+ String record_plan19, String record_plan20, String record_plan21,
+ String record_plan_enable) {
+ // TODO Auto-generated method stub
+ if(did.contains(strDID) ){
+ if(mask.contains(cmark)){
+
+ planmap.put(1, Integer.valueOf(record_plan1));
+ planmap.put(2, Integer.valueOf(record_plan2));
+ planmap.put(3, Integer.valueOf(record_plan3));
+ planmap.put(4, Integer.valueOf(record_plan4));
+ planmap.put(5, Integer.valueOf(record_plan5));
+ planmap.put(6, Integer.valueOf(record_plan6));
+ planmap.put(7, Integer.valueOf(record_plan7));
+ planmap.put(8, Integer.valueOf(record_plan8));
+ planmap.put(9, Integer.valueOf(record_plan9));
+ planmap.put(10, Integer.valueOf(record_plan10));
+ planmap.put(11, Integer.valueOf(record_plan11));
+ planmap.put(12, Integer.valueOf(record_plan12));
+ planmap.put(13, Integer.valueOf(record_plan13));
+ planmap.put(14, Integer.valueOf(record_plan14));
+ planmap.put(15, Integer.valueOf(record_plan15));
+ planmap.put(16, Integer.valueOf(record_plan16));
+ planmap.put(17, Integer.valueOf(record_plan17));
+ planmap.put(18, Integer.valueOf(record_plan18));
+ planmap.put(19, Integer.valueOf(record_plan19));
+ planmap.put(20, Integer.valueOf(record_plan20));
+ planmap.put(21, Integer.valueOf(record_plan21));
+ switchBean.setRecord_plan_enable(record_plan_enable);
+ callbackHandler.sendEmptyMessage(1);
+ }
+ }
+ }
+
+ @Override
+ public void VideoTimingCallback(String did, String command, String mask,
+ String motion_record_plan1, String motion_record_plan2,
+ String motion_record_plan3, String motion_record_plan4,
+ String motion_record_plan5, String motion_record_plan6,
+ String motion_record_plan7, String motion_record_plan8,
+ String motion_record_plan9, String motion_record_plan10,
+ String motion_record_plan11, String motion_record_plan12,
+ String motion_record_plan13, String motion_record_plan14,
+ String motion_record_plan15, String motion_record_plan16,
+ String motion_record_plan17, String motion_record_plan18,
+ String motion_record_plan19, String motion_record_plan20,
+ String motion_record_plan21, String motion_record_enable) {
+ // TODO Auto-generated method stub
+ if(did.contains(strDID) ){
+ if(mask.contains(cmark)){
+ moveplanmap.put(1, Integer.valueOf(motion_record_plan1));
+ moveplanmap.put(2, Integer.valueOf(motion_record_plan2));
+ moveplanmap.put(3, Integer.valueOf(motion_record_plan3));
+ moveplanmap.put(4, Integer.valueOf(motion_record_plan4));
+ moveplanmap.put(5, Integer.valueOf(motion_record_plan5));
+ moveplanmap.put(6, Integer.valueOf(motion_record_plan6));
+ moveplanmap.put(7, Integer.valueOf(motion_record_plan7));
+ moveplanmap.put(8, Integer.valueOf(motion_record_plan8));
+ moveplanmap.put(9, Integer.valueOf(motion_record_plan9));
+ moveplanmap.put(10, Integer.valueOf(motion_record_plan10));
+ moveplanmap.put(11, Integer.valueOf(motion_record_plan11));
+ moveplanmap.put(12, Integer.valueOf(motion_record_plan12));
+ moveplanmap.put(13, Integer.valueOf(motion_record_plan13));
+ moveplanmap.put(14, Integer.valueOf(motion_record_plan14));
+ moveplanmap.put(15, Integer.valueOf(motion_record_plan15));
+ moveplanmap.put(16, Integer.valueOf(motion_record_plan16));
+ moveplanmap.put(17, Integer.valueOf(motion_record_plan17));
+ moveplanmap.put(18, Integer.valueOf(motion_record_plan18));
+ moveplanmap.put(19, Integer.valueOf(motion_record_plan19));
+ moveplanmap.put(20, Integer.valueOf(motion_record_plan20));
+ moveplanmap.put(21, Integer.valueOf(motion_record_plan21));
+ switchBean.setMotion_record_plan_enable(motion_record_enable);
+ callbackHandler.sendEmptyMessage(2);
+ }
+ }
+ }
+
+ private Handler callbackHandler = new Handler() {
+ public void handleMessage(android.os.Message msg) {
+ switch (msg.what) {
+ case 1:
+ for (int i = 1; i < 22; i++) {
+ int plan = planmap.get(i);
+ if (plan != 0 && plan != -1) {
+ adapter.addPlan(i, plan);
+ adapter.notifyDataSetChanged();
+ }
+ }
+ break;
+ case 2:
+ for (int i = 1; i < 22; i++) {
+ int plan = moveplanmap.get(i);
+ if (plan != 0 && plan != -1) {
+ moveAdapter.addPlan(i, plan);
+ moveAdapter.notifyDataSetChanged();
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ };
+ };
+
+ //打开移动侦测布防
+ private static void setSDLing() {
+ NativeCaller.PPPPAlarmSetting(strDID, alermBean.getAlarm_audio(),
+ 1,
+ alermBean.getMotion_sensitivity(),
+ alermBean.getInput_armed(), alermBean.getIoin_level(),
+ alermBean.getIoout_level(), alermBean.getIolinkage(),
+ alermBean.getAlermpresetsit(), alermBean.getMail(),
+ alermBean.getSnapshot(),1,
+ alermBean.getUpload_interval(),
+ alermBean.getSchedule_enable(),
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+
+ alermBean.getDefense_plan1(),
+ alermBean.getDefense_plan2(),
+ alermBean.getDefense_plan3(),
+ alermBean.getDefense_plan4(),
+ alermBean.getDefense_plan5(),
+ alermBean.getDefense_plan6(),
+ alermBean.getDefense_plan7(),
+ alermBean.getDefense_plan8(),
+ alermBean.getDefense_plan9(),
+ alermBean.getDefense_plan10(),
+ alermBean.getDefense_plan11(),
+ alermBean.getDefense_plan12(),
+ alermBean.getDefense_plan13(),
+ alermBean.getDefense_plan14(),
+ alermBean.getDefense_plan15(),
+ alermBean.getDefense_plan16(),
+ alermBean.getDefense_plan17(),
+ alermBean.getDefense_plan18(),
+ alermBean.getDefense_plan19(),
+ alermBean.getDefense_plan20(),
+ alermBean.getDefense_plan21(),-1
+ );
+
+
+ }
+
+
+
+ private Handler mHandler = new Handler() {
+ public void handleMessage(android.os.Message msg) {
+ switch (msg.what) {
+
+ case 0:// 设置失败
+ Toast.makeText(SettingSDCardActivity.this, R.string.alerm_set_failed, Toast.LENGTH_LONG)
+ .show();
+ break;
+ case 1:// 设置成功
+ // showToast(R.string.alerm_set)
+ //finish();
+ break;
+ case 2:// 回调成功
+ Log.e("2222alermBean.getMotion_armed()", "************"+alermBean.getMotion_armed());
+ if (alermBean.getMotion_armed() == 0) {// 移动侦测布防0-不布防,1-布防
+ setSDLing();
+ }
+
+ break;
+ case 4:
+ // editUploadPicInterval.setText("");
+ break;
+
+ default:
+ break;
+ }
+ }
+ };
+
+ @Override
+ public void CallBack_AlarmParams(String did, int alarm_audio,
+ int motion_armed, int motion_sensitivity, int input_armed,
+ int ioin_level, int iolinkage, int ioout_level, int alarmpresetsit,
+ int mail, int snapshot, int record, int upload_interval,
+ int schedule_enable, int schedule_sun_0, int schedule_sun_1,
+ int schedule_sun_2, int schedule_mon_0, int schedule_mon_1,
+ int schedule_mon_2, int schedule_tue_0, int schedule_tue_1,
+ int schedule_tue_2, int schedule_wed_0, int schedule_wed_1,
+ int schedule_wed_2, int schedule_thu_0, int schedule_thu_1,
+ int schedule_thu_2, int schedule_fri_0, int schedule_fri_1,
+ int schedule_fri_2, int schedule_sat_0, int schedule_sat_1,
+ int schedule_sat_2, int defense_plan1, int defense_plan2,
+ int defense_plan3, int defense_plan4, int defense_plan5,
+ int defense_plan6, int defense_plan7, int defense_plan8,
+ int defense_plan9, int defense_plan10, int defense_plan11,
+ int defense_plan12, int defense_plan13, int defense_plan14,
+ int defense_plan15, int defense_plan16, int defense_plan17,
+ int defense_plan18, int defense_plan19, int defense_plan20,
+ int defense_plan21) {
+ // TODO Auto-generated method stub
+ if (strDID.equals(did)) {
+ alermBean.setDid(did);
+ alermBean.setAlarm_audio(alarm_audio);
+ alermBean.setMotion_armed(motion_armed);
+ alermBean.setMotion_sensitivity(motion_sensitivity);
+ alermBean.setInput_armed(input_armed);
+ alermBean.setIoin_level(ioin_level);
+ alermBean.setIolinkage(iolinkage);
+ alermBean.setIoout_level(ioout_level);
+ alermBean.setAlermpresetsit(alarmpresetsit);
+ alermBean.setMail(mail);
+ alermBean.setSnapshot(snapshot);
+ alermBean.setRecord(record);
+ alermBean.setUpload_interval(upload_interval);
+ alermBean.setSchedule_enable(1);
+
+ alermBean.setSchedule_sun_0(schedule_sun_0);
+ alermBean.setSchedule_sun_1(schedule_sun_1);
+ alermBean.setSchedule_sun_2(schedule_sun_2);
+ alermBean.setSchedule_mon_0(schedule_mon_0);
+ alermBean.setSchedule_mon_1(schedule_mon_1);
+ alermBean.setSchedule_mon_2(schedule_mon_2);
+ alermBean.setSchedule_tue_0(schedule_tue_0);
+ alermBean.setSchedule_tue_1(schedule_tue_1);
+ alermBean.setSchedule_tue_2(schedule_tue_2);
+ alermBean.setSchedule_wed_0(schedule_wed_0);
+ alermBean.setSchedule_wed_1(schedule_wed_1);
+ alermBean.setSchedule_wed_2(schedule_wed_2);
+ alermBean.setSchedule_thu_0(schedule_thu_0);
+ alermBean.setSchedule_thu_1(schedule_thu_1);
+ alermBean.setSchedule_thu_2(schedule_thu_2);
+ alermBean.setSchedule_fri_0(schedule_fri_0);
+ alermBean.setSchedule_fri_1(schedule_fri_1);
+ alermBean.setSchedule_fri_2(schedule_fri_2);
+ alermBean.setSchedule_sat_0(schedule_sat_0);
+ alermBean.setSchedule_sat_1(schedule_sat_1);
+ alermBean.setSchedule_sat_2(schedule_sat_2);
+
+ alermBean.setDefense_plan1(defense_plan1);
+ alermBean.setDefense_plan2(defense_plan2);
+ alermBean.setDefense_plan3(defense_plan3);
+ alermBean.setDefense_plan4(defense_plan4);
+ alermBean.setDefense_plan5(defense_plan5);
+ alermBean.setDefense_plan6(defense_plan6);
+ alermBean.setDefense_plan7(defense_plan7);
+ alermBean.setDefense_plan8(defense_plan8);
+ alermBean.setDefense_plan9(defense_plan9);
+ alermBean.setDefense_plan10(defense_plan10);
+ alermBean.setDefense_plan11(defense_plan11);
+ alermBean.setDefense_plan12(defense_plan12);
+ alermBean.setDefense_plan13(defense_plan13);
+ alermBean.setDefense_plan14(defense_plan14);
+ alermBean.setDefense_plan15(defense_plan15);
+ alermBean.setDefense_plan16(defense_plan16);
+ alermBean.setDefense_plan17(defense_plan17);
+ alermBean.setDefense_plan18(defense_plan18);
+ alermBean.setDefense_plan19(defense_plan19);
+ alermBean.setDefense_plan20(defense_plan20);
+ alermBean.setDefense_plan21(defense_plan21);
+
+ mHandler.sendEmptyMessage(2);
+ }
+ }
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/SettingUserActivity.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/SettingUserActivity.java
new file mode 100644
index 0000000..203817c
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/SettingUserActivity.java
@@ -0,0 +1,317 @@
+package com.ipcamera.detect;
+
+import com.ipcamer.detect.R;
+import com.ipcamera.detect.BridgeService.UserInterface;
+import com.ipcamera.detect.utils.ContentCommon;
+import vstc2.nativecaller.NativeCaller;
+import android.app.Activity;
+import android.app.ProgressDialog;
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.Shader.TileMode;
+import android.graphics.drawable.BitmapDrawable;
+import android.os.Bundle;
+import android.os.Handler;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.text.method.HideReturnsTransformationMethod;
+import android.text.method.PasswordTransformationMethod;
+import android.util.Log;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.Window;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.CompoundButton.OnCheckedChangeListener;
+import android.widget.EditText;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+ public class SettingUserActivity extends Activity implements OnCheckedChangeListener, OnClickListener,UserInterface{
+ private boolean successFlag=false;
+ private int CAMERAPARAM=0xffffffff;//״̬
+ private final int TIMEOUT=3000;
+ private final int FAILED=0;
+ private final int SUCCESS=1;
+ private final int PARAMS=3;
+ private String strDID;//camera id
+ private String cameraName;
+ private String operatorName="";
+ private String operatorPwd="";
+ private String visitorName="";
+ private String visitorPwd="";
+ private String adminName="";
+ private String adminPwd="";
+ private EditText editName;
+ private EditText editPwd;
+ private CheckBox cbxShowPwd;
+ private Button btnOk;
+ private Button btnCancel;
+ private ProgressDialog progressDialog;
+
+ private Handler mHandler=new Handler(){
+ public void handleMessage(android.os.Message msg) {
+ switch (msg.what) {
+ case FAILED://set failed
+ showToast(R.string.user_set_failed);
+ break;
+ case SUCCESS://set success
+ showToast(R.string.user_set_success);
+ NativeCaller.PPPPRebootDevice(strDID);
+
+ Log.d("info","user:"+ adminName+" pwd:"+adminPwd);
+ final Intent intent=new Intent(ContentCommon.STR_CAMERA_INFO_RECEIVER);
+ intent.putExtra(ContentCommon.STR_CAMERA_NAME, cameraName);
+ intent.putExtra(ContentCommon.STR_CAMERA_ID, strDID);
+ intent.putExtra(ContentCommon.STR_CAMERA_USER, adminName);
+ intent.putExtra(ContentCommon.STR_CAMERA_PWD, adminPwd);
+ intent.putExtra(ContentCommon.STR_CAMERA_OLD_ID, strDID);
+ intent.putExtra(ContentCommon.CAMERA_OPTION, ContentCommon.CHANGE_CAMERA_USER);
+ mHandler.postDelayed(new Runnable() {
+
+ @Override
+ public void run() {
+
+ sendBroadcast(intent);
+ }
+ }, 3000);
+ finish();
+
+ break;
+ case PARAMS://get user params
+ successFlag=true;
+ if(progressDialog.isShowing()){
+ progressDialog.cancel();
+ }
+ editName.setText(adminName);
+ editPwd.setText(adminPwd);
+ break;
+
+ default:
+ break;
+ }
+ }
+ };
+
+ private Runnable runnable=new Runnable() {
+
+ @Override
+ public void run() {
+ if(!successFlag){
+ successFlag=false;
+ progressDialog.dismiss();
+// showToast(R.string.user_getparams_failed);
+ }
+ }
+ };
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ getDataFromOther();
+ requestWindowFeature(Window.FEATURE_NO_TITLE);
+ setContentView(R.layout.settinguser);
+ progressDialog = new ProgressDialog(this);
+ progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
+ progressDialog.setMessage(getString(R.string.user_getparams));
+ progressDialog.show();
+ mHandler.postDelayed(runnable,TIMEOUT);
+ findView();
+ setLisetener();
+ BridgeService.setUserInterface(this);
+ NativeCaller.PPPPGetSystemParams(strDID,ContentCommon.MSG_TYPE_GET_PARAMS);
+ tvCameraName.setText(cameraName+" "+getResources().getString(R.string.setting_user));
+ }
+
+ private void setLisetener() {
+ cbxShowPwd.setOnCheckedChangeListener(this);
+ btnOk.setOnClickListener(this);
+ btnCancel.setOnClickListener(this);
+ MyTextWatch myNameTextWatch=new MyTextWatch(R.id.edit_name);
+ editName.addTextChangedListener(myNameTextWatch);
+ MyTextWatch myPwdTextWatch=new MyTextWatch(R.id.edit_pwd);
+ editPwd.addTextChangedListener(myPwdTextWatch);
+ }
+
+ private void getDataFromOther() {
+ Intent intent=getIntent();
+ strDID=intent.getStringExtra(ContentCommon.STR_CAMERA_ID);
+ cameraName=intent.getStringExtra(ContentCommon.STR_CAMERA_NAME);
+ adminName ="admin";
+ }
+ @Override
+ protected void onPause() {
+ // TODO Auto-generated method stub
+ overridePendingTransition(R.anim.out_to_right, R.anim.in_from_left);
+ super.onPause();
+ }
+ private void findView() {
+ editName = (EditText)findViewById(R.id.edit_name);
+ editPwd = (EditText)findViewById(R.id.edit_pwd);
+ cbxShowPwd = (CheckBox)findViewById(R.id.cbox_show_pwd);
+ btnOk = (Button)findViewById(R.id.user_ok);
+ btnCancel = (Button)findViewById(R.id.user_cancel);
+
+ tvCameraName = (TextView)findViewById(R.id.tv_camera_setting);
+ RelativeLayout layout=(RelativeLayout)findViewById(R.id.top);
+ Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.top_bg);
+ BitmapDrawable drawable = new BitmapDrawable(bitmap);
+ drawable.setTileModeXY(TileMode.REPEAT , TileMode.REPEAT );
+ drawable.setDither(true);
+ layout.setBackgroundDrawable(drawable);
+ }
+
+ @Override
+ public void onClick(View v) {
+ switch (v.getId()) {
+ case R.id.user_ok:
+ setUser();
+
+ break;
+ case R.id.user_cancel:
+ finish();
+ break;
+
+ default:
+ break;
+ }
+ }
+ private void setUser(){
+ if(successFlag){
+ /*if(TextUtils.isEmpty(adminName)){
+ showToast(R.string.user_name_no_empty);
+ return;
+ }*/
+
+// if(TextUtils.isEmpty(pwd)){
+// showToast(R.string.pwd_no_empty);
+// return;
+// }
+
+ Log.d("info","adminName:"+adminName+" adminPwd:"+adminPwd);
+ NativeCaller.PPPPUserSetting(strDID, visitorName, visitorPwd, operatorName, operatorPwd, adminName, adminPwd);
+ }else{
+ showToast(R.string.user_set_failed);
+ }
+ }
+
+ private Runnable settingRunnable=new Runnable() {
+
+ @Override
+ public void run() {
+ if(!successFlag){
+ showToast(R.string.user_set_failed);
+ }
+ }
+ };
+ private TextView tvCameraName;
+ /**
+ * BridgeService Feedback execute
+ * **/
+ public void CallBack_UserParams(String did, String user1, String pwd1, String user2, String pwd2, String user3, String pwd3){
+ Log.d("info"," did:"+did+" user1:"+user1+" pwd1:"+pwd1+" user2:"+user2+" pwd2:"+pwd2+" user3:"+user3+" pwd3:"+pwd3);
+ adminName=user3;
+ adminPwd=pwd3;
+ mHandler.sendEmptyMessage(PARAMS);
+ }
+ /**
+ * BridgeService Feedback execute
+ * **/
+ public void CallBack_SetSystemParamsResult(String did, int paramType, int result){
+ Log.d("info","result:"+result+" paramType:"+paramType);
+ mHandler.sendEmptyMessage(result);
+ }
+ /**
+ * BridgeService Feedback execute
+ * **/
+ public void setPPPPMsgNotifyData(String did, int type, int param){
+ if(strDID.equals(did)){
+ if(ContentCommon.PPPP_MSG_TYPE_PPPP_STATUS==type){
+ CAMERAPARAM=param;
+ }
+ }
+ }
+
+ private class MyTextWatch implements TextWatcher{
+ private int id;
+ public MyTextWatch(int id){
+ this.id=id;
+ }
+ @Override
+ public void afterTextChanged(Editable s) {
+ String result = s.toString();
+ switch (id) {
+ case R.id.edit_name:
+ adminName=result;
+ break;
+ case R.id.edit_pwd:
+ Log.i("info", "result:"+result);
+ adminPwd=result;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ @Override
+ public void beforeTextChanged(CharSequence s, int start, int count,
+ int after) {
+
+ }
+
+ @Override
+ public void onTextChanged(CharSequence s, int start, int before,
+ int count) {
+
+ }
+
+ }
+ @Override
+ protected void onDestroy() {
+ super.onDestroy();
+ }
+
+ @Override
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+ if(isChecked){
+ editPwd.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
+ }else{
+ editPwd.setTransformationMethod(PasswordTransformationMethod.getInstance());
+ }
+ }
+ public void showToast(String content){
+ Toast.makeText(this, content, Toast.LENGTH_SHORT).show();
+ }
+ public void showToast(int rid){
+ Toast.makeText(this, getResources().getString(rid), Toast.LENGTH_LONG).show();
+ }
+
+ @Override
+ public void callBackUserParams(String did, String user1, String pwd1,
+ String user2, String pwd2, String user3, String pwd3) {
+ // TODO Auto-generated method stub
+ Log.e("用户信息","管理员名称"+adminName+"管理员密码"+adminPwd);
+ adminName = user3;
+ adminPwd = pwd3;
+ operatorName = user2;
+ operatorPwd = pwd2;
+ mHandler.sendEmptyMessage(PARAMS);
+ }
+
+ @Override
+ public void callBackSetSystemParamsResult(String did, int paramType,
+ int result) {
+ // TODO Auto-generated method stub
+ mHandler.sendEmptyMessage(result);
+ }
+
+ @Override
+ public void callBackPPPPMsgNotifyData(String did, int type, int param) {
+ // TODO Auto-generated method stub
+
+ }
+
+ }
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/StartActivity.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/StartActivity.java
new file mode 100644
index 0000000..6f6026a
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/StartActivity.java
@@ -0,0 +1,64 @@
+package com.ipcamera.detect;
+
+
+import com.ipcamer.detect.R;
+
+import vstc2.nativecaller.NativeCaller;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.Window;
+import android.view.WindowManager;
+import android.widget.TextView;
+
+public class StartActivity extends Activity {
+ private static final String LOG_TAG = "StartActivity";
+ private Handler mHandler = new Handler() {
+ public void handleMessage(Message msg) {
+ Intent in = new Intent(StartActivity.this, AddCameraActivity.class);
+ startActivity(in);
+ finish();
+ }
+ };
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ Log.d(LOG_TAG, "StartActivity onCreate");
+ getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
+ WindowManager.LayoutParams.FLAG_FULLSCREEN);
+ requestWindowFeature(Window.FEATURE_NO_TITLE);
+ setContentView(R.layout.start);
+ Intent intent = new Intent();
+ intent.setClass(StartActivity.this, BridgeService.class);
+ startService(intent);
+ new Thread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ NativeCaller.PPPPInitialOther("ADCBBFAOPPJAHGJGBBGLFLAGDBJJHNJGGMBFBKHIBBNKOKLDHOBHCBOEHOKJJJKJBPMFLGCPPJMJAPDOIPNL");
+ Thread.sleep(3000);
+ Message msg = new Message();
+ mHandler.sendMessage(msg);
+ //Log.e("vst","path"+getApplicationContext().getFilesDir().getAbsolutePath());
+ NativeCaller.SetAPPDataPath(getApplicationContext().getFilesDir().getAbsolutePath());
+ } catch (Exception e) {
+
+ }
+ }
+ }).start();
+ }
+
+ @Override
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
+ if (keyCode == KeyEvent.KEYCODE_BACK)
+ return true;
+ return super.onKeyDown(keyCode, event);
+ }
+
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/BindSensorListAdapter.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/BindSensorListAdapter.java
new file mode 100644
index 0000000..3d93ec4
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/BindSensorListAdapter.java
@@ -0,0 +1,178 @@
+package com.ipcamera.detect.adapter;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import android.content.Context;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.ipcamer.detect.R;
+
+public class BindSensorListAdapter extends BaseAdapter {
+ private LayoutInflater mInflater = null;
+ private ArrayList> mylist;
+ private Context context;
+
+ public BindSensorListAdapter(Context c)
+ {
+ context=c;
+ this.mInflater = LayoutInflater.from(c);
+ mylist =new ArrayList>();
+ }
+
+ @Override
+ public int getCount() {
+ // TODO Auto-generated method stub
+ return mylist.size();
+ }
+
+ @Override
+ public Object getItem(int arg0) {
+ // TODO Auto-generated method stub
+ return arg0;
+ }
+
+ @Override
+ public long getItemId(int arg0) {
+ // TODO Auto-generated method stub
+ return arg0;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ // TODO Auto-generated method stub
+ sensorlist sensor;
+ if (convertView == null) {
+ sensor = new sensorlist();
+ convertView = mInflater.inflate(R.layout.sensoradapterlayout,null);
+ sensor.sensorname = (TextView) convertView.findViewById(R.id.sensorname);
+ sensor.sensortypeimageview = (ImageView) convertView.findViewById(R.id.sensor_type);
+
+ sensor.getnext = (ImageView) convertView.findViewById(R.id.imageView1);
+ sensor.sensornew = (ImageView) convertView.findViewById(R.id.sensor_new);
+ convertView.setTag(sensor);
+ } else {
+ sensor = (sensorlist) convertView.getTag();
+ }
+ Map map = mylist.get(position);
+ String name = (String) map.get("sensorname").toString().trim();
+ if (name.length() != 0 && !name.equals("")) {
+ sensor.sensorname.setText(name);
+ Log.i("info", "传感器名称不为空。");
+ }
+ int id = (Integer) map.get("id");// 修改传感器名称的ID 为listview的position
+ int list1 = (Integer) map.get("sensorid1");
+ int list2 = (Integer) map.get("sensorid2");
+ int list3 = (Integer) map.get("sensorid3");
+ int type = (Integer) map.get("sensortype");
+ int isNew = (Integer) map.get("sensornew");
+ if (isNew == 1) {
+ sensor.sensornew.setVisibility(View.VISIBLE);
+ } else {
+ sensor.sensornew.setVisibility(View.INVISIBLE);
+ }
+ String list = changeTo16(list1) + changeTo16(list2)
+ + changeTo16(list3);
+ String sensortype = null;
+ if (type == 1)
+ {
+ sensortype = context.getString(R.string.sensor_type_door);
+ sensor.sensortypeimageview.setBackgroundResource(R.drawable.sensorlist_item_magnetic);
+ }
+ else if (type == 2)
+ {
+ sensortype = context.getString(R.string.sensor_type_infrared);
+ sensor.sensortypeimageview.setBackgroundResource(R.drawable.sensorlist_item_infrared);
+ }
+ else if (type == 3)
+ {
+ sensortype = context.getString(R.string.sensor_type_smoke);
+ sensor.sensortypeimageview.setBackgroundResource(R.drawable.sensorlist_item_smoke);
+ }
+ else if (type == 4)
+ {
+ sensortype = context.getString(R.string.sensor_type_gas);
+ sensor.sensortypeimageview.setBackgroundResource(R.drawable.sensorlist_item_gas);
+ }
+ else if (type == 7)
+ {
+ sensortype = context.getString(R.string.sensor_type_remote);
+ sensor.sensortypeimageview.setBackgroundResource(R.drawable.sensorlist_item_control);
+ }
+ else if (type == 8)
+ {
+ sensortype = context.getString(R.string.sensor_type_siren);
+ sensor.sensortypeimageview.setBackgroundResource(R.drawable.sensor_siren_icon);
+ }
+ else if (type == 10)
+ {
+ sensortype = context.getString(R.string.sensor_type_camera);
+ }
+ else if (type == 11)
+ {
+ sensortype = context.getString(R.string.sensor_type_curtain);
+ }
+
+
+ return convertView;
+ }
+
+ public void addSensorToList(int sensorid1, int sensorid2,int sensorid3, int sensortype, String resultPbuf, int newadd,int id)
+ {
+ Log.i("info", "add sensor");
+ Map map = new HashMap();
+ map.put("sensorid1", sensorid1);
+ map.put("sensorid2", sensorid2);
+ map.put("sensorid3", sensorid3);
+ map.put("sensortype", sensortype);
+ map.put("sensorname", resultPbuf);
+ map.put("sensornew", newadd);
+ map.put("id", id);
+
+ synchronized (this) {
+ mylist.add(map);
+ }
+ }
+
+ public void changeSensorName(String name, int pos) {
+ Map map = mylist.get(pos);
+ map.put("sensorname", name);
+ Log.i("info", "changeSensorName:" + name);
+ }
+
+ public void changeSensorNew(int pos) {
+ Map map = mylist.get(pos);
+ map.put("sensornew", -1);
+ }
+
+ public void cleanItem() {
+ mylist.clear();
+ }
+
+ public void removeMylist(int pos) {
+ mylist.remove(pos);
+ }
+
+ public String changeTo16(int id)
+ {
+ String b = Integer.toHexString(id).toUpperCase();
+
+ return id < 10 ? "0" + b : b;
+ }
+
+ class sensorlist
+ {
+ public TextView sensorname;
+ // public TextView sensorid;
+ public ImageView getnext;
+ public ImageView sensornew;
+ public ImageView sensortypeimageview;
+ }
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/MessageAdapter.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/MessageAdapter.java
new file mode 100644
index 0000000..6966481
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/MessageAdapter.java
@@ -0,0 +1,103 @@
+package com.ipcamera.detect.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.TextView;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+
+import com.ipcamer.detect.R;
+import com.ipcamer.detect.R.drawable;
+import com.ipcamer.detect.R.id;
+import com.ipcamer.detect.R.layout;
+import com.ipcamer.detect.R.string;
+import com.ipcamera.detect.bean.MessageBean;
+import com.ipcamera.detect.bean.WifiScanBean;
+
+import java.util.ArrayList;
+
+public class MessageAdapter extends BaseAdapter {
+
+ private Context context;
+ private LayoutInflater inflater;
+ private ArrayList list;
+ private ViewHolder holder;
+
+ public MessageAdapter(Context context, ArrayList mlist) {
+ this.context = context;
+ inflater = LayoutInflater.from(context);
+ list = mlist;
+ }
+
+ @Override
+ public int getCount() {
+ return list.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return position;
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ if (convertView == null) {
+ convertView = inflater
+ .inflate(layout.message_list_item, null);
+ holder = new ViewHolder();
+ // holder.img = (ImageView) convertView.findViewById(R.id.img);
+ holder.dz = (TextView) convertView.findViewById(id.dz);
+ holder.time = (TextView) convertView
+ .findViewById(id.time);
+
+ convertView.setTag(holder);
+ } else {
+ holder = (ViewHolder) convertView.getTag();
+ }
+
+ MessageBean mMessageBean = list.get(position);
+
+ if(mMessageBean.getDz().equals("18"))
+ {
+ holder.dz.setText(context.getResources().getString(R.string.alerm_motion_alarm));
+ }else if(mMessageBean.getDz().equals("online"))
+ {
+ holder.dz.setText(context.getResources().getString(R.string.pppp_status_online));
+ }else if(mMessageBean.getDz().equals("offline"))
+ {
+ holder.dz.setText(context.getResources().getString(string.dev_offline));
+ }else{
+ holder.dz.setText("rea = "+mMessageBean.getDz());
+ }
+
+ holder.time.setText(timeStamp2Date(mMessageBean.getDate(),"yyyy-MM-dd HH:mm:ss"));
+
+ return convertView;
+ }
+
+
+
+ private class ViewHolder {
+ TextView dz;
+ TextView time;
+
+ }
+
+ public static String timeStamp2Date(String seconds,String format) {
+ if(seconds == null || seconds.isEmpty() || seconds.equals("null")){
+ return "";
+ }
+ if(format == null || format.isEmpty()){
+ format = "yyyy-MM-dd HH:mm:ss"; }
+ SimpleDateFormat sdf = new SimpleDateFormat(format);
+ return sdf.format(new Date(Long.valueOf(seconds+"000")));
+ }
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/MoveVideoTimingAdapter.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/MoveVideoTimingAdapter.java
new file mode 100644
index 0000000..1001f25
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/MoveVideoTimingAdapter.java
@@ -0,0 +1,207 @@
+package com.ipcamera.detect.adapter;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+
+
+
+import com.ipcamer.detect.R;
+
+import android.content.Context;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+
+public class MoveVideoTimingAdapter extends BaseAdapter {
+ private Context mContext;
+ public ArrayList> movevideotiming;
+ private LayoutInflater inflater;
+ private ViewHolder holder;
+
+ public MoveVideoTimingAdapter(Context mContext) {
+ // TODO Auto-generated constructor stub
+ this.mContext = mContext;
+ movevideotiming = new ArrayList>();
+ inflater = LayoutInflater.from(mContext);
+ }
+ @Override
+ public int getCount() {
+ // TODO Auto-generated method stub
+ return movevideotiming.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ // TODO Auto-generated method stub
+ return position;
+ }
+
+ @Override
+ public long getItemId(int position) {
+ // TODO Auto-generated method stub
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ // TODO Auto-generated method stub
+ if (convertView == null) {
+ convertView = inflater.inflate(R.layout.timing_video_item, null);
+ holder = new ViewHolder();
+ holder.tv_timing_time = (TextView) convertView.findViewById(R.id.tv_timing_time);
+ holder.tv_timing_week = (TextView) convertView.findViewById(R.id.tv_timing_week);
+
+ convertView.setTag(holder);
+ }else {
+ holder = (ViewHolder) convertView.getTag();
+ }
+ Map item = movevideotiming.get(position);
+ int itemplan = item.entrySet().iterator().next().getValue();
+ Log.e("itemplan:*******", ""+ itemplan);
+
+
+ holder.tv_timing_week.setText(getWeekPlan(itemplan));
+
+ int bStarttime = itemplan & 0x7ff;
+ int bEndTime = (itemplan >> 12) & 0x7ff;
+ holder.tv_timing_time.setText(getTime(bStarttime) + "-" + getTime(bEndTime));
+
+ int plankey = item.entrySet().iterator().next().getKey();
+ int plantime = item.entrySet().iterator().next().getValue();
+ movevideotiming.get(position).put(plankey, plantime);
+
+
+ return convertView;
+ }
+ private class ViewHolder {
+ TextView tv_timing_time;
+ TextView tv_timing_week;
+
+
+ }
+ private String getWeekPlan(int time) {
+ String weekdays = "";
+ for (int i = 24; i < 31; i++) {
+ int weeks = (time >> i) & 1;
+ if (weeks == 1) {
+ switch (i) {
+ case 24:
+ weekdays = weekdays
+ + mContext.getResources().getString(R.string.plug_seven)
+ + " ";
+ break;
+ case 25:
+ weekdays = weekdays
+ + mContext.getResources().getString(R.string.plug_one)
+ + " ";
+ break;
+ case 26:
+ weekdays = weekdays
+ + mContext.getResources().getString(R.string.plug_two)
+ + " ";
+ break;
+ case 27:
+ weekdays = weekdays
+ + mContext.getResources().getString(R.string.plug_three)
+ + " ";
+ break;
+ case 28:
+ weekdays = weekdays
+ + mContext.getResources().getString(R.string.plug_four)
+ + " ";
+ break;
+ case 29:
+ weekdays = weekdays
+ + mContext.getResources().getString(R.string.plug_five)
+ + " ";
+ break;
+ case 30:
+ weekdays = weekdays
+ + mContext.getResources().getString(R.string.plug_six)
+ + " ";
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ return weekdays;
+ }
+
+ private String getTime(int time) {
+ if (time < 60) {
+ if (time < 10)
+ return "00:0" + time;
+ return "00:" + time;
+ }
+ int h = time / 60;
+ int m = time - (h * 60);
+ if (h < 10 && m < 10) {
+ return "0" + h + ":0" + m;
+ } else if (h > 9 && m < 10) {
+ return h + ":0" + m;
+ } else if (h < 10 && m > 9) {
+ return "0" + h + ":" + m;
+ }
+
+ return h + ":" + m;
+
+ }
+
+ public void addPlan(int key, int value) {
+ Map map = new HashMap();
+ map.put(key, value);
+ movevideotiming.add(map);
+ int size = movevideotiming.size();
+ for (int i = 0; i < size - 1; i++) {
+ for (int j = 1; j < size - i; j++) {
+ Map maps;
+ if (movevideotiming
+ .get(j - 1)
+ .entrySet()
+ .iterator()
+ .next()
+ .getKey()
+ .compareTo(
+ movevideotiming.get(j).entrySet().iterator().next()
+ .getKey()) > 0) {
+ maps = movevideotiming.get(j - 1);
+ movevideotiming.set(j - 1, movevideotiming.get(j));
+ movevideotiming.set(j, maps);
+ }
+ }
+ }
+
+ }
+
+ public void notify(int key, int value) {
+ int size = movevideotiming.size();
+ for (int i = 0; i < size; i++) {
+ Map map = movevideotiming.get(i);
+ if (map.containsKey(key)) {
+ map.put(key, value);
+ break;
+ }
+ }
+ }
+
+ public void removePlan(int key) {
+ int size = movevideotiming.size();
+ for (int i = 0; i < size; i++) {
+ Map map = movevideotiming.get(i);
+ if (map.containsKey(key)) {
+ movevideotiming.remove(i);
+ break;
+ }
+ }
+ }
+
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/PushVideoTimingAdapter.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/PushVideoTimingAdapter.java
new file mode 100644
index 0000000..31479aa
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/PushVideoTimingAdapter.java
@@ -0,0 +1,204 @@
+package com.ipcamera.detect.adapter;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.ipcamer.detect.R;
+
+import android.content.Context;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+
+public class PushVideoTimingAdapter extends BaseAdapter {
+ private Context mContext;
+ public ArrayList> movetiming;
+ private LayoutInflater inflater;
+ private ViewHolder holder;
+
+ public PushVideoTimingAdapter(Context mContext) {
+ // TODO Auto-generated constructor stub
+ this.mContext = mContext;
+ movetiming = new ArrayList>();
+ inflater = LayoutInflater.from(mContext);
+ }
+ @Override
+ public int getCount() {
+ // TODO Auto-generated method stub
+ return movetiming.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ // TODO Auto-generated method stub
+ return position;
+ }
+
+ @Override
+ public long getItemId(int position) {
+ // TODO Auto-generated method stub
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ // TODO Auto-generated method stub
+ if (convertView == null) {
+ convertView = inflater.inflate(R.layout.timing_video_item, null);
+ holder = new ViewHolder();
+ holder.tv_timing_time = (TextView) convertView.findViewById(R.id.tv_timing_time);
+ holder.tv_timing_week = (TextView) convertView.findViewById(R.id.tv_timing_week);
+
+ convertView.setTag(holder);
+ }else {
+ holder = (ViewHolder) convertView.getTag();
+ }
+ Map item = movetiming.get(position);
+ int itemplan = item.entrySet().iterator().next().getValue();
+ Log.e("itemplan:*******", ""+ itemplan);
+
+
+ holder.tv_timing_week.setText(getWeekPlan(itemplan));
+
+ int bStarttime = itemplan & 0x7ff;
+ int bEndTime = (itemplan >> 12) & 0x7ff;
+ holder.tv_timing_time.setText(getTime(bStarttime) + "-" + getTime(bEndTime));
+
+ int plankey = item.entrySet().iterator().next().getKey();
+ int plantime = item.entrySet().iterator().next().getValue();
+ movetiming.get(position).put(plankey, plantime);
+
+
+ return convertView;
+ }
+ private class ViewHolder {
+ TextView tv_timing_time;
+ TextView tv_timing_week;
+
+
+ }
+ private String getWeekPlan(int time) {
+ String weekdays = "";
+ for (int i = 24; i < 31; i++) {
+ int weeks = (time >> i) & 1;
+ if (weeks == 1) {
+ switch (i) {
+ case 24:
+ weekdays = weekdays
+ + mContext.getResources().getString(R.string.plug_seven)
+ + " ";
+ break;
+ case 25:
+ weekdays = weekdays
+ + mContext.getResources().getString(R.string.plug_one)
+ + " ";
+ break;
+ case 26:
+ weekdays = weekdays
+ + mContext.getResources().getString(R.string.plug_two)
+ + " ";
+ break;
+ case 27:
+ weekdays = weekdays
+ + mContext.getResources().getString(R.string.plug_three)
+ + " ";
+ break;
+ case 28:
+ weekdays = weekdays
+ + mContext.getResources().getString(R.string.plug_four)
+ + " ";
+ break;
+ case 29:
+ weekdays = weekdays
+ + mContext.getResources().getString(R.string.plug_five)
+ + " ";
+ break;
+ case 30:
+ weekdays = weekdays
+ + mContext.getResources().getString(R.string.plug_six)
+ + " ";
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ return weekdays;
+ }
+
+ private String getTime(int time) {
+ if (time < 60) {
+ if (time < 10)
+ return "00:0" + time;
+ return "00:" + time;
+ }
+ int h = time / 60;
+ int m = time - (h * 60);
+ if (h < 10 && m < 10) {
+ return "0" + h + ":0" + m;
+ } else if (h > 9 && m < 10) {
+ return h + ":0" + m;
+ } else if (h < 10 && m > 9) {
+ return "0" + h + ":" + m;
+ }
+
+ return h + ":" + m;
+
+ }
+
+ public void addPlan(int key, int value) {
+ Map map = new HashMap();
+ map.put(key, value);
+ movetiming.add(map);
+ int size = movetiming.size();
+ for (int i = 0; i < size - 1; i++) {
+ for (int j = 1; j < size - i; j++) {
+ Map maps;
+ if (movetiming
+ .get(j - 1)
+ .entrySet()
+ .iterator()
+ .next()
+ .getKey()
+ .compareTo(
+ movetiming.get(j).entrySet().iterator().next()
+ .getKey()) > 0) {
+ maps = movetiming.get(j - 1);
+ movetiming.set(j - 1, movetiming.get(j));
+ movetiming.set(j, maps);
+ }
+ }
+ }
+
+ }
+
+ public void notify(int key, int value) {
+ int size = movetiming.size();
+ for (int i = 0; i < size; i++) {
+ Map map = movetiming.get(i);
+ if (map.containsKey(key)) {
+ map.put(key, value);
+ break;
+ }
+ }
+ }
+
+ public void removePlan(int key) {
+ int size = movetiming.size();
+ for (int i = 0; i < size; i++) {
+ Map map = movetiming.get(i);
+ if (map.containsKey(key)) {
+ movetiming.remove(i);
+ break;
+ }
+ }
+ }
+
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/SearchListAdapter.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/SearchListAdapter.java
new file mode 100644
index 0000000..bf02019
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/SearchListAdapter.java
@@ -0,0 +1,141 @@
+package com.ipcamera.detect.adapter;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.ipcamer.detect.R;
+import com.ipcamer.detect.R.drawable;
+import com.ipcamer.detect.R.id;
+import com.ipcamer.detect.R.layout;
+import com.ipcamera.detect.utils.ContentCommon;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.TextView;
+
+public class SearchListAdapter extends BaseAdapter {
+
+ @SuppressWarnings("unused")
+ private static final String LOG_TAG = "SearchListAdapter" ;
+
+ private LayoutInflater listContainer = null;
+ @SuppressWarnings("unused")
+ private Context context = null;
+ private List> listItems = new ArrayList>();;
+
+ public final class SearchListItem{
+ public TextView devName;
+ public TextView devID;
+ }
+
+ public SearchListAdapter(Context ct){
+ context = ct;
+ listContainer = LayoutInflater.from(ct);
+ }
+
+ @Override
+ public int getCount() {
+ // TODO Auto-generated method stub
+ return listItems.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public long getItemId(int position) {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ // TODO Auto-generated method stub
+
+ SearchListItem searchListItem = null;
+ if(convertView == null){
+ searchListItem = new SearchListItem();
+ convertView = listContainer.inflate(R.layout.search_list_item, null);
+ searchListItem.devName = (TextView)convertView.findViewById(R.id.searchDevName) ;
+ searchListItem.devID = (TextView)convertView.findViewById(R.id.searchDevID) ;
+ convertView.setTag(searchListItem);
+ }else{
+ searchListItem = (SearchListItem)convertView.getTag();
+ }
+// if(listItems.size()==1){
+// convertView.setBackgroundResource(R.drawable.listitem_one_pressed_selector);
+// }else if(position==0){
+// convertView.setBackgroundResource(R.drawable.listitem_pressed_top_corner_selector);
+// }else if(position==listItems.size()-1){
+// convertView.setBackgroundResource(R.drawable.listitem_pressed_bottom_corner_selector);
+// }else{
+// }
+ convertView.setBackgroundResource(R.drawable.listitem_pressed_selector);
+ if(listItems != null)
+ {
+ searchListItem.devName.setText((String)listItems.get(position).get(ContentCommon.STR_CAMERA_NAME));
+ searchListItem.devID.setText((String)listItems.get(position).get(ContentCommon.STR_CAMERA_ID));
+ }
+ return convertView;
+ }
+
+ /**
+ *
+ * @param mac
+ * @param name
+ * @param did
+ */
+ public boolean AddCamera(String mac, String name, String did){
+ if(!CheckCameraInfo(mac)){
+ return false;
+ }
+
+ Map map = new HashMap();
+ map.put(ContentCommon.STR_CAMERA_MAC, mac) ;
+ map.put(ContentCommon.STR_CAMERA_NAME, name);
+ map.put(ContentCommon.STR_CAMERA_ID, did);
+ listItems.add(map) ;
+ return true;
+ }
+
+ /**
+ *
+ * @param mac
+ * @return
+ */
+ private boolean CheckCameraInfo(String mac) {
+ // TODO Auto-generated method stub
+
+ int size = listItems.size();
+ int i;
+ for(i = 0; i < size; i++){
+ String strMac = (String)listItems.get(i).get(ContentCommon.STR_CAMERA_MAC);
+ if(mac.equals(strMac)){
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public Map getItemContent(int pos) {
+ // TODO Auto-generated method stub
+ if(pos > listItems.size()){
+ return null;
+ }
+
+ return listItems.get(pos);
+ }
+
+ public void ClearAll(){
+ listItems.clear();
+ }
+
+}
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/SensorListAdapter.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/SensorListAdapter.java
new file mode 100644
index 0000000..953da55
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/SensorListAdapter.java
@@ -0,0 +1,119 @@
+package com.ipcamera.detect.adapter;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.ipcamer.detect.R;
+
+import android.content.Context;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+import android.widget.ListView;
+import android.widget.TextView;
+
+public class SensorListAdapter extends BaseAdapter{
+ private LayoutInflater inflater=null;
+ private Context context;
+ public ArrayList> listItems = new ArrayList>();
+
+ public SensorListAdapter(Context context,ArrayList> lists)
+ {
+ this.context=context;
+ listItems=lists;
+ inflater=LayoutInflater.from(context);
+
+ }
+
+ class sensorlist
+ {
+ public TextView sensorname;
+ public TextView sensordis;
+ public ImageView sensortype;
+ public TextView sensorid;
+ public ImageView getnext;
+ }
+
+ @Override
+ public int getCount() {
+ // TODO Auto-generated method stub
+ return listItems.size();
+ }
+
+ @Override
+ public Object getItem(int arg0) {
+ // TODO Auto-generated method stub
+ return arg0;
+ }
+
+ @Override
+ public long getItemId(int arg0) {
+ // TODO Auto-generated method stub
+ return arg0;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup v) {
+ // TODO Auto-generated method stub
+ sensorlist sensor;
+ if (convertView == null) {
+ sensor = new sensorlist();
+ convertView = inflater.inflate(R.layout.sensorlist_item_sensortype_item, null);
+ sensor.sensorname = (TextView) convertView
+ .findViewById(R.id.sensor_name);
+ sensor.sensortype = (ImageView) convertView
+ .findViewById(R.id.sensor_type);
+ sensor.sensordis = (TextView) convertView
+ .findViewById(R.id.sensor_dic);
+ sensor.getnext = (ImageView) convertView
+ .findViewById(R.id.imageView1);
+ convertView.setTag(sensor);
+ } else {
+ sensor = (sensorlist) convertView.getTag();
+ }
+
+ Map map = listItems.get(position);
+ String type = map.get("sensortype");
+ int a = Integer.parseInt(type);
+ Log.i("info", "aaa传感器类型aaaaaaaa" + a);
+ if (a == 1) {
+ sensor.sensorname.setText(context.getString(R.string.sensor_type_door));
+ sensor.sensordis.setText(context.getString(R.string.add_sensor_door_desc));
+ sensor.sensortype.setBackgroundResource(R.drawable.sensorlist_item_magnetic);
+ }
+ else if (a == 2) {
+// sensor.sensorid.setText("(" + list + "/" + "红外" + ")");
+ sensor.sensorname.setText(context.getString(R.string.sensor_type_infrared));
+ sensor.sensordis.setText(context.getString(R.string.add_sensor_infrerad_desc));
+ sensor.sensortype.setBackgroundResource(R.drawable.sensorlist_item_infrared);
+ }
+ else if (a == 3) {
+// sensor.sensorid.setText("(" + list + "/" + "烟感" + ")");
+ sensor.sensorname.setText(context.getString(R.string.sensor_type_smoke));
+ sensor.sensordis.setText(context.getString(R.string.add_sensor_smoke_desc));
+ sensor.sensortype.setBackgroundResource(R.drawable.sensorlist_item_smoke);
+ }
+ else if (a == 4) {
+// sensor.sensorid.setText("(" + list + "/" + "煤气" + ")");
+ sensor.sensorname.setText(context.getString(R.string.sensor_type_gas));
+ sensor.sensordis.setText(context.getString(R.string.add_sensor_gas_desc));
+ sensor.sensortype.setBackgroundResource(R.drawable.sensorlist_item_gas);
+ }
+ else if (a == 7) {
+ sensor.sensorname.setText(context.getString(R.string.sensor_type_remote));
+ sensor.sensordis.setText(context.getString(R.string.add_sensor_control_desc));
+ sensor.sensortype.setBackgroundResource(R.drawable.sensorlist_item_control);
+ }
+ else if (a == 8){
+ sensor.sensorname.setText(context.getString(R.string.sensor_type_siren));
+ sensor.sensordis.setText(context.getString(R.string.add_sensor_siren_desc));
+ sensor.sensortype.setBackgroundResource(R.drawable.sensor_siren_icon);
+ }
+
+ return convertView;
+ }
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/ShowLocPicGridViewAdapter.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/ShowLocPicGridViewAdapter.java
new file mode 100644
index 0000000..6764a8a
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/ShowLocPicGridViewAdapter.java
@@ -0,0 +1,308 @@
+package com.ipcamera.detect.adapter;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.ipcamer.detect.R;
+import com.ipcamera.detect.utils.DatabaseUtil;
+
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+public class ShowLocPicGridViewAdapter extends BaseAdapter {
+ private Context context;
+ private String did;
+ private LayoutInflater inflater;
+ private ViewHolder holder;
+ private int mode = 1;// 连接模式
+ private ArrayList> arrayList;
+
+ public ShowLocPicGridViewAdapter(Context context, String did) {
+ this.context = context;
+ this.did = did;
+ arrayList = new ArrayList>();
+ inflater = LayoutInflater.from(context);
+ }
+
+ @Override
+ public int getCount() {
+ return arrayList.size();
+ }
+
+ @Override
+ public Object getItem(int arg0) {
+ return arg0;
+ }
+
+ @Override
+ public long getItemId(int arg0) {
+ return arg0;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup arg2) {
+ String path = arrayList.get(position).get("path").toString();
+ if (convertView == null) {
+ convertView = inflater.inflate(R.layout.showlocalpicgrid_griditem,
+ null);
+ holder = new ViewHolder();
+ holder.img = (ImageView) convertView.findViewById(R.id.imageView1);
+ holder.playvideo = (ImageView) convertView
+ .findViewById(R.id.playvideo);
+ holder.img_delHook = (ImageView) convertView
+ .findViewById(R.id.del_hook);
+ holder.baFlag = (TextView) convertView
+ .findViewById(R.id.tvbadfileflag);
+ holder.textView_timeshow = (TextView) convertView
+ .findViewById(R.id.locVidTimeShow);
+ convertView.setTag(holder);
+ } else {
+ holder = (ViewHolder) convertView.getTag();
+ }
+ Map map = arrayList.get(position);
+ Bitmap bmp = (Bitmap) map.get("bmp");
+ int status = (Integer) map.get("status");
+ int type = (Integer) map.get("type");
+ if (type == 1) {
+ holder.baFlag.setVisibility(View.VISIBLE);
+ } else {
+ holder.baFlag.setVisibility(View.GONE);
+ }
+ Log.d("tag", "adapter status:" + status + " position:" + position);
+ switch (status) {
+ case 0:
+ holder.img_delHook.setVisibility(View.GONE);
+ holder.img.setPadding(2, 2, 2, 2);
+ holder.img.setBackgroundColor(0x00ff0000);
+ break;
+ case 1:
+ holder.img_delHook.setVisibility(View.VISIBLE);
+ holder.img.setPadding(2, 2, 2, 2);
+ holder.img.setBackgroundColor(0xffff0000);
+ break;
+ default:
+ break;
+ }
+ switch (mode) {
+ case 1:
+ holder.playvideo.setVisibility(View.GONE);
+ break;
+ case 2:
+ holder.playvideo.setVisibility(View.VISIBLE);
+ break;
+ default:
+ break;
+ }
+ holder.img.setImageBitmap(bmp);
+ holder.textView_timeshow.setText(getContent(path));
+ return convertView;
+ }
+
+ public void setMode(int mode) {
+ this.mode = mode;
+ }
+
+ public ArrayList> getArrayPics() {
+ return arrayList;
+ }
+
+ public void clearAll() {
+ arrayList.clear();
+ }
+ private String getContent(String filePath) {
+ Log.d("tag", "filePath:" + filePath);
+ String s = filePath.substring(filePath.lastIndexOf("/") + 1);
+ //String date = s.substring(0, 10);
+
+ String time = s.substring(11, 16).replace("_", ":");
+ String result = time;
+ Log.d("tag", "result:" + result);
+ Log.d("tag", "sss:" + s.substring(0, 16));
+ return result;
+ }
+
+ public ArrayList> DelPics() {
+ DatabaseUtil dbUtil = new DatabaseUtil(context);
+ dbUtil.open();
+ ArrayList delArray = new ArrayList();
+ for (int i = 0; i < arrayList.size(); i++) {
+ Map map = arrayList.get(i);
+ String path = (String) map.get("path");
+ int status = (Integer) map.get("status");
+ if (status == 1) {
+ Log.d("tag", "path:" + path);
+ delArray.add(path);
+ }
+ }
+
+ int size = delArray.size();
+ Log.d("tag", "delArray.size():" + size);
+
+ for (int i = 0; i < size; i++) {
+ String path = delArray.get(i);
+ Log.d("tag", "");
+ boolean flag = true;
+ for (int j = 0; j < arrayList.size() && flag; j++) {
+ Map map = arrayList.get(j);
+ String path2 = (String) map.get("path");
+ if (path.equals(path2)) {
+ Log.d("tag", "");
+ String type = "";
+ switch (mode) {
+ case 1:
+ type = DatabaseUtil.TYPE_PICTURE;
+ break;
+ case 2:
+ type = DatabaseUtil.TYPE_VIDEO;
+ break;
+ }
+ if (dbUtil.deleteVideoOrPicture(did, path2, type)) {
+
+ File file = new File(path2);
+ if (file != null && file.exists()) {
+ Log.d("tag", "");
+ file.delete();
+
+ }
+ map.clear();
+ arrayList.remove(j);
+ }
+ flag = false;
+ }
+ }
+ }
+ dbUtil.close();
+ delArray.clear();
+ delArray = null;
+ Log.d("tag", "DelPics end");
+ return arrayList;
+ }
+
+ public void addBitmap(Bitmap bitmap, String path, int type) {
+ Map map = new HashMap();
+ map.put("bmp", bitmap);
+ map.put("path", path);
+ map.put("status", 0);
+ map.put("type", type);
+ arrayList.add(map);
+ }
+
+ // private Bitmap getBitmap(String path) {
+ //
+ // switch (mode) {
+ // case 1: {// ͼƬ
+ // holder.playvideo.setVisibility(View.GONE);
+ // Bitmap btp = BitmapFactory.decodeFile(path);
+ // int btmWidth = btp.getWidth();
+ // int btmHeight = btp.getHeight();
+ // float scaleW = ((float) 140) / btmWidth;
+ // float scaleH = ((float) 120) / btmHeight;
+ // Matrix matrix = new Matrix();
+ // matrix.postScale(scaleW, scaleH);
+ // Bitmap bt = Bitmap.createBitmap(btp, 0, 0, btmWidth, btmHeight,
+ // matrix, true);
+ //
+ // return bt;
+ // }
+ // case 2://
+ // holder.playvideo.setVisibility(View.VISIBLE);
+ // File file = new File(path);
+ // FileInputStream in = null;
+ // try {
+ // in = new FileInputStream(file);
+ // Log.d("tag", ":" + in.available());
+ // byte[] lengthBytes = new byte[4];
+ // byte[] timeBytes = new byte[4];
+ // in.read(lengthBytes);
+ // in.read(timeBytes);
+ // int time = byteToInt(timeBytes);
+ // int length = byteToInt(lengthBytes);
+ // Log.d("tag", "time:" + time);
+ // Log.d("tag", "length:" + length);
+ // byte[] contentBytes = new byte[length];
+ // in.read(contentBytes);
+ // Bitmap btp = BitmapFactory.decodeByteArray(contentBytes, 0,
+ // contentBytes.length);
+ // if (btp != null) {
+ // Matrix matrix = new Matrix();
+ // float scaleX = ((float) 140) / btp.getWidth();
+ // float scaleY = ((float) 120) / btp.getHeight();
+ // Log.d("tag", "sx:" + scaleX + " sy:" + scaleY);
+ // matrix.postScale(scaleX, scaleY);
+ // return Bitmap.createBitmap(btp, 0, 0, btp.getWidth(),
+ // btp.getHeight(), matrix, true);
+ // } else {
+ // return null;
+ // }
+ //
+ // } catch (Exception e) {
+ //
+ // } finally {
+ // if (in != null) {
+ // try {
+ // in.close();
+ // in = null;
+ // } catch (IOException e) {
+ // e.printStackTrace();
+ // }
+ // }
+ // }
+ //
+ // break;
+ // }
+ // return null;
+ //
+ // }
+
+ // private class MyTouch implements OnTouchListener{
+ // private int position;
+ // public MyTouch(int position){
+ // this.position=position;
+ // }
+ // @Override
+ // public boolean onTouch(View v, MotionEvent event) {
+ //
+ // return false;
+ // }
+ //
+ // }
+ private class ViewHolder {
+ ImageView img;
+ ImageView playvideo;
+ ImageView img_delHook;
+ TextView baFlag;
+ TextView textView_timeshow;
+ }
+
+ public static byte[] intToByte(int number) {
+ int temp = number;
+ byte[] b = new byte[4];
+ for (int i = 0; i < b.length; i++) {
+ b[i] = new Integer(temp & 0xff).byteValue();
+ temp = temp >> 8;
+ }
+ return b;
+ }
+
+ public static int byteToInt(byte[] b) {
+ int s = 0;
+ int s0 = b[0] & 0xff;
+ int s1 = b[1] & 0xff;
+ int s2 = b[2] & 0xff;
+ int s3 = b[3] & 0xff;
+ s3 <<= 24;
+ s2 <<= 16;
+ s1 <<= 8;
+ s = s0 | s1 | s2 | s3;
+ return s;
+ }
+}
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/VideoTimingAdapter.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/VideoTimingAdapter.java
new file mode 100644
index 0000000..4ffdad2
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/VideoTimingAdapter.java
@@ -0,0 +1,217 @@
+package com.ipcamera.detect.adapter;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.ipcamer.detect.R;
+
+import android.content.Context;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+
+public class VideoTimingAdapter extends BaseAdapter {
+ private Context mContext;
+ public ArrayList> sdtiming;
+ private LayoutInflater inflater;
+ private ViewHolder holder;
+
+ public VideoTimingAdapter(Context mContext) {
+ // TODO Auto-generated constructor stub
+ this.mContext = mContext;
+ sdtiming = new ArrayList>();
+ inflater = LayoutInflater.from(mContext);
+ }
+ @Override
+ public int getCount() {
+ // TODO Auto-generated method stub
+ return sdtiming.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ // TODO Auto-generated method stub
+ return position;
+ }
+
+ @Override
+ public long getItemId(int position) {
+ // TODO Auto-generated method stub
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ // TODO Auto-generated method stub
+ if (convertView == null) {
+ convertView = inflater.inflate(R.layout.timing_video_item, null);
+ holder = new ViewHolder();
+ holder.tv_timing_time = (TextView) convertView.findViewById(R.id.tv_timing_time);
+ holder.tv_timing_week = (TextView) convertView.findViewById(R.id.tv_timing_week);
+
+ convertView.setTag(holder);
+ }else {
+ holder = (ViewHolder) convertView.getTag();
+ }
+ Map item = sdtiming.get(position);
+ int itemplan = item.entrySet().iterator().next().getValue();
+
+
+ holder.tv_timing_week.setText(getWeekPlan(itemplan));
+
+ int bStarttime = itemplan & 0x7ff;
+ int bEndTime = (itemplan >> 12) & 0x7ff;
+ holder.tv_timing_time.setText(getTime(bStarttime) + "-" + getTime(bEndTime));
+
+ int plankey = item.entrySet().iterator().next().getKey();
+ int plantime = item.entrySet().iterator().next().getValue();
+ sdtiming.get(position).put(plankey, plantime);
+ //cameraSetSDTiming.editPlanValid(plankey, plantime);
+
+ return convertView;
+ }
+ private class ViewHolder {
+ TextView tv_timing_time;
+ TextView tv_timing_week;
+
+
+ }
+ private String getWeekPlan(int time) {
+ String weekdays = "";
+ for (int i = 24; i < 31; i++) {
+ int weeks = (time >> i) & 1;
+ if (weeks == 1) {
+ switch (i) {
+ case 24:
+
+ weekdays = weekdays
+ + mContext.getResources().getString(R.string.plug_seven)
+ + " ";
+
+ break;
+ case 25:
+
+ weekdays = weekdays
+ + mContext.getResources().getString(R.string.plug_one)
+ + " ";
+
+ break;
+ case 26:
+
+ weekdays = weekdays
+ + mContext.getResources().getString(R.string.plug_two)
+ + " ";
+
+ break;
+ case 27:
+
+ weekdays = weekdays
+ + mContext.getResources().getString(R.string.plug_three)
+ + " ";
+
+ break;
+ case 28:
+
+ weekdays = weekdays
+ + mContext.getResources().getString(R.string.plug_four)
+ + " ";
+
+ break;
+ case 29:
+
+ weekdays = weekdays
+ + mContext.getResources().getString(R.string.plug_five)
+ + " ";
+
+ break;
+ case 30:
+
+ weekdays = weekdays
+ + mContext.getResources().getString(R.string.plug_six)
+ + " ";
+
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ return weekdays;
+ }
+
+ private String getTime(int time) {
+ if (time < 60) {
+ if (time < 10)
+ return "00:0" + time;
+ return "00:" + time;
+ }
+ int h = time / 60;
+ int m = time - (h * 60);
+ if (h < 10 && m < 10) {
+ return "0" + h + ":0" + m;
+ } else if (h > 9 && m < 10) {
+ return h + ":0" + m;
+ } else if (h < 10 && m > 9) {
+ return "0" + h + ":" + m;
+ }
+
+ return h + ":" + m;
+
+ }
+
+ public void addPlan(int key, int value) {
+ Map map = new HashMap();
+ map.put(key, value);
+ sdtiming.add(map);
+ int size = sdtiming.size();
+ for (int i = 0; i < size - 1; i++) {
+ for (int j = 1; j < size - i; j++) {
+ Map maps;
+ if (sdtiming
+ .get(j - 1)
+ .entrySet()
+ .iterator()
+ .next()
+ .getKey()
+ .compareTo(
+ sdtiming.get(j).entrySet().iterator().next()
+ .getKey()) > 0) {
+ maps = sdtiming.get(j - 1);
+ sdtiming.set(j - 1, sdtiming.get(j));
+ sdtiming.set(j, maps);
+ }
+ }
+ }
+
+ }
+
+ public void notify(int key, int value) {
+ int size = sdtiming.size();
+ for (int i = 0; i < size; i++) {
+ Map map = sdtiming.get(i);
+ if (map.containsKey(key)) {
+ map.put(key, value);
+ break;
+ }
+ }
+ }
+
+ public void removePlan(int key) {
+ int size = sdtiming.size();
+ for (int i = 0; i < size; i++) {
+ Map map = sdtiming.get(i);
+ if (map.containsKey(key)) {
+ sdtiming.remove(i);
+ break;
+ }
+ }
+ }
+
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/ViewPagerAdapter.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/ViewPagerAdapter.java
new file mode 100644
index 0000000..3933b3c
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/ViewPagerAdapter.java
@@ -0,0 +1,67 @@
+package com.ipcamera.detect.adapter;
+
+import java.util.List;
+
+import android.os.Parcelable;
+
+import androidx.viewpager.widget.PagerAdapter;
+import androidx.viewpager.widget.ViewPager;
+import android.view.View;
+
+public class ViewPagerAdapter extends PagerAdapter {
+ public List mListViews;
+
+ public ViewPagerAdapter(List mListViews) {
+ this.mListViews = mListViews;
+ }
+
+ @Override
+ public void destroyItem(View arg0, int arg1, Object arg2) {
+ // TODO Auto-generated method stub
+ ((ViewPager) arg0).removeView(mListViews.get(arg1));
+ }
+
+ @Override
+ public void finishUpdate(View arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public int getCount() {
+ // TODO Auto-generated method stub
+ return mListViews.size();
+ }
+
+ @Override
+ public Object instantiateItem(View arg0, int arg1) {
+ // TODO Auto-generated method stub
+ ((ViewPager) arg0).addView(mListViews.get(arg1), 0);
+ return mListViews.get(arg1);
+ }
+
+ @Override
+ public boolean isViewFromObject(View arg0, Object arg1) {
+ // TODO Auto-generated method stub
+ return arg0 == (arg1);
+ }
+
+ @Override
+ public void restoreState(Parcelable arg0, ClassLoader arg1) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public Parcelable saveState() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void startUpdate(View arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/WifiScanListAdapter.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/WifiScanListAdapter.java
new file mode 100644
index 0000000..5d1e52e
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/adapter/WifiScanListAdapter.java
@@ -0,0 +1,128 @@
+package com.ipcamera.detect.adapter;
+
+import java.util.ArrayList;
+
+import com.ipcamer.detect.R;
+import com.ipcamer.detect.R.drawable;
+import com.ipcamer.detect.R.id;
+import com.ipcamer.detect.R.layout;
+import com.ipcamer.detect.R.string;
+import com.ipcamera.detect.bean.WifiScanBean;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.TextView;
+
+public class WifiScanListAdapter extends BaseAdapter {
+
+ private Context context;
+ private LayoutInflater inflater;
+ private ArrayList list;
+ private ViewHolder holder;
+
+ public WifiScanListAdapter(Context context) {
+ this.context = context;
+ inflater = LayoutInflater.from(context);
+ list = new ArrayList();
+ }
+
+ @Override
+ public int getCount() {
+ return list.size();
+ }
+
+ @Override
+ public Object getItem(int position) {
+ return position;
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return position;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ if (convertView == null) {
+ convertView = inflater
+ .inflate(R.layout.settingwifi_list_item, null);
+ holder = new ViewHolder();
+ // holder.img = (ImageView) convertView.findViewById(R.id.img);
+ holder.ssid = (TextView) convertView.findViewById(R.id.ssid);
+ holder.safe = (TextView) convertView
+ .findViewById(R.id.wifi_scan_listitem_tv_safe);
+ holder.signal = (TextView) convertView
+ .findViewById(R.id.wifi_scan_listitem_tv_signal_strong);
+ convertView.setTag(holder);
+ } else {
+ holder = (ViewHolder) convertView.getTag();
+ }
+ if (list.size() == 0) {
+ convertView
+ .setBackgroundResource(R.drawable.listitem_one_pressed_selector);
+ } else if (position == 0) {
+ convertView
+ .setBackgroundResource(R.drawable.listitem_pressed_top_corner_selector);
+ } else if (position == list.size() - 1) {
+ convertView
+ .setBackgroundResource(R.drawable.listitem_pressed_bottom_corner_selector);
+ } else {
+ convertView
+ .setBackgroundResource(R.drawable.listitem_pressed_selector);
+ }
+ WifiScanBean wifiScanBean = list.get(position);
+ holder.ssid.setText(wifiScanBean.getSsid());
+ holder.signal.setText(wifiScanBean.getDbm0() + "%");
+ String safeName = "";
+ switch (wifiScanBean.getSecurity()) {
+ case 0:
+ safeName = context.getResources().getString(R.string.wifi_no_safe);
+ break;
+ case 1:
+ safeName = "WEP";
+ break;
+ case 2:
+ safeName = "WPA_PSK(AES)";
+ break;
+ case 3:
+ safeName = "WPA_PSK(TKIP)";
+ break;
+ case 4:
+ safeName = "WPA2_PSK(AES)";
+ break;
+ case 5:
+ safeName = "WPA2_PSK(TKIP)";
+ break;
+ default:
+ break;
+ }
+ holder.safe.setText(safeName);
+ return convertView;
+ }
+
+ public void addWifiScan(WifiScanBean wifiScanBean) {
+ list.add(wifiScanBean);
+ }
+
+ public void clearWifi() {
+ list.clear();
+ }
+
+ public WifiScanBean getWifiScan(int position) {
+ return list.get(position);
+ }
+
+ public ArrayList getWifiScanBeans() {
+ return list;
+ }
+
+ private class ViewHolder {
+ TextView ssid;
+ // ImageView img;
+ TextView signal;
+ TextView safe;
+ }
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/AlermBean.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/AlermBean.java
new file mode 100644
index 0000000..57e6577
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/AlermBean.java
@@ -0,0 +1,540 @@
+package com.ipcamera.detect.bean;
+
+import java.io.Serializable;
+
+public class AlermBean implements Serializable {
+ private static final long serialVersionUID = 1L;
+ private String did;
+ private int alarm_audio;
+ /**
+ * 是否勾选
+ */
+ private int audioArmedCheck;
+ private int alarm_temp;
+ private int alarmTempChecked;
+ private int motion_armed;
+ private int motion_sensitivity;
+ private int input_armed;
+ private int ioin_level;
+ private int ioout_level;
+ private int iolinkage;
+ private int alermpresetsit;
+ private int mail;
+ private int snapshot;
+ private int record;
+ private int upload_interval;
+ private int schedule_enable;
+ private int schedule_sun_0;
+ private int schedule_sun_1;
+ private int schedule_sun_2;
+ private int schedule_mon_0;
+ private int schedule_mon_1;
+ private int schedule_mon_2;
+ private int schedule_tue_0;
+ private int schedule_tue_1;
+ private int schedule_tue_2;
+ private int schedule_wed_0;
+ private int schedule_wed_1;
+ private int schedule_wed_2;
+
+ private int schedule_thu_0;
+ private int schedule_thu_1;
+ private int schedule_thu_2;
+ private int schedule_fri_0;
+ private int schedule_fri_1;
+ private int schedule_fri_2;
+ private int schedule_sat_0;
+ private int schedule_sat_1;
+ private int schedule_sat_2;
+
+ int defense_plan1;
+ int defense_plan2;
+ int defense_plan3;
+ int defense_plan4;
+ int defense_plan5;
+ int defense_plan6;
+ int defense_plan7;
+ int defense_plan8;
+ int defense_plan9;
+ int defense_plan10;
+ int defense_plan11;
+ int defense_plan12;
+ int defense_plan13;
+ int defense_plan14;
+ int defense_plan15;
+ int defense_plan16;
+ int defense_plan17;
+ int defense_plan18;
+ int defense_plan19;
+ int defense_plan20;
+ int defense_plan21;
+ public int getAudioArmedCheck() {
+ return audioArmedCheck;
+ }
+
+ public void setAudioArmedCheck(int audioArmedCheck) {
+ this.audioArmedCheck = audioArmedCheck;
+ }
+ public int getAlarmTempChecked() {
+ return alarmTempChecked;
+ }
+
+ public void setAlarmTempChecked(int alarmTempChecked) {
+ this.alarmTempChecked = alarmTempChecked;
+ }
+
+ public String getDid() {
+ return did;
+ }
+
+ public void setDid(String did) {
+ this.did = did;
+ }
+
+ public int getAlarm_temp() {
+ return alarm_temp;
+ }
+
+ public void setAlarm_temp(int alarm_temp) {
+ this.alarm_temp = alarm_temp;
+ }
+
+ public int getAlarm_audio() {
+ return alarm_audio;
+ }
+
+ public void setAlarm_audio(int alarm_audio) {
+ this.alarm_audio = alarm_audio;
+ }
+
+ public int getMotion_armed() {
+ return motion_armed;
+ }
+
+ public void setMotion_armed(int motion_armed) {
+ this.motion_armed = motion_armed;
+ }
+
+ public int getMotion_sensitivity() {
+ return motion_sensitivity;
+ }
+
+ public void setMotion_sensitivity(int motion_sensitivity) {
+ this.motion_sensitivity = motion_sensitivity;
+ }
+
+ public int getInput_armed() {
+ return input_armed;
+ }
+
+ public void setInput_armed(int input_armed) {
+ this.input_armed = input_armed;
+ }
+
+ public int getIoin_level() {
+ return ioin_level;
+ }
+
+ public int getIoout_level() {
+ return ioout_level;
+ }
+
+ public void setIoout_level(int ioout_level) {
+ this.ioout_level = ioout_level;
+ }
+
+ public void setIoin_level(int ioin_level) {
+ this.ioin_level = ioin_level;
+ }
+
+ public int getIolinkage() {
+ return iolinkage;
+ }
+
+ public void setIolinkage(int iolinkage) {
+ this.iolinkage = iolinkage;
+ }
+
+ public int getAlermpresetsit() {
+ return alermpresetsit;
+ }
+
+ public void setAlermpresetsit(int alermpresetsit) {
+ this.alermpresetsit = alermpresetsit;
+ }
+
+ public int getMail() {
+ return mail;
+ }
+
+ public void setMail(int mail) {
+ this.mail = mail;
+ }
+
+ public int getSnapshot() {
+ return snapshot;
+ }
+
+ public void setSnapshot(int snapshot) {
+ this.snapshot = snapshot;
+ }
+
+ public int getRecord() {
+ return record;
+ }
+
+ public void setRecord(int record) {
+ this.record = record;
+ }
+
+ public int getUpload_interval() {
+ return upload_interval;
+ }
+
+ public void setUpload_interval(int upload_interval) {
+ this.upload_interval = upload_interval;
+ }
+
+ public int getSchedule_enable() {
+ return schedule_enable;
+ }
+
+ public void setSchedule_enable(int schedule_enable) {
+ this.schedule_enable = schedule_enable;
+ }
+
+ public int getSchedule_sun_0() {
+ return schedule_sun_0;
+ }
+
+ public void setSchedule_sun_0(int schedule_sun_0) {
+ this.schedule_sun_0 = schedule_sun_0;
+ }
+
+ public int getSchedule_sun_1() {
+ return schedule_sun_1;
+ }
+
+ public void setSchedule_sun_1(int schedule_sun_1) {
+ this.schedule_sun_1 = schedule_sun_1;
+ }
+
+ public int getSchedule_sun_2() {
+ return schedule_sun_2;
+ }
+
+ public void setSchedule_sun_2(int schedule_sun_2) {
+ this.schedule_sun_2 = schedule_sun_2;
+ }
+
+ public int getSchedule_mon_0() {
+ return schedule_mon_0;
+ }
+
+ public void setSchedule_mon_0(int schedule_mon_0) {
+ this.schedule_mon_0 = schedule_mon_0;
+ }
+
+ public int getSchedule_mon_1() {
+ return schedule_mon_1;
+ }
+
+ public void setSchedule_mon_1(int schedule_mon_1) {
+ this.schedule_mon_1 = schedule_mon_1;
+ }
+
+ public int getSchedule_mon_2() {
+ return schedule_mon_2;
+ }
+
+ public void setSchedule_mon_2(int schedule_mon_2) {
+ this.schedule_mon_2 = schedule_mon_2;
+ }
+
+ public int getSchedule_tue_0() {
+ return schedule_tue_0;
+ }
+
+ public void setSchedule_tue_0(int schedule_tue_0) {
+ this.schedule_tue_0 = schedule_tue_0;
+ }
+
+ public int getSchedule_tue_1() {
+ return schedule_tue_1;
+ }
+
+ public void setSchedule_tue_1(int schedule_tue_1) {
+ this.schedule_tue_1 = schedule_tue_1;
+ }
+
+ public int getSchedule_tue_2() {
+ return schedule_tue_2;
+ }
+
+ public void setSchedule_tue_2(int schedule_tue_2) {
+ this.schedule_tue_2 = schedule_tue_2;
+ }
+
+ public int getSchedule_wed_0() {
+ return schedule_wed_0;
+ }
+
+ public void setSchedule_wed_0(int schedule_wed_0) {
+ this.schedule_wed_0 = schedule_wed_0;
+ }
+
+ public int getSchedule_wed_1() {
+ return schedule_wed_1;
+ }
+
+ public void setSchedule_wed_1(int schedule_wed_1) {
+ this.schedule_wed_1 = schedule_wed_1;
+ }
+
+ public int getSchedule_wed_2() {
+ return schedule_wed_2;
+ }
+
+ public void setSchedule_wed_2(int schedule_wed_2) {
+ this.schedule_wed_2 = schedule_wed_2;
+ }
+
+ public int getSchedule_thu_0() {
+ return schedule_thu_0;
+ }
+
+ public void setSchedule_thu_0(int schedule_thu_0) {
+ this.schedule_thu_0 = schedule_thu_0;
+ }
+
+ public int getSchedule_thu_1() {
+ return schedule_thu_1;
+ }
+
+ public void setSchedule_thu_1(int schedule_thu_1) {
+ this.schedule_thu_1 = schedule_thu_1;
+ }
+
+ public int getSchedule_thu_2() {
+ return schedule_thu_2;
+ }
+
+ public void setSchedule_thu_2(int schedule_thu_2) {
+ this.schedule_thu_2 = schedule_thu_2;
+ }
+
+ public int getSchedule_fri_0() {
+ return schedule_fri_0;
+ }
+
+ public void setSchedule_fri_0(int schedule_fri_0) {
+ this.schedule_fri_0 = schedule_fri_0;
+ }
+
+ public int getSchedule_fri_1() {
+ return schedule_fri_1;
+ }
+
+ public void setSchedule_fri_1(int schedule_fri_1) {
+ this.schedule_fri_1 = schedule_fri_1;
+ }
+
+ public int getSchedule_fri_2() {
+ return schedule_fri_2;
+ }
+
+ public void setSchedule_fri_2(int schedule_fri_2) {
+ this.schedule_fri_2 = schedule_fri_2;
+ }
+
+ public int getSchedule_sat_0() {
+ return schedule_sat_0;
+ }
+
+ public void setSchedule_sat_0(int schedule_sat_0) {
+ this.schedule_sat_0 = schedule_sat_0;
+ }
+
+ public int getSchedule_sat_1() {
+ return schedule_sat_1;
+ }
+
+ public void setSchedule_sat_1(int schedule_sat_1) {
+ this.schedule_sat_1 = schedule_sat_1;
+ }
+
+ public int getSchedule_sat_2() {
+ return schedule_sat_2;
+ }
+
+ public void setSchedule_sat_2(int schedule_sat_2) {
+ this.schedule_sat_2 = schedule_sat_2;
+ }
+
+ public int getDefense_plan1() {
+ return defense_plan1;
+ }
+ public void setDefense_plan1(int defense_plan1) {
+ this.defense_plan1 = defense_plan1;
+ }
+ public int getDefense_plan2() {
+ return defense_plan2;
+ }
+ public void setDefense_plan2(int defense_plan2) {
+ this.defense_plan2 = defense_plan2;
+ }
+ public int getDefense_plan3() {
+ return defense_plan3;
+ }
+ public void setDefense_plan3(int defense_plan3) {
+ this.defense_plan3 = defense_plan3;
+ }
+ public int getDefense_plan4() {
+ return defense_plan4;
+ }
+ public void setDefense_plan4(int defense_plan4) {
+ this.defense_plan4 = defense_plan4;
+ }
+ public int getDefense_plan5() {
+ return defense_plan5;
+ }
+ public void setDefense_plan5(int defense_plan5) {
+ this.defense_plan5 = defense_plan5;
+ }
+ public int getDefense_plan6() {
+ return defense_plan6;
+ }
+ public void setDefense_plan6(int defense_plan6) {
+ this.defense_plan6 = defense_plan6;
+ }
+ public int getDefense_plan7() {
+ return defense_plan7;
+ }
+ public void setDefense_plan7(int defense_plan7) {
+ this.defense_plan7 = defense_plan7;
+ }
+ public int getDefense_plan8() {
+ return defense_plan8;
+ }
+ public void setDefense_plan8(int defense_plan8) {
+ this.defense_plan8 = defense_plan8;
+ }
+ public int getDefense_plan9() {
+ return defense_plan9;
+ }
+ public void setDefense_plan9(int defense_plan9) {
+ this.defense_plan9 = defense_plan9;
+ }
+ public int getDefense_plan10() {
+ return defense_plan10;
+ }
+ public void setDefense_plan10(int defense_plan10) {
+ this.defense_plan10 = defense_plan10;
+ }
+ public int getDefense_plan11() {
+ return defense_plan11;
+ }
+ public void setDefense_plan11(int defense_plan11) {
+ this.defense_plan11 = defense_plan11;
+ }
+ public int getDefense_plan12() {
+ return defense_plan12;
+ }
+ public void setDefense_plan12(int defense_plan12) {
+ this.defense_plan12 = defense_plan12;
+ }
+ public int getDefense_plan13() {
+ return defense_plan13;
+ }
+ public void setDefense_plan13(int defense_plan13) {
+ this.defense_plan13 = defense_plan13;
+ }
+ public int getDefense_plan14() {
+ return defense_plan14;
+ }
+ public void setDefense_plan14(int defense_plan14) {
+ this.defense_plan14 = defense_plan14;
+ }
+ public int getDefense_plan15() {
+ return defense_plan15;
+ }
+ public void setDefense_plan15(int defense_plan15) {
+ this.defense_plan15 = defense_plan15;
+ }
+ public int getDefense_plan16() {
+ return defense_plan16;
+ }
+ public void setDefense_plan16(int defense_plan16) {
+ this.defense_plan16 = defense_plan16;
+ }
+ public int getDefense_plan17() {
+ return defense_plan17;
+ }
+ public void setDefense_plan17(int defense_plan17) {
+ this.defense_plan17 = defense_plan17;
+ }
+ public int getDefense_plan18() {
+ return defense_plan18;
+ }
+ public void setDefense_plan18(int defense_plan18) {
+ this.defense_plan18 = defense_plan18;
+ }
+ public int getDefense_plan19() {
+ return defense_plan19;
+ }
+ public void setDefense_plan19(int defense_plan19) {
+ this.defense_plan19 = defense_plan19;
+ }
+ public int getDefense_plan20() {
+ return defense_plan20;
+ }
+ public void setDefense_plan20(int defense_plan20) {
+ this.defense_plan20 = defense_plan20;
+ }
+ public int getDefense_plan21() {
+ return defense_plan21;
+ }
+ public void setDefense_plan21(int defense_plan21) {
+ this.defense_plan21 = defense_plan21;
+ }
+ @Override
+ public String toString() {
+ return "AlermBean [did=" + did + ", motion_armed=" + motion_armed
+ + ", motion_sensitivity=" + motion_sensitivity
+ + ", input_armed=" + input_armed + ", ioin_level=" + ioin_level
+ + ", ioout_level=" + ioout_level + ", iolinkage=" + iolinkage
+ + ", alermpresetsit=" + alermpresetsit + ", mail=" + mail
+ + ", snapshot=" + snapshot + ", record=" + record
+ + ", alarm_audio=" + alarm_audio + ", upload_interval="
+ + upload_interval + ", schedule_enable=" + schedule_enable
+ + ", schedule_sun_0=" + schedule_sun_0 + ", schedule_sun_1="
+ + schedule_sun_1 + ", schedule_sun_2=" + schedule_sun_2
+ + ", schedule_mon_0=" + schedule_mon_0 + ", schedule_mon_1="
+ + schedule_mon_1 + ", schedule_mon_2=" + schedule_mon_2
+ + ", schedule_tue_0=" + schedule_tue_0 + ", schedule_tue_1="
+ + schedule_tue_1 + ", schedule_tue_2=" + schedule_tue_2
+ + ", schedule_wed_0=" + schedule_wed_0 + ", schedule_wed_1="
+ + schedule_wed_1 + ", schedule_wed_2=" + schedule_wed_2
+ + ", schedule_thu_0=" + schedule_thu_0 + ", schedule_thu_1="
+ + schedule_thu_1 + ", schedule_thu_2=" + schedule_thu_2
+ + ", schedule_fri_0=" + schedule_fri_0 + ", schedule_fri_1="
+ + schedule_fri_1 + ", schedule_fri_2=" + schedule_fri_2
+ + ", schedule_sat_0=" + schedule_sat_0 + ", schedule_sat_1="
+ + schedule_sat_1 + ", schedule_sat_2=" + schedule_sat_2
+ + ", defense_plan1=" + defense_plan1 + ", defense_plan2="
+ + defense_plan2 + ", defense_plan3=" + defense_plan3
+ + ", defense_plan4=" + defense_plan4 + ", defense_plan5="
+ + defense_plan5 + ", defense_plan6=" + defense_plan6
+ + ", defense_plan7=" + defense_plan7 + ", defense_plan8="
+ + defense_plan8 + ", defense_plan9=" + defense_plan9
+ + ", defense_plan10=" + defense_plan10 + ", defense_plan11="
+ + defense_plan11 + ", defense_plan12=" + defense_plan12
+ + ", defense_plan13=" + defense_plan13 + ", defense_plan14="
+ + defense_plan14 + ", defense_plan15=" + defense_plan15
+ + ", defense_plan16=" + defense_plan16 + ", defense_plan17="
+ + defense_plan17 + ", defense_plan18=" + defense_plan18
+ + ", defense_plan19=" + defense_plan19 + ", defense_plan20="
+ + defense_plan20 + ", defense_plan21=" + defense_plan21 + "]";
+ }
+
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/DefenseConstant.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/DefenseConstant.java
new file mode 100644
index 0000000..ba7a60d
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/DefenseConstant.java
@@ -0,0 +1,17 @@
+package com.ipcamera.detect.bean;
+
+public class DefenseConstant {
+
+ public static String key_Monday="key1";
+ public static String key_Tuesday="key2";
+ public static String key_Wednesday="key3";
+ public static String key_Thursday="key4";
+ public static String key_Friday="key5";
+ public static String key_Saturday="key6";
+ public static String key_Sunday="key7";
+
+ public static String key_allAlarm="111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111";
+ public static String key_allDisAlarm="000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
+
+
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/DoorBean.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/DoorBean.java
new file mode 100644
index 0000000..456bf2c
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/DoorBean.java
@@ -0,0 +1,48 @@
+package com.ipcamera.detect.bean;
+
+public class DoorBean {
+ public String name;
+ public int status;
+ public String sensoridTag;
+
+ public DoorBean() {
+ // TODO Auto-generated constructor stub
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public int getStatus() {
+ return status;
+ }
+
+ public void setStatus(int status) {
+ this.status = status;
+ }
+
+ public String getSensoridTag() {
+ return sensoridTag;
+ }
+
+ public void setSensoridTag(String sensoridTag) {
+ this.sensoridTag = sensoridTag;
+ }
+
+ @Override
+ public String toString() {
+ return "DoorBean [name=" + name + ", status=" + status
+ + ", sensoridTag=" + sensoridTag + "]";
+ }
+
+
+
+
+
+
+
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/ErrorBean.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/ErrorBean.java
new file mode 100644
index 0000000..07769eb
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/ErrorBean.java
@@ -0,0 +1,40 @@
+package com.ipcamera.detect.bean;
+
+/*
+ * 编写:vst on
+ * //
+ * //
+ */
+public class ErrorBean {
+ private int errorCode;
+ private String errorMsg;
+
+ public ErrorBean(int errorCode, String errorMsg) {
+ this.errorCode = errorCode;
+ this.errorMsg = errorMsg;
+ }
+
+ public int getErrorCode() {
+ return errorCode;
+ }
+
+ public void setErrorCode(int errorCode) {
+ this.errorCode = errorCode;
+ }
+
+ public String getErrorMsg() {
+ return errorMsg;
+ }
+
+ public void setErrorMsg(String errorMsg) {
+ this.errorMsg = errorMsg;
+ }
+
+ @Override
+ public String toString() {
+ return "ErrorBean{" +
+ "errorCode=" + errorCode +
+ ", errorMsg='" + errorMsg + '\'' +
+ '}';
+ }
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/JsonBean.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/JsonBean.java
new file mode 100644
index 0000000..2183b0c
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/JsonBean.java
@@ -0,0 +1,40 @@
+package com.ipcamera.detect.bean;
+
+/*
+ * 编写:vst on 2017/5/5 14:03
+ * //
+ * //
+ */
+public class JsonBean {
+ private int code;
+ private String json;
+
+ public JsonBean(int code, String json) {
+ this.code = code;
+ this.json = json;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public String getJson() {
+ return json;
+ }
+
+ public void setJson(String json) {
+ this.json = json;
+ }
+
+ @Override
+ public String toString() {
+ return "JsonBean{" +
+ "code=" + code +
+ ", json='" + json + '\'' +
+ '}';
+ }
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/MessageBean.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/MessageBean.java
new file mode 100644
index 0000000..ff2e58e
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/MessageBean.java
@@ -0,0 +1,66 @@
+package com.ipcamera.detect.bean;
+
+public class MessageBean {
+ private String encryp;
+ private String ran;
+
+ private String uid;
+
+ private String recordDate;
+
+ private String date;
+
+ private String dz;
+
+ public void setDz(String dz) {
+ this.dz = dz;
+ }
+
+ public String getDz() {
+ return dz;
+ }
+
+ public void setEncryp(String encryp) {
+ this.encryp = encryp;
+ }
+
+ public String getEncryp() {
+ return encryp;
+ }
+
+
+ public void setRan(String ran) {
+ this.ran = ran;
+ }
+
+
+ public String getRan() {
+ return ran;
+ }
+
+ public String getUid() {
+ return uid;
+ }
+
+ public void setUid(String uid) {
+ this.uid = uid;
+ }
+
+ public void setDate(String date) {
+ this.date = date;
+ }
+
+
+ public String getDate() {
+ return date;
+ }
+
+
+ public void setRecordDate(String recordDate) {
+ this.recordDate = recordDate;
+ }
+
+ public String getRecordDate() {
+ return recordDate;
+ }
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/PushBindDeviceBean.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/PushBindDeviceBean.java
new file mode 100644
index 0000000..fd4f909
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/PushBindDeviceBean.java
@@ -0,0 +1,65 @@
+package com.ipcamera.detect.bean;
+
+/*
+ * 编写:vst on 2017/10/30 17:22
+ * //
+ * //
+ */
+public class PushBindDeviceBean {
+ private String uid;
+ private String token;
+ private String oemid;
+ private String encryp;
+ private String ran;
+ private String date;
+
+
+
+ public String getDate() {
+ return date;
+ }
+
+ public void setDate(String date) {
+ this.date = date;
+ }
+
+ public String getEncryp() {
+ return encryp;
+ }
+
+ public void setEncryp(String encryp) {
+ this.encryp = encryp;
+ }
+
+ public String getOemid() {
+ return oemid;
+ }
+
+ public void setOemid(String oemid) {
+ this.oemid = oemid;
+ }
+
+ public String getRan() {
+ return ran;
+ }
+
+ public void setRan(String ran) {
+ this.ran = ran;
+ }
+
+ public String getToken() {
+ return token;
+ }
+
+ public void setToken(String token) {
+ this.token = token;
+ }
+
+ public String getUid() {
+ return uid;
+ }
+
+ public void setUid(String uid) {
+ this.uid = uid;
+ }
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/SdcardBean.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/SdcardBean.java
new file mode 100644
index 0000000..44efe7f
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/SdcardBean.java
@@ -0,0 +1,231 @@
+package com.ipcamera.detect.bean;
+
+import java.io.Serializable;
+
+public class SdcardBean implements Serializable {
+ private static final long serialVersionUID = 1L;
+ private String did;
+ private int record_conver_enable;
+ private int record_timer;
+ private int record_size;
+ private int record_time_enable;
+ private int record_sd_status;
+ public int getRecord_chnl() {
+ return record_chnl;
+ }
+ public void setRecord_chnl(int record_chnl) {
+ this.record_chnl = record_chnl;
+ }
+ private int record_chnl;
+ private int sdtotal;
+ private int sdfree;
+ private int sun_0;
+ private int sun_1;
+ private int sun_2;
+ private int mon_0;
+ private int mon_1;
+ private int mon_2;
+ private int tue_0;
+ private int tue_1;
+ private int tue_2;
+ private int wed_0;
+ private int wed_1;
+ private int wed_2;
+ private int thu_0;
+ private int thu_1;
+ private int thu_2;
+ private int fri_0;
+ private int fri_1;
+ private int fri_2;
+ private int sat_0;
+ private int sat_1;
+ private int sat_2;
+ private int enable_audio;
+
+ public int getEnable_audio() {
+ return enable_audio;
+ }
+ public void setEnable_audio(int enable_audio) {
+ this.enable_audio = enable_audio;
+ }
+
+
+ public String getDid() {
+ return did;
+ }
+ public void setDid(String did) {
+ this.did = did;
+ }
+ public int getRecord_conver_enable() {
+ return record_conver_enable;
+ }
+ public void setRecord_conver_enable(int record_conver_enable) {
+ this.record_conver_enable = record_conver_enable;
+ }
+ public int getRecord_timer() {
+ return record_timer;
+ }
+ public void setRecord_timer(int record_timer) {
+ this.record_timer = record_timer;
+ }
+ public int getRecord_size() {
+ return record_size;
+ }
+ public void setRecord_size(int record_size) {
+ this.record_size = record_size;
+ }
+ public int getRecord_time_enable() {
+ return record_time_enable;
+ }
+ public void setRecord_time_enable(int record_time_enable) {
+ this.record_time_enable = record_time_enable;
+ }
+ public int getRecord_sd_status() {
+ return record_sd_status;
+ }
+ public void setRecord_sd_status(int record_sd_status) {
+ this.record_sd_status = record_sd_status;
+ }
+ public int getSdtotal() {
+ return sdtotal;
+ }
+ public void setSdtotal(int sdtotal) {
+ this.sdtotal = sdtotal;
+ }
+ public int getSdfree() {
+ return sdfree;
+ }
+ public void setSdfree(int sdfree) {
+ this.sdfree = sdfree;
+ }
+ public int getSun_0() {
+ return sun_0;
+ }
+ public void setSun_0(int sun_0) {
+ this.sun_0 = sun_0;
+ }
+ public int getSun_1() {
+ return sun_1;
+ }
+ public void setSun_1(int sun_1) {
+ this.sun_1 = sun_1;
+ }
+ public int getSun_2() {
+ return sun_2;
+ }
+ public void setSun_2(int sun_2) {
+ this.sun_2 = sun_2;
+ }
+ public int getMon_0() {
+ return mon_0;
+ }
+ public void setMon_0(int mon_0) {
+ this.mon_0 = mon_0;
+ }
+ public int getMon_1() {
+ return mon_1;
+ }
+ public void setMon_1(int mon_1) {
+ this.mon_1 = mon_1;
+ }
+ public int getMon_2() {
+ return mon_2;
+ }
+ public void setMon_2(int mon_2) {
+ this.mon_2 = mon_2;
+ }
+ public int getTue_0() {
+ return tue_0;
+ }
+ public void setTue_0(int tue_0) {
+ this.tue_0 = tue_0;
+ }
+ public int getTue_1() {
+ return tue_1;
+ }
+ public void setTue_1(int tue_1) {
+ this.tue_1 = tue_1;
+ }
+ public int getTue_2() {
+ return tue_2;
+ }
+ public void setTue_2(int tue_2) {
+ this.tue_2 = tue_2;
+ }
+ public int getWed_0() {
+ return wed_0;
+ }
+ public void setWed_0(int wed_0) {
+ this.wed_0 = wed_0;
+ }
+ public int getWed_1() {
+ return wed_1;
+ }
+ public void setWed_1(int wed_1) {
+ this.wed_1 = wed_1;
+ }
+ public int getWed_2() {
+ return wed_2;
+ }
+ public void setWed_2(int wed_2) {
+ this.wed_2 = wed_2;
+ }
+ public int getThu_0() {
+ return thu_0;
+ }
+ public void setThu_0(int thu_0) {
+ this.thu_0 = thu_0;
+ }
+ public int getThu_1() {
+ return thu_1;
+ }
+ public void setThu_1(int thu_1) {
+ this.thu_1 = thu_1;
+ }
+ public int getThu_2() {
+ return thu_2;
+ }
+ public void setThu_2(int thu_2) {
+ this.thu_2 = thu_2;
+ }
+ public int getFri_0() {
+ return fri_0;
+ }
+ public void setFri_0(int fri_0) {
+ this.fri_0 = fri_0;
+ }
+ public int getFri_1() {
+ return fri_1;
+ }
+ public void setFri_1(int fri_1) {
+ this.fri_1 = fri_1;
+ }
+ public int getFri_2() {
+ return fri_2;
+ }
+ public void setFri_2(int fri_2) {
+ this.fri_2 = fri_2;
+ }
+ public int getSat_0() {
+ return sat_0;
+ }
+ public void setSat_0(int sat_0) {
+ this.sat_0 = sat_0;
+ }
+ public int getSat_1() {
+ return sat_1;
+ }
+ public void setSat_1(int sat_1) {
+ this.sat_1 = sat_1;
+ }
+ public int getSat_2() {
+ return sat_2;
+ }
+ public void setSat_2(int sat_2) {
+ this.sat_2 = sat_2;
+ }
+
+
+
+}
+
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/SetLanguageBean.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/SetLanguageBean.java
new file mode 100644
index 0000000..acbf119
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/SetLanguageBean.java
@@ -0,0 +1,72 @@
+package com.ipcamera.detect.bean;
+
+/*
+ * 编写:vst on
+ * //
+ * //
+ */
+public class SetLanguageBean {
+ private String uid;
+ private String token;
+ private String oemid;
+ private String encryp;
+ private String ran;
+ private String date;
+ private String language;
+
+ public String getDate() {
+ return date;
+ }
+
+ public void setDate(String date) {
+ this.date = date;
+ }
+
+ public String getEncryp() {
+ return encryp;
+ }
+
+ public void setEncryp(String encryp) {
+ this.encryp = encryp;
+ }
+
+ public String getLanguage() {
+ return language;
+ }
+
+ public void setLanguage(String language) {
+ this.language = language;
+ }
+
+ public String getOemid() {
+ return oemid;
+ }
+
+ public void setOemid(String oemid) {
+ this.oemid = oemid;
+ }
+
+ public String getRan() {
+ return ran;
+ }
+
+ public void setRan(String ran) {
+ this.ran = ran;
+ }
+
+ public String getToken() {
+ return token;
+ }
+
+ public void setToken(String token) {
+ this.token = token;
+ }
+
+ public String getUid() {
+ return uid;
+ }
+
+ public void setUid(String uid) {
+ this.uid = uid;
+ }
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/SwitchBean.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/SwitchBean.java
new file mode 100644
index 0000000..63f07f4
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/SwitchBean.java
@@ -0,0 +1,60 @@
+package com.ipcamera.detect.bean;
+
+import java.io.Serializable;
+
+public class SwitchBean implements Serializable{
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ private String motion_record_plan_enable; //移动侦测录像计划
+ private String motion_push_plan_enable; //移动侦测推送计划
+ private String record_plan_enable; //计划录像
+ private int has_record_plan; //是否有计划录像
+ public int getHas_record_plan() {
+ return has_record_plan;
+ }
+ public void setHas_record_plan(int has_record_plan) {
+ this.has_record_plan = has_record_plan;
+ }
+
+
+ private int oldfirmware; //区分新旧固件
+
+
+
+ public int getOldfirmware() {
+ return oldfirmware;
+ }
+ public void setOldfirmware(int oldfirmware) {
+ this.oldfirmware = oldfirmware;
+ }
+
+ public String getMotion_record_plan_enable() {
+ return motion_record_plan_enable;
+ }
+ public void setMotion_record_plan_enable(String motion_record_plan_enable) {
+ this.motion_record_plan_enable = motion_record_plan_enable;
+ }
+ public String getMotion_push_plan_enable() {
+ return motion_push_plan_enable;
+ }
+ public void setMotion_push_plan_enable(String motion_push_plan_enable) {
+ this.motion_push_plan_enable = motion_push_plan_enable;
+ }
+ public String getRecord_plan_enable() {
+ return record_plan_enable;
+ }
+ public void setRecord_plan_enable(String record_plan_enable) {
+ this.record_plan_enable = record_plan_enable;
+ }
+
+
+ @Override
+ public String toString() {
+ return "SdcardBean [motion_record_plan_enable=" + motion_record_plan_enable + ", motion_push_plan_enable=" + motion_push_plan_enable
+ + ", record_plan_enable=" + record_plan_enable
+ + "]";
+ }
+
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/WifiScanBean.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/WifiScanBean.java
new file mode 100644
index 0000000..06a5737
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/bean/WifiScanBean.java
@@ -0,0 +1,90 @@
+package com.ipcamera.detect.bean;
+
+import java.io.Serializable;
+
+public class WifiScanBean implements Serializable {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ private String did;
+ private String ssid;
+ private String mac;
+ private int security;
+ private int dbm0;
+ private int dbm1;
+ private int mode;
+ private int channel;
+
+ public String getDid() {
+ return did;
+ }
+
+ public void setDid(String did) {
+ this.did = did;
+ }
+
+ public String getSsid() {
+ return ssid;
+ }
+
+ public void setSsid(String ssid) {
+ this.ssid = ssid;
+ }
+
+ public String getMac() {
+ return mac;
+ }
+
+ public void setMac(String mac) {
+ this.mac = mac;
+ }
+
+ public int getSecurity() {
+ return security;
+ }
+
+ public void setSecurity(int security) {
+ this.security = security;
+ }
+
+ public int getDbm0() {
+ return dbm0;
+ }
+
+ public void setDbm0(int dbm0) {
+ this.dbm0 = dbm0;
+ }
+
+ public int getDbm1() {
+ return dbm1;
+ }
+
+ public void setDbm1(int dbm1) {
+ this.dbm1 = dbm1;
+ }
+
+ public int getMode() {
+ return mode;
+ }
+
+ public void setMode(int mode) {
+ this.mode = mode;
+ }
+
+ public int getChannel() {
+ return channel;
+ }
+
+ public void setChannel(int channel) {
+ this.channel = channel;
+ }
+
+ @Override
+ public String toString() {
+ return "WifiScanBean [did=" + did + ", ssid=" + ssid + ", mac=" + mac
+ + ", security=" + security + ", dbm0=" + dbm0 + ", dbm1="
+ + dbm1 + ", mode=" + mode + ", channel=" + channel + "]";
+ }
+
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/model/TensorFlowObjectDetectionAPIModel.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/model/TensorFlowObjectDetectionAPIModel.java
new file mode 100644
index 0000000..6adac69
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/model/TensorFlowObjectDetectionAPIModel.java
@@ -0,0 +1,224 @@
+/* Copyright 2016 The TensorFlow Authors. All Rights Reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+==============================================================================*/
+
+package com.ipcamera.detect.model;
+
+import android.annotation.SuppressLint;
+import android.content.res.AssetManager;
+import android.graphics.Bitmap;
+import android.graphics.RectF;
+import android.os.Trace;
+
+import com.ipcamera.detect.Classifier;
+
+import org.tensorflow.Graph;
+import org.tensorflow.Operation;
+import org.tensorflow.contrib.android.TensorFlowInferenceInterface;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+import java.util.PriorityQueue;
+import java.util.Vector;
+
+/**
+ *
+ * 检测图形并且绘制(规则图形矩形)
+ */
+public class TensorFlowObjectDetectionAPIModel implements Classifier {
+// private static final Logger LOGGER = new Logger();
+
+ // Only return this many results.
+ private static final int MAX_RESULTS = 100;
+
+ // Config values.
+ private String inputName;
+ private int inputSize;
+
+ // Pre-allocated buffers.
+ private Vector labels = new Vector();
+ private int[] intValues;
+ private byte[] byteValues;
+ private float[] outputLocations;
+ private float[] outputScores;
+ private float[] outputClasses;
+ private float[] outputNumDetections;
+ private String[] outputNames;
+
+ private boolean logStats = false;
+
+ private TensorFlowInferenceInterface inferenceInterface;
+
+ /**
+ * Initializes a native TensorFlow session for classifying images.
+ *
+ * @param assetManager The asset manager to be used to load assets.
+ * @param modelFilename The filepath of the model GraphDef protocol buffer.
+ * @param labelFilename The filepath of label file for classes.
+ */
+ public static Classifier create(
+ final AssetManager assetManager,
+ final String modelFilename,
+ final String labelFilename,
+ final int inputSize) throws IOException {
+ final TensorFlowObjectDetectionAPIModel d = new TensorFlowObjectDetectionAPIModel();
+
+ InputStream labelsInput = null;
+ String actualFilename = labelFilename.split("file:///android_asset/")[1];
+ labelsInput = assetManager.open(actualFilename);
+ BufferedReader br = null;
+ br = new BufferedReader(new InputStreamReader(labelsInput));
+ String line;
+ while ((line = br.readLine()) != null) {
+// LOGGER.w(line);
+ d.labels.add(line);
+ }
+ br.close();
+
+
+ d.inferenceInterface = new TensorFlowInferenceInterface(assetManager, modelFilename);
+
+ final Graph g = d.inferenceInterface.graph();
+
+ d.inputName = "image_tensor";
+ // The inputName node has a shape of [N, H, W, C], where
+ // N is the batch size
+ // H = W are the height and width
+ // C is the number of channels (3 for our purposes - RGB)
+ final Operation inputOp = g.operation(d.inputName);
+ if (inputOp == null) {
+ throw new RuntimeException("Failed to find input Node '" + d.inputName + "'");
+ }
+ d.inputSize = inputSize;
+ // The outputScoresName node has a shape of [N, NumLocations], where N
+ // is the batch size.
+ final Operation outputOp1 = g.operation("detection_scores");
+ if (outputOp1 == null) {
+ throw new RuntimeException("Failed to find output Node 'detection_scores'");
+ }
+ final Operation outputOp2 = g.operation("detection_boxes");
+ if (outputOp2 == null) {
+ throw new RuntimeException("Failed to find output Node 'detection_boxes'");
+ }
+ final Operation outputOp3 = g.operation("detection_classes");
+ if (outputOp3 == null) {
+ throw new RuntimeException("Failed to find output Node 'detection_classes'");
+ }
+
+ // Pre-allocate buffers.
+ d.outputNames = new String[] {"detection_boxes", "detection_scores",
+ "detection_classes", "num_detections"};
+ d.intValues = new int[d.inputSize * d.inputSize];
+ d.byteValues = new byte[d.inputSize * d.inputSize * 3];
+ d.outputScores = new float[MAX_RESULTS];
+ d.outputLocations = new float[MAX_RESULTS * 4];
+ d.outputClasses = new float[MAX_RESULTS];
+ d.outputNumDetections = new float[1];
+ return d;
+ }
+
+ private TensorFlowObjectDetectionAPIModel() {}
+
+ @SuppressLint("NewApi")
+ @Override
+ public List recognizeImage(final Bitmap bitmap) {
+ // Log this method so that it can be analyzed with systrace.
+ Trace.beginSection("recognizeImage");
+
+ Trace.beginSection("preprocessBitmap");
+ // Preprocess the image data from 0-255 int to normalized float based
+ // on the provided parameters.
+ bitmap.getPixels(intValues, 0, bitmap.getWidth(), 0, 0, bitmap.getWidth(), bitmap.getHeight());
+
+ for (int i = 0; i < intValues.length; ++i) {
+ byteValues[i * 3 + 2] = (byte) intValues[i] ;
+ byteValues[i * 3 + 1] = (byte) (intValues[i] >> 8);
+ byteValues[i * 3 + 0] = (byte) (intValues[i] >> 16) ;
+ }
+ Trace.endSection(); // preprocessBitmap
+
+ // Copy the input data into TensorFlow.
+ Trace.beginSection("feed");
+ inferenceInterface.feed(inputName, byteValues, 1, inputSize, inputSize, 3);
+ Trace.endSection();
+
+ // Run the inference call.
+ Trace.beginSection("run");
+ inferenceInterface.run(outputNames, logStats);
+ Trace.endSection();
+
+ // Copy the output Tensor back into the output array.
+ Trace.beginSection("fetch");
+ outputLocations = new float[MAX_RESULTS * 4];
+ outputScores = new float[MAX_RESULTS];
+ outputClasses = new float[MAX_RESULTS];
+ outputNumDetections = new float[1];
+ inferenceInterface.fetch(outputNames[0], outputLocations);
+ inferenceInterface.fetch(outputNames[1], outputScores);
+ inferenceInterface.fetch(outputNames[2], outputClasses);
+ inferenceInterface.fetch(outputNames[3], outputNumDetections);
+ Trace.endSection();
+
+ // Find the best detections.
+ final PriorityQueue pq =
+ new PriorityQueue(
+ 1,
+ new Comparator() {
+ @Override
+ public int compare(final Recognition lhs, final Recognition rhs) {
+ // Intentionally reversed to put high confidence at the head of the queue.
+ return Float.compare(rhs.getConfidence(), lhs.getConfidence());
+ }
+ });
+
+ // Scale them back to the input size.
+ for (int i = 0; i < outputScores.length; ++i) {
+ final RectF detection =
+ new RectF(
+ outputLocations[4 * i + 1] * inputSize,
+ outputLocations[4 * i] * inputSize,
+ outputLocations[4 * i + 3] * inputSize,
+ outputLocations[4 * i + 2] * inputSize);
+ pq.add(
+ new Recognition("" + i, labels.get((int) outputClasses[i]), outputScores[i], detection));
+ }
+
+ final ArrayList recognitions = new ArrayList();
+ for (int i = 0; i < Math.min(pq.size(), MAX_RESULTS); ++i) {
+ recognitions.add(pq.poll());
+ }
+ Trace.endSection(); // "recognizeImage"
+ return recognitions;
+ }
+
+ @Override
+ public void enableStatLogging(final boolean logStats) {
+ this.logStats = logStats;
+ }
+
+ @Override
+ public String getStatString() {
+ return inferenceInterface.getStatString();
+ }
+
+ @Override
+ public void close() {
+ inferenceInterface.close();
+ }
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/net/ApiCallBack.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/net/ApiCallBack.java
new file mode 100644
index 0000000..ed81bf8
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/net/ApiCallBack.java
@@ -0,0 +1,15 @@
+package com.ipcamera.detect.net;
+
+
+import com.ipcamera.detect.bean.ErrorBean;
+import com.ipcamera.detect.bean.JsonBean;
+
+/*
+ * 编写:vst on 2017/9/28 18:21
+ * //
+ * //
+ */
+public abstract interface ApiCallBack {
+ void onFinish(JsonBean bean);
+ void onError(ErrorBean bean);
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/net/BaseCallback.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/net/BaseCallback.java
new file mode 100644
index 0000000..be8b367
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/net/BaseCallback.java
@@ -0,0 +1,46 @@
+package com.ipcamera.detect.net;
+
+
+import okhttp3.Request;
+
+public abstract class BaseCallback {
+
+
+ /*public Type mType;
+
+ static Type getSuperclassTypeParameter(Class> subclass) {
+ Type superclass = subclass.getGenericSuperclass();
+ if (superclass instanceof Class) {
+ throw new RuntimeException("Missing type parameter.");
+ }
+ ParameterizedType parameterized = (ParameterizedType) superclass;
+ return $Gson$Types.canonicalize(parameterized.getActualTypeArguments()[0]);
+ }*/
+
+
+ public BaseCallback() {
+ // mType = getSuperclassTypeParameter(getClass());
+ }
+
+ /**
+ * 请求前,加载圈可以写在这里
+ * @param request
+ */
+ //public abstract void onBeforeRequest(Request request);
+
+
+ /**
+ * 请求失败
+ * @param request
+ * @param e
+ */
+ public abstract void onFailure(Request request, Exception e);
+
+
+ /**
+ * 请求成功时调用此方法
+ *
+ * @param json
+ */
+ public abstract void onResponse(int code,String json);
+}
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/net/HttpConstances.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/net/HttpConstances.java
new file mode 100644
index 0000000..73a99cb
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/net/HttpConstances.java
@@ -0,0 +1,21 @@
+package com.ipcamera.detect.net;
+
+/*
+ * 编写:vst on 2017/10/30 17:39
+ * //
+ * //
+ */
+public class HttpConstances {
+ //public static final String BASE_SERVICE_URL = "https://api.eye4.cn"; //正式 http://push2.eye4.cn:3000/binding
+ public static final String BASE_SERVICE_URL="http://push2.eye4.cn:3000";
+ //基于设备的app推送
+ //绑定接口
+ public static String BAND_APP_PUSH_BY_DEVICES=BASE_SERVICE_URL+"/binding";
+ //解绑接口
+ public static String UNBAND_APP_PUSH_BY_DEVICES=BASE_SERVICE_URL+"/unbind";
+ //设置语言
+ public static String SETLANGUAGE=BASE_SERVICE_URL+"/setLanguage";
+
+ //获取记录
+ public static String GETINFO = BASE_SERVICE_URL+"/getRecord";
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/net/HttpHelper.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/net/HttpHelper.java
new file mode 100644
index 0000000..0f0aca0
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/net/HttpHelper.java
@@ -0,0 +1,164 @@
+package com.ipcamera.detect.net;
+
+import android.os.Handler;
+import android.os.Looper;
+
+import com.google.gson.Gson;
+
+import java.io.IOException;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+import okhttp3.Call;
+import okhttp3.Callback;
+import okhttp3.FormBody;
+import okhttp3.MediaType;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+import okhttp3.Response;
+
+/*
+ * 编写:vst on 2017/9/28 16:39
+ * //
+ * //
+ */
+public class HttpHelper {
+ public static final String TAG = "OkHttpHelper";
+ public static final MediaType JSON = MediaType.parse("application/json; charset=utf-8");
+
+ private static HttpHelper mInstance;
+ private OkHttpClient mHttpClient;
+
+ private Handler mHandler;
+
+ static{
+ mInstance = new HttpHelper();
+ }
+
+ private HttpHelper(){
+
+ mHttpClient = new OkHttpClient().newBuilder().connectTimeout(10, TimeUnit.SECONDS)
+ .readTimeout(10, TimeUnit.SECONDS)
+ .writeTimeout(30, TimeUnit.SECONDS)
+ .retryOnConnectionFailure(true).build();
+ mHandler = new Handler(Looper.getMainLooper());
+
+ }
+
+ public static HttpHelper getInstance(){
+ return mInstance;
+ }
+
+
+ public void get(String url, BaseCallback callback){
+ get(url, null, callback);
+ }
+
+ public void get(String url, Map param, BaseCallback callback){
+ Request request = buildGetRequest(url, param);
+ request(request,callback);
+ }
+
+ public void post(String url, Map param, BaseCallback callback){
+ Request request = buildPostRequest(url, param);
+ request(request, callback);
+
+ }
+
+ public void post(String url, String json, BaseCallback callback){
+ Request request = buildPostRequest(url, json);
+ request(request, callback);
+ }
+
+
+ private Request buildGetRequest(String url, Map param){
+ return buildRequest(url, HttpMethodType.GET,param);
+ }
+
+ private Request buildPostRequest(String url, Map param){
+ return buildRequest(url, HttpMethodType.POST,param);
+ }
+
+ private Request buildPostRequest(String url, String json){
+ return buildRequest(url, HttpMethodType.POST,json);
+ }
+
+
+ private Request buildRequest(String url, HttpMethodType methodType, Map params){
+ return buildRequest(url, HttpMethodType.POST, new Gson().toJson(params));
+ }
+ public static String signature="";
+
+ private Request buildRequest(String url, HttpMethodType methodType, String json){
+ Request.Builder build = new Request.Builder()
+ .url(url);
+ build.addHeader("signature",signature);
+ build.addHeader("accessKey", "af9aec75-1e24-107a-4252-14cffaabcfb2");
+ if(methodType == HttpMethodType.GET){
+ }else if(methodType == HttpMethodType.POST){
+ RequestBody requestBody = RequestBody.create(JSON, json);
+ build.post(requestBody);
+ }
+
+ return build.build();
+
+ }
+
+ private RequestBody builderFormData(Map params){
+ FormBody.Builder builder = new FormBody.Builder();
+ for (String key : params.keySet()) {
+ builder.add(key, params.get(key));
+ }
+
+ return builder.build();
+ }
+
+ private void request(final Request request,final BaseCallback callback){
+ mHttpClient.newCall(request).enqueue(new Callback() {
+ @Override
+ public void onFailure(Call call, IOException e) {
+ callbackFailure(callback, request, e);
+ }
+
+ @Override
+ public void onResponse(Call call, Response response) {
+ String json = null;
+ try {
+ json = response.body().string();
+ callbackResponse(callback,response.code(),json);
+ } catch (IOException e) {
+ callbackFailure(callback, null, e);
+ }
+
+ }
+ });
+ }
+
+
+
+ private void callbackFailure(final BaseCallback callback, final Request request, final IOException e) {
+
+ mHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ callback.onFailure(request, e);
+ }
+ });
+ }
+
+ private void callbackResponse(final BaseCallback callback,final int code,final String json){
+ mHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ callback.onResponse(code,json);
+ }
+ });
+ }
+
+
+ enum HttpMethodType{
+ GET,
+ POST,
+ }
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/net/VcmApi.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/net/VcmApi.java
new file mode 100644
index 0000000..8d9cfe5
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/net/VcmApi.java
@@ -0,0 +1,156 @@
+package com.ipcamera.detect.net;
+
+
+
+import com.ipcamera.detect.bean.ErrorBean;
+import com.ipcamera.detect.bean.JsonBean;
+import com.ipcamera.detect.utils.GsonUtils;
+import com.ipcamera.detect.utils.Log;
+import com.ipcamera.detect.utils.StringUtils;
+
+import okhttp3.Request;
+
+
+/*
+ * 编写:vst on 2017/9/28 17:37
+ * //
+ * //
+ */
+public class VcmApi {
+ private static VcmApi api;
+
+ public static VcmApi get() {
+ if (api == null) {
+ synchronized (VcmApi.class) {
+ if (api == null) {
+ api = new VcmApi();
+ }
+ }
+ }
+ return api;
+ }
+
+// public void load(final BaseRequest requsbean, final ApiCallBack callBack){
+// HttpHelper.getInstance().post(requsbean.getUrl(), GsonUtils.getJson(requsbean), new BaseCallback() {
+// @Override
+// public void onFailure(Request request, Exception e) {
+// onFailureLog(requsbean.getUrl(),GsonUtils.getJson(requsbean),e.getMessage());
+// callBack.onError(new ErrorBean(0, e.getMessage()));
+// }
+//
+// @Override
+// public void onResponse(int code, String json) {
+// onResponseLog(code,requsbean.getUrl(), GsonUtils.getJson(requsbean),json);
+// if (code == 200) {
+// callBack.onFinish(new JsonBean(code, json));
+// } else {
+// callBack.onError(new ErrorBean(code,json+"\n"+getErrorMsg(code)));
+// }
+// }
+// });
+// }
+ public void load(final String url,final String params,final ApiCallBack callBack){
+ HttpHelper.signature= StringUtils.getSignature(params);
+
+ HttpHelper.getInstance().post(url,params, new BaseCallback() {
+ @Override
+ public void onFailure(Request request, Exception e) {
+ onFailureLog(url,params,e.getMessage());
+ callBack.onError(new ErrorBean(0, e.getMessage()));
+ }
+
+ @Override
+ public void onResponse(int code, String json) {
+ onResponseLog(code,url,params,json);
+ if (code == 200) {
+ callBack.onFinish(new JsonBean(code, json));
+ } else {
+ callBack.onError(new ErrorBean(code,json+"\n"+getErrorMsg(code)));
+ }
+ }
+ });
+ }
+
+ public void load(final String url,final Object object,final ApiCallBack callBack){
+ HttpHelper.signature= StringUtils.getSignature(GsonUtils.getJson(object));
+ Log.e("api",HttpHelper.signature);
+ Log.e("api","GsonUtils.getJson(object)"+GsonUtils.getJson(object));
+ HttpHelper.getInstance().post(url, GsonUtils.getJson(object), new BaseCallback() {
+ @Override
+ public void onFailure(Request request, Exception e) {
+ onFailureLog(url,GsonUtils.getJson(object),e.getMessage());
+ callBack.onError(new ErrorBean(0, e.getMessage()));
+ }
+
+ @Override
+ public void onResponse(int code, String json) {
+ onResponseLog(code,url,GsonUtils.getJson(object),json);
+ if (code == 200) {
+ callBack.onFinish(new JsonBean(code, json));
+ } else {
+ callBack.onError(new ErrorBean(code,json+"\n"+getErrorMsg(code)));
+ }
+ }
+ });
+ }
+ public void cancle(){
+
+ }
+ protected static String getErrorMsg(int error) {
+ String msg = "";
+ switch (error) {
+ case 400:
+ msg = "上传参数格式错误,参数缺失或格式不正确";
+ break;
+
+ case 401:
+ msg = "密码、授权码或验证码无效";
+ break;
+
+ case 403:
+ msg = "资源已存在,服务器不响应请求(新注册场景时,用户已存在;添加设备场景时,设备已存在)";
+ break;
+
+ case 404:
+ msg = "请求资源不存在(用户不存在、设备不存在、邮箱没绑定、电话没绑定)";
+ break;
+
+ case 500:
+ msg = "服务器内部错误,请联系技术客服 企业QQ:2853239883";
+ break;
+
+ case 504:
+ msg = "Gateway Timeout,说明代理网关已经收到了请求,但转发请求失败,客户端收到状态码后,建议重发3次以提高用户体验";
+ break;
+
+ case 550:
+ msg = "没有权限对资源进行操作";
+ break;
+
+ case 601:
+ msg = "无法获取用户信息,请重新登录";
+ break;
+ default:
+ msg = "服务器内部错误,请联系技术客服 企业QQ:2853239883";
+ }
+ return msg;
+ }
+ protected void onResponseLog(int code,String url,String params,String json){
+ Log.print("------------------------onResponse------------------------");
+ Log.print("请求连接:" + url);
+ Log.print("请求参数:" +params);
+ Log.print("请求结果code:" + code + "--json=" + json);
+ if (code!=200){
+ Log.print("请求失败原因:"+getErrorMsg(code));
+ }
+ Log.print("----------------------------------------------------------");
+ }
+ protected void onFailureLog(String url,String param,String msg){
+ Log.print("------------------------onFailure-------------------------");
+ Log.print("请求连接:" + url);
+ Log.print("请求参数:" + param);
+ Log.print("请求失败:" + msg);
+ Log.print("请求失败原因:请检测网络或查看代码是否有调用网络权限");
+ Log.print("----------------------------------------------------------");
+ }
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/.DS_Store b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/.DS_Store
new file mode 100644
index 0000000..5008ddf
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/.DS_Store differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/AudioPlayer.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/AudioPlayer.java
new file mode 100644
index 0000000..3ab4b4d
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/AudioPlayer.java
@@ -0,0 +1,119 @@
+package com.ipcamera.detect.utils;
+
+
+import android.media.AudioFormat;
+import android.media.AudioManager;
+import android.media.AudioTrack;
+
+public class AudioPlayer {
+
+ // private final static String LOG_TAG = "AudioPlayer" ;
+
+ CustomBuffer audioBuffer = null;
+ private boolean bAudioPlaying = false;
+ private Thread audioThread = null;
+ private AudioTrack m_AudioTrack = null;
+
+ public AudioPlayer(CustomBuffer buffer) {
+ // TODO Auto-generated constructor stub
+ audioBuffer = buffer;
+ }
+
+ public boolean isAudioPlaying() {
+ return bAudioPlaying;
+ }
+
+ public boolean AudioPlayStart() {
+ synchronized (this) {
+ if (bAudioPlaying) {
+ return true;
+ }
+ bAudioPlaying = true;
+ audioThread = new Thread(new AudioPlayThread());
+ audioThread.start();
+ }
+ return true;
+ }
+
+ public void AudioPlayStop() {
+ synchronized (this) {
+ if (!bAudioPlaying || audioThread == null) {
+ return;
+ }
+
+ bAudioPlaying = false;
+ try {
+ audioThread.join();
+ } catch (Exception e) {
+ // TODO: handle exception
+ }
+ audioThread = null;
+ }
+ }
+
+ @SuppressWarnings("deprecation")
+ public boolean initAudioDev() {
+
+ int channelConfig;
+ int audioFormat = 2;
+ int mMinBufSize = 0;
+
+ // channelConfig = AudioFormat.CHANNEL_CONFIGURATION_STEREO;
+ channelConfig = AudioFormat.CHANNEL_OUT_MONO;
+ audioFormat = AudioFormat.ENCODING_PCM_16BIT;
+ mMinBufSize = AudioTrack.getMinBufferSize(8000, channelConfig,
+ audioFormat);
+ System.out.println("--audio, mMinBufSize=" + mMinBufSize);
+
+ if (mMinBufSize == AudioTrack.ERROR_BAD_VALUE
+ || mMinBufSize == AudioTrack.ERROR) {
+ System.out.println("初始化失败");
+ return false;
+
+ }
+
+ try {
+ m_AudioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, 8000,
+ channelConfig, audioFormat, mMinBufSize * 2,
+ AudioTrack.MODE_STREAM);
+ } catch (IllegalArgumentException iae) {
+ iae.printStackTrace();
+ return false;
+ }
+
+ m_AudioTrack.play();
+ return true;
+ }
+
+ class AudioPlayThread implements Runnable {
+ @Override
+ public void run() {
+ // TODO Auto-generated method stub
+ if (!initAudioDev()) {
+ return;
+ }
+
+ while (bAudioPlaying) {
+ CustomBufferData data = audioBuffer.RemoveData();
+ if (data == null) {
+ try {
+ Thread.sleep(10);
+ continue;
+ } catch (Exception e) {
+ // TODO: handle exception
+ m_AudioTrack.stop();
+ return;
+ }
+ }
+ // Log.d(LOG_TAG, "length:" + data.head.length);
+ m_AudioTrack.write(data.data, 0, data.head.length);
+ // Log.d(LOG_TAG, "nRet:" + nRet);
+ }
+
+ m_AudioTrack.stop();
+ m_AudioTrack.release();
+ m_AudioTrack = null;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/CircularProgressBar.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/CircularProgressBar.java
new file mode 100644
index 0000000..2bde852
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/CircularProgressBar.java
@@ -0,0 +1,142 @@
+package com.ipcamera.detect.utils;
+
+import android.animation.ValueAnimator;
+import android.content.Context;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Paint;
+import android.graphics.RectF;
+import android.util.AttributeSet;
+import android.view.View;
+import android.view.animation.DecelerateInterpolator;
+
+public class CircularProgressBar extends View {
+
+ private int mViewWidth;
+ private int mViewHeight;
+
+ private final float mStartAngle = -90; // Always start from top (default is: "3 o'clock on a watch.")
+ private float mSweepAngle = 0; // How long to sweep from mStartAngle
+ private float mMaxSweepAngle = 360; // Max degrees to sweep = full circle
+ private int mStrokeWidth = 20; // Width of outline
+ private int mAnimationDuration = 400; // Animation duration for progress change
+ private int mMaxProgress = 100; // Max progress to use
+ private boolean mDrawText = true; // Set to true if progress text should be drawn
+ private boolean mRoundedCorners = true; // Set to true if rounded corners should be applied to outline ends
+ private int mProgressColor = Color.BLACK; // Outline color
+ private int mTextColor = Color.BLACK; // Progress text color
+
+ private final Paint mPaint; // Allocate paint outside onDraw to avoid unnecessary object creation
+
+ public CircularProgressBar(Context context) {
+ this(context, null);
+ }
+
+ public CircularProgressBar(Context context, AttributeSet attrs) {
+ this(context, attrs, 0);
+ }
+
+ public CircularProgressBar(Context context, AttributeSet attrs, int defStyleAttr) {
+ super(context, attrs, defStyleAttr);
+ mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
+ }
+
+ @Override
+ protected void onDraw(Canvas canvas) {
+ super.onDraw(canvas);
+ initMeasurments();
+ drawOutlineArc(canvas);
+
+ if (mDrawText) {
+ drawText(canvas);
+ }
+ }
+
+ private void initMeasurments() {
+ mViewWidth = getWidth();
+ mViewHeight = getHeight();
+ }
+
+ private void drawOutlineArc(Canvas canvas) {
+
+ final int diameter = Math.min(mViewWidth, mViewHeight);
+ final float pad = (float) mStrokeWidth / 2.0f;
+ final RectF outerOval = new RectF(pad, pad, diameter - pad, diameter - pad);
+
+ mPaint.setColor(mProgressColor);
+ mPaint.setStrokeWidth(mStrokeWidth);
+ mPaint.setAntiAlias(true);
+ mPaint.setStrokeCap(mRoundedCorners ? Paint.Cap.ROUND : Paint.Cap.BUTT);
+ mPaint.setStyle(Paint.Style.STROKE);
+ canvas.drawArc(outerOval, mStartAngle, mSweepAngle, false, mPaint);
+ }
+
+ private void drawText(Canvas canvas) {
+ mPaint.setTextSize(Math.min(mViewWidth, mViewHeight) / 5f);
+ mPaint.setTextAlign(Paint.Align.CENTER);
+ mPaint.setStrokeWidth(0);
+ mPaint.setColor(mTextColor);
+
+ // Center text
+ int xPos = (canvas.getWidth() / 2);
+ int yPos = (int) ((canvas.getHeight() / 2) - ((mPaint.descent() + mPaint.ascent()) / 2)) ;
+
+ canvas.drawText(calcProgressFromSweepAngle(mSweepAngle) + "%", xPos, yPos, mPaint);
+ }
+
+ private float calcSweepAngleFromProgress(int progress) {
+ return (mMaxSweepAngle / mMaxProgress) * progress;
+ }
+
+ private int calcProgressFromSweepAngle(float sweepAngle) {
+ return (int) ((sweepAngle * mMaxProgress) / mMaxSweepAngle);
+ }
+
+ /**
+ * Set progress of the circular progress bar.
+ * @param progress progress between 0 and 100.
+ */
+ public void setProgress(int progress) {
+ ValueAnimator animator = ValueAnimator.ofFloat(mSweepAngle, calcSweepAngleFromProgress(progress));
+ animator.setInterpolator(new DecelerateInterpolator());
+ animator.setDuration(mAnimationDuration);
+ animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+ @Override
+ public void onAnimationUpdate(ValueAnimator valueAnimator) {
+ mSweepAngle = ((Float) valueAnimator.getAnimatedValue()).floatValue();
+ invalidate();
+ }
+ });
+ animator.start();
+ }
+
+ public void setProgressColor(int color) {
+ mProgressColor = color;
+ invalidate();
+ }
+
+ public void setProgressWidth(int width) {
+ mStrokeWidth = width;
+ invalidate();
+ }
+
+ public void setTextColor(int color) {
+ mTextColor = color;
+ invalidate();
+ }
+
+ public void showProgressText(boolean show) {
+ mDrawText = show;
+ invalidate();
+ }
+
+ /**
+ * Toggle this if you don't want rounded corners on progress bar.
+ * Default is true.
+ * @param roundedCorners true if you want rounded corners of false otherwise.
+ */
+ public void useRoundedCorners(boolean roundedCorners) {
+ mRoundedCorners = roundedCorners;
+ invalidate();
+ }
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/ContentCommon.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/ContentCommon.java
new file mode 100644
index 0000000..dbe9947
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/ContentCommon.java
@@ -0,0 +1,290 @@
+package com.ipcamera.detect.utils;
+
+public class ContentCommon {
+
+
+ public static final int CGI_GET_SENSOR_STATUS = 0x60B2;
+ public static final int CGI_SET_SENSOR_STATUS = 0x60B1;
+ public static final int CGI_DEL_SENSOR = 0x60B3;
+ public static final int CGI_SET_SENSOR_NAME = 0x60B4;
+ public static final int CGI_GET_ALARM_LOG = 0x60B5;
+ public static final int CGI_SET_SENSOR_PRESET = 0x60B7;
+ public static final int CGI_GET_SENSOR_LIST = 0x60B6;
+ public static final int CGI_ALARM_NOTIFY = 0x6040;
+ public static final int CGI_SENSOR_WHITELIST = 0x60b8;
+ public static final int CGI_SENSOR_GETPRESET = 0x60b9;
+ public static final int CGI_IEGET_STATUS = 0x6001;//获取传感器状态,返回所有状态
+ public static final int CGI_IEGET_FACTORY = 0x6009;//获取传感器状态,返回所有状态
+
+ /*
+ * 传感器报警类型
+ */
+ public static final int SENSOR_ALARM_ACTION_NON = 0x00;// 无动作
+ public static final int SENSOR_ALARM_ACTION_ALARM = 0x01;// 告警
+ public static final int SENSOR_ALARM_ACTION_LOWBATT = 0x02;// 低电
+ public static final int SENSOR_ALARM_ACTION_GARRISON = 0x05;// 布防
+ public static final int SENSOR_ALARM_ACTION_CANCELGARRISON = 0x06;// 撤防
+ public static final int SENSOR_ALARM_ACTION_SOS = 0x07;// 紧急报警SOS
+ public static final int SENSOR_ALARM_ACTION_OPENCODE = 0x08;// 对码
+ public static final int SENSOR_ALARM_ACTION_DOORBELL = 0x0A;// 门铃
+ public static final int SENSOR_ALARM_ACTION_OPEN = 0x0B;// 开启
+ public static final int SENSOR_ALARM_ACTION_CLOSE = 0x0C;// 关闭
+ public static final int SENSOR_ALARM_ACTION_CAMGROUP = 0x0D;// 摄像机群组
+ public static final int SENSOR_ALARM_ACTION_CANCELALARM = 0x0E;// 取消报警
+ public static final int SENSOR_ALARM_ACTION_ADDNEWSENSOR = 0x0F;// 已保存
+ public static final int SENSOR_ALARM_ACTION_DELETEALL = 0x10;// 删除全部传感器
+ public static final int SENSOR_ALARM_ACTION_EXITCODE = 0x11;// 退出对码
+
+ //可视门铃标志
+ public static final int ALARM_DOORBELL = 0x14;
+
+ public static final String STR_CAMERA_INFO_RECEIVER = "object.ipcam.client.camerainforeceiver";
+ public static final String STR_CAMERA_ADDR = "camera_addr";
+ public static final String STR_CAMERA_PORT = "camera_port";
+ public static final String STR_CAMERA_NAME = "camera_name";
+ public static final String STR_CAMERA_MAC = "camera_mac";
+ public static final String STR_CAMERA_USER = "camera_user";
+ public static final String STR_CAMERA_PWD = "camera_pwd";
+ public static final String STR_CAMERA_ID = "cameraid";
+ public static final String STR_CAMERA_SNAPSHOT = "camera_snapshot";
+ public static final String STR_CAMERA_USER_AUTHORITY = "camera_user_authority";
+
+ public static final String STR_CAMERA_OLD_ADDR = "camera_old_addr";
+ public static final String STR_CAMERA_OLD_PORT = "camera_old_port";
+ public static final String STR_CAMERA_OLD_ID = "camera_old_id";
+
+ public static final String STR_CAMERA_TYPE = "camera_type";
+ public static final String STR_STREAM_TYPE = "stream_type";
+ public static final String STR_H264_MAIN_STREAM = "h264_main_stream";
+ public static final String STR_H264_SUB_STREAM = "h264_sub_stream";
+ public static final String STR_MJPEG_SUB_STREAM = "mjpeg_sub_stream";
+
+ public static final int DEFAULT_PORT = 81;
+ public static final String DEFAULT_USER_NAME = "admin";
+ public static final String DEFAULT_USER_PWD = "";
+
+ public static final String CAMERA_OPTION = "camera_option";
+ public static final int ADD_CAMERA = 1;
+ public static final int EDIT_CAMERA = 2;
+ public static final int CHANGE_CAMERA_USER = 3;
+ public static final int DEL_CAMERA = 4;
+ public static final int INVALID_OPTION = 0xffff;
+
+ public static final int CAMERA_TYPE_UNKNOW = 0;
+ public static final int CAMERA_TYPE_MJPEG = 1;
+ public static final int CAMERA_TYPE_H264 = 2;
+
+ public static final int H264_MAIN_STREAM = 0;
+ public static final int H264_SUB_STREAM = 1;
+ public static final int MJPEG_SUB_STREAM = 3;
+
+ // =======pppppp==============================================
+
+ public static final int PPPP_DEV_TYPE_UNKNOWN = 0xffffffff;
+
+ public static final String STR_PPPP_STATUS = "pppp_status";
+
+ public static final int PPPP_STATUS_CONNECTING = 0;/* connecting */
+ public static final int PPPP_STATUS_INITIALING = 1;/* initialing */
+ public static final int PPPP_STATUS_ON_LINE = 2;/* on line */
+ public static final int PPPP_STATUS_CONNECT_FAILED = 3;/* connect failed */
+ public static final int PPPP_STATUS_DISCONNECT = 4;/* connect is off */
+ public static final int PPPP_STATUS_INVALID_ID = 5;
+ public static final int PPPP_STATUS_DEVICE_NOT_ON_LINE = 6;
+ public static final int PPPP_STATUS_CONNECT_TIMEOUT = 7;
+ public static final int PPPP_STATUS_CONNECT_ERRER = 8;
+ public static final int PPPP_STATUS_UNKNOWN = 0xffffffff;
+
+ public static final int PPPP_STATUS_INVALID_VUID = -2;//404 vuid无效
+ public static final int PPPP_STATUS_ALLOT_VUID = -3; //没有分配uid
+
+ public static final int PPPP_MSG_TYPE_PPPP_STATUS = 0;
+ public static final int PPPP_MSG_TYPE_PPPP_MODE = 1;
+ public static final int PPPP_MSG_TYPE_STREAM = 2;
+ public static final int PPPP_MSG_TYPE_RECORD_STATUS = 4;
+ public static final int PPPP_MSG_TYPE_INVALID_MSG = 0xffffffff;
+
+ public static final int PPPP_STREAM_TYPE_H264 = 0;
+ public static final int PPPP_STREAM_TYPE_JPEG = 1;
+
+ public static final int PPPP_MODE_UNKNOWN = 0xffffffff;
+ public static final int PPPP_MODE_P2P_NORMAL = 1;
+ public static final int PPPP_MODE_P2P_RELAY = 2;
+
+
+ //start vuid by dunn 2019-10-22
+ public static final int PPPP_MSG_VSNET_NOTIFY_TYPE_VUIDSTATUS = 7;
+ public static final int PPPP_MSG_VSNET_NOTIFY_TYPE_VUIDTIME = 8;
+
+ // ptz control command ---------------------------------
+
+ public static final int CMD_PTZ_UP = 0;
+ public static final int CMD_PTZ_UP_STOP = 1;
+ public static final int CMD_PTZ_DOWN = 2;
+ public static final int CMD_PTZ_DOWN_STOP = 3;
+ public static final int CMD_PTZ_LEFT = 4;
+ public static final int CMD_PTZ_LEFT_STOP = 5;
+ public static final int CMD_PTZ_RIGHT = 6;
+ public static final int CMD_PTZ_RIGHT_STOP = 7;
+ // new add
+ public static final int CMD_PTZ_CENTER = 25;
+ public static final int CMD_PTZ_UP_DOWN = 26;
+ public static final int CMD_PTZ_UP_DOWN_STOP = 27;
+ public static final int CMD_PTZ_LEFT_RIGHT = 28;
+ public static final int CMD_PTZ_LEFT_RIGHT_STOP = 29;
+ public static final int CMD_PTZ_ORIGINAL = 0;//水平正,垂直正
+ public static final int CMD_PTZ_VERTICAL_MIRROR = 1;//水平正,垂直反
+ public static final int CMD_PTZ_HORIZONAL_MIRROR = 2;//水平反,垂直正
+ public static final int CMD_PTZ_VERHOR_MIRROR = 3;//水平反,垂直反
+
+ public static final int CMD_PTZ_PREFAB_BIT_SET0 = 30;
+ public static final int CMD_PTZ_PREFAB_BIT_SET1 = 32;
+ public static final int CMD_PTZ_PREFAB_BIT_SET2 = 34;
+ public static final int CMD_PTZ_PREFAB_BIT_SET3 = 36;
+ public static final int CMD_PTZ_PREFAB_BIT_SET4 = 38;
+ public static final int CMD_PTZ_PREFAB_BIT_SET5 = 40;
+ public static final int CMD_PTZ_PREFAB_BIT_SET6 = 42;
+ public static final int CMD_PTZ_PREFAB_BIT_SET7 = 44;
+ public static final int CMD_PTZ_PREFAB_BIT_SET8 = 46;
+ public static final int CMD_PTZ_PREFAB_BIT_SET9 = 48;
+ public static final int CMD_PTZ_PREFAB_BIT_SETA = 50;
+ public static final int CMD_PTZ_PREFAB_BIT_SETB = 52;
+ public static final int CMD_PTZ_PREFAB_BIT_SETC = 54;
+ public static final int CMD_PTZ_PREFAB_BIT_SETD = 56;
+ public static final int CMD_PTZ_PREFAB_BIT_SETE = 58;
+ public static final int CMD_PTZ_PREFAB_BIT_SETF = 60;
+
+ public static final int CMD_PTZ_PREFAB_BIT_RUN0 = 31;
+ public static final int CMD_PTZ_PREFAB_BIT_RUN1 = 33;
+ public static final int CMD_PTZ_PREFAB_BIT_RUN2 = 35;
+ public static final int CMD_PTZ_PREFAB_BIT_RUN3 = 37;
+ public static final int CMD_PTZ_PREFAB_BIT_RUN4 = 39;
+ public static final int CMD_PTZ_PREFAB_BIT_RUN5 = 41;
+ public static final int CMD_PTZ_PREFAB_BIT_RUN6 = 43;
+ public static final int CMD_PTZ_PREFAB_BIT_RUN7 = 45;
+ public static final int CMD_PTZ_PREFAB_BIT_RUN8 = 47;
+ public static final int CMD_PTZ_PREFAB_BIT_RUN9 = 49;
+ public static final int CMD_PTZ_PREFAB_BIT_RUNA = 51;
+ public static final int CMD_PTZ_PREFAB_BIT_RUNB = 53;
+ public static final int CMD_PTZ_PREFAB_BIT_RUNC = 55;
+ public static final int CMD_PTZ_PREFAB_BIT_RUND = 57;
+ public static final int CMD_PTZ_PREFAB_BIT_RUNE = 59;
+ public static final int CMD_PTZ_PREFAB_BIT_RUNF = 61;
+
+ public static final int MSG_TYPE_GET_CAMERA_PARAMS = 0x2;
+ public static final int MSG_TYPE_DECODER_CONTROL = 0x3;
+ public static final int MSG_TYPE_GET_PARAMS = 0x4;
+ public static final int MSG_TYPE_SNAPSHOT = 0x5;
+ public static final int MSG_TYPE_CAMERA_CONTROL = 0x6;
+ public static final int MSG_TYPE_SET_NETWORK = 0x7;
+ public static final int MSG_TYPE_REBOOT_DEVICE = 0x8;
+ public static final int MSG_TYPE_RESTORE_FACTORY = 0x9;
+ public static final int MSG_TYPE_SET_USER = 0xa;
+ public static final int MSG_TYPE_SET_WIFI = 0xb;
+ public static final int MSG_TYPE_SET_DATETIME = 0xc;
+ public static final int MSG_TYPE_GET_STATUS = 0xd;
+ public static final int MSG_TYPE_GET_PTZ_PARAMS = 0xe;
+ public static final int MSG_TYPE_SET_DDNS = 0xf;
+ public static final int MSG_TYPE_SET_MAIL = 0x10;
+ public static final int MSG_TYPE_SET_FTP = 0x11;
+ public static final int MSG_TYPE_SET_ALARM = 0x12;
+ public static final int MSG_TYPE_SET_PTZ = 0x13;
+ public static final int MSG_TYPE_WIFI_SCAN = 0x14;
+ public static final int MSG_TYPE_GET_ALARM_LOG = 0x15;
+ public static final int MSG_TYPE_GET_RECORD = 0x16;
+ public static final int MSG_TYPE_GET_RECORD_FILE = 0x17;
+ public static final int MSG_TYPE_SET_PPPOE = 0x18;
+ public static final int MSG_TYPE_SET_UPNP = 0x19;
+ public static final int MSG_TYPE_DEL_RECORD_FILE = 0x1a;
+ public static final int MSG_TYPE_SET_MEDIA = 0x1b;
+ public static final int MSG_TYPE_SET_RECORD_SCH = 0x1c;
+ public static final int MSG_TYPE_CLEAR_ALARM_LOG = 0x1d;
+ public static final int MSG_TYPE_WIFI_PARAMS = 0x1f;
+ public static final int MSG_TYPE_MAIL_PARAMS = 0x20;
+ public static final int MSG_TYPE_FTP_PARAMS = 0x21;
+ public static final int MSG_TYPE_NETWORK_PARAMS = 0x22;
+ public static final int MSG_TYPE_USER_INFO = 0x23;
+ public static final int MSG_TYPE_DDNS_PARAMS = 0x24;
+ public static final int MSG_TYPE_DATETIME_PARAMS = 0x25;
+ public static final int MSG_TYPE_ALARM_PARAMS = 0x26;
+ public static final int MSG_TYPE_SET_DEVNAME = 0x27;
+
+ public static final int MOTION_ALARM = 0x01;//移动侦测
+ public static final int GPIO_ALARM = 0x02;//外部输入报警
+ public static final int DOORBELL_ALARM = 0x14;//门铃报警
+ public static final int HIGHTEMP_ALARM = 0x15;//高温报警
+ public static final int LOWTEMP_ALARM = 0x16;//低温报警
+ public static final int LOWPOWER_ALARM = 0x17;//低电报警
+ public static final int CRY_ALARM = 0x18;//哭声报警
+
+ public static final int CGI_IESET_ALIAS = 0x600f;//修改名称
+
+
+
+ // end
+ // cgi cmd ======
+ // IE CGI CMD
+ // #define CGI_IEGET_STATUS 0x6001
+ // #define CGI_IEGET_PARAM 0x6002
+ public static final int CGI_IEGET_CAM_PARAMS = 0x6003;
+ // #define CGI_IEGET_LOG 0x6004
+ // #define CGI_IEGET_MISC 0x6005
+ // #define CGI_IEGET_RECORD 0x6006
+ // #define CGI_IEGET_RECORD_FILE 0x6007
+ // #define CGI_IEGET_WIFI_SCAN 0x6008
+ // #define CGI_IEGET_FACTORY 0x6009
+ // #define CGI_IESET_IR 0x600a
+ // #define CGI_IESET_UPNP 0x600b
+ // #define CGI_IESET_ALARM 0x600c
+ // #define CGI_IESET_LOG 0x600d
+ // #define CGI_IESET_USER 0x600e
+ // #define CGI_IESET_ALIAS 0x600f
+ // #define CGI_IESET_MAIL 0x6010
+ // #define CGI_IESET_WIFI 0x6011
+ // #define CGI_CAM_CONTROL 0x6012
+ // #define CGI_IESET_DATE 0x6013
+ // #define CGI_IESET_MEDIA 0x6014
+ // #define CGI_IESET_SNAPSHOT 0x6015
+ // #define CGI_IESET_DDNS 0x6016
+ // #define CGI_IESET_MISC 0x6017
+ // #define CGI_IEGET_FTPTEST 0x6018
+ // #define CGI_DECODER_CONTROL 0x6019
+ // #define CGI_IESET_DEFAULT 0x601a
+ // #define CGI_IESET_MOTO 0x601b
+ // #define CGI_IEGET_MAILTEST 0x601c
+ // #define CGI_IESET_MAILTEST 0x601d
+ // #define CGI_IEDEL_FILE 0x601e
+ // #define CGI_IELOGIN 0x601f
+ // #define CGI_IESET_DEVICE 0x6020
+ // #define CGI_IESET_NETWORK 0x6021
+ // #define CGI_IESET_FTPTEST 0x6022
+ // #define CGI_IESET_DNS 0x6023
+ // #define CGI_IESET_OSD 0x6024
+ // #define CGI_IESET_FACTORY 0x6025
+ // #define CGI_IESET_PPPOE 0x6026
+ // #define CGI_IEREBOOT 0x6027
+ // #define CGI_IEFORMATSD 0x6028
+ // #define CGI_IESET_RECORDSCH 0x6029
+ // #define CGI_IESET_WIFISCAN 0x602a
+ // #define CGI_IERESTORE 0x602b
+ // #define CGI_IESET_FTP 0x602c
+ // #define CGI_IESET_RTSP 0x602d
+ // #define CGI_IEGET_VIDEOSTREAM 0x602e
+ // #define CGI_UPGRADE_APP 0x602f
+ // #define CGI_UPGRADE_SYS 0x6030
+ //
+ // #define CGI_SET_IIC 0x6031
+ // #define CGI_GET_IIC 0x6032
+ //
+ // #define CGI_IEGET_ALARMLOG 0x6033
+ // #define CGI_IESET_ALARMLOGCLR 0X6034
+ //
+ // #define CGI_IEGET_SYSWIFI 0x6035
+ // #define CGI_IESET_SYSWIFI 0X6036
+ //
+ // #define CGI_IEGET_LIVESTREAM 0X6037
+
+ /** 设备 类型**/
+ public static final String DEVICE_MODEL_TYPE= "device_model_type";
+
+}
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/CustomAudioRecorder.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/CustomAudioRecorder.java
new file mode 100644
index 0000000..9c776ce
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/CustomAudioRecorder.java
@@ -0,0 +1,105 @@
+package com.ipcamera.detect.utils;
+
+import android.media.AudioFormat;
+import android.media.AudioRecord;
+import android.media.MediaRecorder;
+import android.util.Log;
+
+public class CustomAudioRecorder{
+
+ private static final String TAG = "CUSTOM_AUDIO_RECORDER";
+ private AudioRecordResult audioResult = null;
+ private Thread recordThread = null;
+ private boolean bRecordThreadRuning = false;
+ private int m_in_buf_size = 0;
+ private AudioRecord m_in_rec = null;
+ private byte[] m_in_bytes = null;
+
+ public interface AudioRecordResult{
+ abstract public void AudioRecordData(byte[] data, int len);
+ }
+
+ public CustomAudioRecorder(AudioRecordResult result){
+ audioResult = result;
+ initRecorder();
+ }
+
+ public void StartRecord(){
+ synchronized (this) {
+ if (bRecordThreadRuning) {
+ return ;
+ }
+
+ bRecordThreadRuning = true;
+ recordThread = new Thread(new RecordThread());
+ try {
+ recordThread.start();
+ }catch (Exception e){
+ Log.e(TAG, "StartRecord: " + e);
+ }
+ }
+ }
+
+ public void StopRecord(){
+ synchronized (this) {
+ if (!bRecordThreadRuning) {
+ return;
+ }
+
+ bRecordThreadRuning = false;
+ try {
+ recordThread.join();
+ } catch (Exception e) {
+ // TODO: handle exception
+ }
+ }
+ }
+ public void releaseRecord(){
+ Log.d("tag","releaseRecord");
+ m_in_rec.release();
+ m_in_rec=null;
+ }
+ class RecordThread implements Runnable{
+
+ @Override
+ public void run() {
+ // TODO Auto-generated method stub
+// if (!initRecorder()) {
+// Log.i("info", "!!!!!!!!!!!!!!!!!");
+// return;
+// }
+ Log.i("info", "startRecording-------------");
+ m_in_rec.startRecording();
+ while(bRecordThreadRuning){
+ int nRet = m_in_rec.read(m_in_bytes, 0, m_in_buf_size) ;
+ Log.i("info", "1111");
+ if (nRet == 0) {
+ Log.i("info", "2222");
+ return;
+ }
+
+ if (audioResult != null) {
+ Log.i("info", "3333");
+ audioResult.AudioRecordData(m_in_bytes, nRet);
+ }
+ }
+ m_in_rec.stop();
+ }
+ }
+
+ public boolean initRecorder() {
+ // TODO Auto-generated method stub
+ Log.i("info", "initRecorder()");
+ m_in_buf_size = AudioRecord.getMinBufferSize(8000, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT);
+ m_in_rec = new AudioRecord(MediaRecorder.AudioSource.MIC, 8000, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT,
+ m_in_buf_size) ;
+ if (m_in_rec == null) {
+ Log.i("info", "444");
+ return false;
+ }
+ m_in_bytes = new byte [m_in_buf_size] ;
+ return true;
+ }
+
+
+}
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/CustomBuffer.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/CustomBuffer.java
new file mode 100644
index 0000000..4a49e6a
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/CustomBuffer.java
@@ -0,0 +1,32 @@
+package com.ipcamera.detect.utils;
+
+import java.util.LinkedList;
+import java.util.List;
+
+
+public class CustomBuffer{
+ private List DataBuffer = new LinkedList();
+
+ public boolean addData(CustomBufferData data){
+ synchronized (this) {
+ DataBuffer.add(data);
+ return true;
+ }
+ }
+
+ public CustomBufferData RemoveData(){
+ synchronized (this) {
+ if (DataBuffer.isEmpty()) {
+ return null;
+ }
+ return DataBuffer.remove(0);
+ }
+ }
+
+ public void ClearAll(){
+ synchronized (this) {
+ DataBuffer.clear();
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/CustomBufferData.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/CustomBufferData.java
new file mode 100644
index 0000000..c1c232c
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/CustomBufferData.java
@@ -0,0 +1,9 @@
+
+package com.ipcamera.detect.utils;
+
+
+
+public class CustomBufferData{
+ public CustomBufferHead head;
+ public byte[] data;
+}
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/CustomBufferHead.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/CustomBufferHead.java
new file mode 100644
index 0000000..d443954
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/CustomBufferHead.java
@@ -0,0 +1,6 @@
+package com.ipcamera.detect.utils;
+
+public class CustomBufferHead{
+ public int startcode;
+ public int length;
+}
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/DatabaseUtil.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/DatabaseUtil.java
new file mode 100644
index 0000000..8f80e39
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/DatabaseUtil.java
@@ -0,0 +1,404 @@
+package com.ipcamera.detect.utils;
+
+import android.content.ContentValues;
+import android.content.Context;
+import android.database.Cursor;
+import android.database.SQLException;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteOpenHelper;
+import android.util.Log;
+
+public class DatabaseUtil{
+
+ private static final String TAG = "DatabaseUtil";
+
+ /**
+ * Database Name
+ */
+ private static final String DATABASE_NAME = "p2p_camera_database";
+
+ /**
+ * Database Version
+ */
+ private static final int DATABASE_VERSION = 1;
+
+ /**
+ * Table Name
+ */
+ private static final String DATABASE_TABLE = "cameralist";
+ private static final String DATABASW_VIDEOPICTURE_TABLE="cameravidpic";
+ private static final String DATABASE_ALARMLOG_TABLE="alarmlog";
+ private static final String DATABASE_FIRSTPIC_TABLE="firstpic";
+ private static final String DATABASE_PRESENT_TABLE="present";
+ /**
+ * Table columns
+ */
+ public static final String KEY_ID = "id" ;
+ public static final String KEY_NAME = "name";
+ public static final String KEY_USER = "user" ;
+ public static final String KEY_PWD = "pwd" ;
+ public static final String KEY_DID = "did";
+
+ public static final String KEY_FILEPATH="filepath";
+ public static final String KEY_CREATETIME="createtime";
+ public static final String KEY_TYPE="type";
+ public static final String KEY_POSITION="position";
+
+
+ public static final String KEY_ALARMLOG_CONTENT="content";
+
+ /**
+ * save video or picture to video_picture_table type
+ * */
+ public static final String TYPE_VIDEO="video";
+ public static final String TYPE_PICTURE="picture";
+
+ /**
+ * create firstpic_table sql statement
+ *
+ * **/
+
+ private static final String CREATE_FIRSTPIC_TABLE=
+ "create table " +DATABASE_FIRSTPIC_TABLE+"("
+ +KEY_ID+" integer primary key autoincrement,"
+ +KEY_DID+" text not null, "
+ +KEY_FILEPATH+" text not null)";
+
+ /**
+ * create firstpic_table sql statement
+ *
+ * **/
+
+ private static final String CREATE_PRESENT_TABLE=
+ "create table " +DATABASE_PRESENT_TABLE+"("
+ +KEY_ID+" integer primary key autoincrement,"
+ +KEY_DID+" text not null, "
+ +KEY_POSITION+" text not null, "
+ +KEY_FILEPATH+" text not null)";
+
+
+ /**
+ * create alarmlog_table sql statement
+ *
+ * **/
+ private static final String CREATE_ALARMLOG_TABLE=
+ "create table "+DATABASE_ALARMLOG_TABLE+"("
+ +KEY_ID+" integer primary key autoincrement, "
+ +KEY_DID+" text not null, "
+ +KEY_ALARMLOG_CONTENT+" text not null, "
+ +KEY_CREATETIME+" text not null);"
+ ;
+ /**
+ * create video_picture_table sql statement
+ * **/
+ private static final String CREATE_VIDEO_PICTURE_TABLE=
+ "create table "+DATABASW_VIDEOPICTURE_TABLE+"("
+ +KEY_ID+" integer primary key autoincrement, "
+ +KEY_DID+" text not null, "
+ +KEY_FILEPATH+" text not null, "
+ +KEY_CREATETIME+" text not null, "
+ +KEY_TYPE+" text not null);"
+ ;
+
+
+ /**
+ * Database creation sql statement
+ */
+ private static final String CREATE_STUDENT_TABLE =
+ "create table " + DATABASE_TABLE
+ + " (" + KEY_ID + " integer primary key autoincrement, "
+ + KEY_NAME +" text not null, "
+ + KEY_DID + " text not null, "
+ + KEY_USER + " text not null,"
+ + KEY_PWD + " text);";
+
+ /**
+ * Context
+ */
+ private final Context mCtx;
+
+ private DatabaseHelper mDbHelper;
+ private SQLiteDatabase mDb;
+
+ /**
+ * Inner private class. Database Helper class for creating and updating database.
+ */
+ private static class DatabaseHelper extends SQLiteOpenHelper {
+ DatabaseHelper(Context context) {
+ super(context, DATABASE_NAME, null, DATABASE_VERSION);
+ }
+ /**
+ * onCreate method is called for the 1st time when database doesn't exists.
+ */
+ @Override
+ public void onCreate(SQLiteDatabase db) {
+ Log.i(TAG, "Creating student_table: " + CREATE_STUDENT_TABLE);
+ Log.i(TAG,"Creating Video_Picture_Table: "+CREATE_VIDEO_PICTURE_TABLE);
+ Log.i(TAG,"Creating alarmlog_table: "+CREATE_ALARMLOG_TABLE);
+ Log.i(TAG,"Creating Firstpic_table"+CREATE_FIRSTPIC_TABLE);
+ db.execSQL(CREATE_STUDENT_TABLE);
+ db.execSQL(CREATE_VIDEO_PICTURE_TABLE);
+ db.execSQL(CREATE_ALARMLOG_TABLE);
+ db.execSQL(CREATE_FIRSTPIC_TABLE);
+ db.execSQL(CREATE_PRESENT_TABLE);
+ System.out.println(">>>>>>>>>>>>>>>>>>>>>>!!!!!!!!!!!!!!!!1");
+ }
+
+ /**
+ * onUpgrade method is called when database version changes.
+ */
+ @Override
+ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+ Log.w(TAG, "Upgrading database from version " + oldVersion + " to "
+ + newVersion);
+ }
+ }
+
+ /**
+ * Constructor - takes the context to allow the database to be
+ * opened/created
+ *
+ * @param ctx the Context within which to work
+ */
+ public DatabaseUtil(Context ctx) {
+ this.mCtx = ctx;
+ }
+ /**
+ * This method is used for creating/opening connection
+ * @return instance of DatabaseUtil
+ * @throws SQLException
+ */
+ public DatabaseUtil open() throws SQLException {
+ mDbHelper = new DatabaseHelper(mCtx);
+ mDb = mDbHelper.getWritableDatabase();
+ return this;
+ }
+ /**
+ * This method is used for closing the connection.
+ */
+ public void close() {
+ mDbHelper.close();
+ }
+
+
+ /**
+ * This method is used to create/insert new record record.
+ * @param name
+ * @param did
+ * @param user
+ * @param pwd
+ * @return
+ */
+ public long createCamera(String name, String did, String user, String pwd) {
+ ContentValues initialValues = new ContentValues();
+ initialValues.put(KEY_NAME, name);
+ initialValues.put(KEY_DID, did);
+ initialValues.put(KEY_USER, user);
+ initialValues.put(KEY_PWD, pwd);
+ return mDb.insert(DATABASE_TABLE, null, initialValues);
+ }
+
+
+
+ /**
+ * This method will delete record.
+ * @param rowId
+ * @return boolean
+ */
+ public boolean deleteCamera(long rowId) {
+ return mDb.delete(DATABASE_TABLE, KEY_ID + "=" + rowId, null) > 0;
+ }
+ /**
+ *
+ * */
+ public boolean deleteCamera(String did) {
+ //
+ int count1=mDb.delete(DATABASE_FIRSTPIC_TABLE, KEY_DID+"='"+did+"'", null);
+ //
+ int count2 = mDb.delete(DATABASW_VIDEOPICTURE_TABLE, KEY_DID+"='"+did+"'", null);
+ //
+ int delete = mDb.delete(DATABASE_ALARMLOG_TABLE, KEY_DID+"='"+did+"'",null);
+ //
+ int delete2 = mDb.delete(DATABASE_PRESENT_TABLE, KEY_DID+"='"+did+"'", null);
+ return mDb.delete(DATABASE_TABLE, KEY_DID + "='" + did + "'", null) > 0;
+ }
+
+ /**
+ * This method will return Cursor holding all the records.
+ * @return Cursor
+ */
+ public Cursor fetchAllCameras() {
+ return mDb.query(DATABASE_TABLE, new String[] {KEY_ID, KEY_NAME,
+ KEY_DID, KEY_USER, KEY_PWD}, null, null, null, null, null);
+ }
+
+ /**
+ * This method will return Cursor holding the specific record.
+ * @param id
+ * @return Cursor
+ * @throws SQLException
+ */
+
+ public Cursor fetchCamera(long id) throws SQLException {
+ Cursor mCursor =
+ mDb.query(true, DATABASE_TABLE, new String[] {KEY_ID,
+ KEY_NAME, KEY_DID, KEY_USER, KEY_PWD}, KEY_ID + "=" + id, null,
+ null, null, null, null);
+ if (mCursor != null) {
+ mCursor.moveToFirst();
+ }
+ return mCursor;
+ }
+
+ /**
+ *
+ * @param oldaddr
+ * @param oldport
+ * @param name
+ * @param addr
+ * @param port
+ * @param user
+ * @param pwd
+ * @return
+ */
+ public boolean updateCamera(String oldDID, String name, String did, String user, String pwd) {
+ ContentValues args = new ContentValues();
+ args.put(KEY_NAME, name);
+ args.put(KEY_DID, did);
+ args.put(KEY_USER, user);
+ args.put(KEY_PWD, pwd);
+ return mDb.update(DATABASE_TABLE, args, KEY_DID + "='" + oldDID + "'", null) > 0;
+ }
+
+ public boolean updateCameraUser(String did,String username,String pwd){
+ ContentValues values=new ContentValues();
+ values.put(KEY_USER, username);
+ values.put(KEY_PWD, pwd);
+ return mDb.update(DATABASE_TABLE, values, KEY_DID+"='"+did+"'", null)>0;
+
+ }
+ /**
+ * This Method is used to create/insert new record
+ * **/
+ public long createPresent(String did,String position,String filepath){
+ ContentValues initialValues = new ContentValues();
+ initialValues.put(KEY_DID, did);
+ initialValues.put(KEY_POSITION, position);
+ initialValues.put(KEY_FILEPATH, filepath);
+ return mDb.insert(DATABASE_PRESENT_TABLE, null, initialValues);
+ }
+ /**
+ * This Method is used to quert all present
+ */
+ public Cursor queryAllPresent(String did,String position){
+ String sql = "select "+KEY_FILEPATH+" from "+DATABASE_PRESENT_TABLE+ " where "+KEY_POSITION+"='"+position+"' and "+KEY_DID+"='"+did+"'";
+ return mDb.rawQuery(sql, null);
+ }
+ /**
+ * This Method is used to update one present
+ */
+ public boolean updatePresent(String did,String position,String path){
+ ContentValues values=new ContentValues();
+ values.put(KEY_DID, did);
+ values.put(KEY_POSITION, position);
+ values.put(KEY_FILEPATH, path);
+ return mDb.update(DATABASE_PRESENT_TABLE, values, KEY_POSITION+"='"+position+"' and "+KEY_DID+"='"+did+"'", null)>0;
+ }
+ public boolean deleteOnePresent(String did,String position){
+ return mDb.delete(DATABASE_PRESENT_TABLE, KEY_DID + "=? and "+KEY_POSITION+"=?", new String[]{did,position})>0;
+ }
+ /**
+ * This Method is used to delete all present
+ */
+ public boolean deletePresent(String did){
+ return mDb.delete(DATABASE_PRESENT_TABLE, KEY_DID+"=?",new String[]{did})>0;
+ }
+ /**
+ * This Method is used to create/insert new record
+ * **/
+ public long createVideoOrPic(String did,String filepath,String type,String createtime){
+ ContentValues initialValues = new ContentValues();
+ initialValues.put(KEY_DID, did);
+ initialValues.put(KEY_FILEPATH, filepath);
+ initialValues.put(KEY_TYPE, type);
+ initialValues.put(KEY_CREATETIME, createtime);
+ return mDb.insert(DATABASW_VIDEOPICTURE_TABLE, null, initialValues);
+ }
+ /**
+ * This Method is used to query all video record from video_picture_table
+ * **/
+ public Cursor queryAllVideo(String did){
+ String sql="select * from "+DATABASW_VIDEOPICTURE_TABLE+ " where "+KEY_TYPE+"='"+TYPE_VIDEO+"' and "+KEY_DID+"='"+did+"' order by "+KEY_FILEPATH+" desc";
+ return mDb.rawQuery(sql,null);
+ }
+
+ /**
+ * This Method is used to query all video record from video_picture_table
+ * **/
+ public Cursor queryAllPicture(String did){
+ String sql="select * from "+DATABASW_VIDEOPICTURE_TABLE+ " where "+KEY_TYPE+"='"+TYPE_PICTURE+"' and "+KEY_DID+"='"+did+"'";
+ Log.d("tag","queryAllPictrue sql:"+sql);
+ return mDb.rawQuery(sql,null);
+ }
+ /**
+ * This Method is used to query video/picture in createtime from video_picture_table
+ * **/
+ public Cursor queryVideoOrPictureByDate(String did,String date,String type){
+ String sql="select * from "+DATABASW_VIDEOPICTURE_TABLE+ " where "+KEY_TYPE+"='"+TYPE_PICTURE+"' and "+KEY_DID+"='"+did+"' and "+KEY_CREATETIME+"='"+date+"'";
+ return mDb.rawQuery(sql, null);
+ }
+ /***
+ * This Method is used to delete specific video/picture record from video_picture_table
+ * */
+ public boolean deleteVideoOrPicture(String did,String filePath,String type){
+ return mDb.delete(DATABASW_VIDEOPICTURE_TABLE, KEY_DID + "=? and "+KEY_FILEPATH+"=? and "+KEY_TYPE+"=?", new String[]{did,filePath,type}) > 0;
+ }
+ /**
+ * This Method is used to delete all video/picture record from video_picture_table
+ * **/
+ public boolean deleteAllVideoOrPicture(String did,String type){
+ return mDb.delete(DATABASW_VIDEOPICTURE_TABLE,KEY_DID+"=? and "+KEY_TYPE+"=?", new String[]{did,type}) > 0;
+ }
+ /**
+ * This Method is used to delete all record from video_picture_table
+ * **/
+ public boolean deldteAllVideoPicture(String did){
+ return mDb.delete(DATABASW_VIDEOPICTURE_TABLE, KEY_DID+"=?", new String[]{did})>0;
+ }
+ /**
+ * This Method is used to add alarm log to alarmlog_table
+ * **/
+ public long insertAlarmLogToDB(String did,String content,String createTime){
+ ContentValues initialValues = new ContentValues();
+ initialValues.put(KEY_DID, did);
+ initialValues.put(KEY_ALARMLOG_CONTENT, content);
+ initialValues.put(KEY_CREATETIME, createTime);
+ return mDb.insertOrThrow(DATABASE_ALARMLOG_TABLE, null, initialValues);
+ }
+ /**
+ * This Method is used to query all alarmlog from the specified did
+ * **/
+ public Cursor queryAllAlarmLog(String did){
+ String sql="select * from "+DATABASE_ALARMLOG_TABLE+" where "+KEY_DID+"='"+did+"' order by "+KEY_CREATETIME+" desc";
+ return mDb.rawQuery(sql, null);
+ }
+ /**
+ * This Method is used to delete one alarmlog with specified time from did
+ * **/
+ public boolean delAlarmLog(String did,String createtime){
+ return mDb.delete(DATABASE_ALARMLOG_TABLE, KEY_DID+"=? and "+KEY_CREATETIME+"=?", new String[]{did,createtime})>0;
+ }
+ public boolean addFirstpic(String did,String filepath){
+ ContentValues initialValues = new ContentValues();
+ initialValues.put(KEY_DID, did);
+ initialValues.put(KEY_FILEPATH, filepath);
+ return mDb.insert(DATABASE_FIRSTPIC_TABLE, null, initialValues)>0;
+ }
+ public Cursor queryFirstpic(String did){
+ String sql="select * from "+DATABASE_FIRSTPIC_TABLE+" where "+KEY_DID+"='"+did+"'";
+ return mDb.rawQuery(sql, null);
+ }
+ public boolean delFirstpic(String did,String filePath){
+ return mDb.delete(DATABASE_FIRSTPIC_TABLE, KEY_DID + "=? and "+KEY_FILEPATH+"=? ", new String[]{did,filePath})>0;
+ }
+}
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/DrawCaptureRect.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/DrawCaptureRect.java
new file mode 100644
index 0000000..47b32d8
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/DrawCaptureRect.java
@@ -0,0 +1,57 @@
+package com.ipcamera.detect.utils;
+
+import android.content.Context;
+import android.graphics.Canvas;
+import android.graphics.Paint;
+import android.graphics.Rect;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.ipcamer.detect.R;
+
+public class DrawCaptureRect extends View
+{
+ private int mColorFill;//用于绘制的颜色
+ private int mleft, mtop, mwidth, mheight;//矩形框的左边,顶部,宽,高
+
+ public DrawCaptureRect(Context context, int left, int top, int width, int height, int colorFill) {
+ super(context);
+ // TODO Auto-generated constructor stub
+ this.mColorFill = colorFill;
+ this.mleft = left;
+ this.mtop = top;
+ this.mwidth = width;
+ this.mheight = height;
+ }
+ /*
+ setParams 因为人脸检测输出的矩形位置和视频的布局位置有缩放和高度不同的问题,需要进一步设置矩形框的参数
+ faceRect: Rect 类
+ height1: 顶部的文字框的高度
+ height2: 视频布局到顶部的距离
+ */
+ public void setParams(Rect faceRect, int height1, int height2) {
+ mleft = faceRect.left;
+ //mtop高度下降
+ mtop = faceRect.top + height1 + height2;
+ mwidth = faceRect.width();
+ //矩形框高度按增大
+ mheight = (int)(faceRect.height() * 1.2);
+ }
+
+
+
+ @Override
+ protected void onDraw(Canvas canvas) {
+ // TODO Auto-generated method stub
+ Paint mpaint = new Paint();
+ mpaint.setColor(mColorFill);
+ mpaint.setStyle(Paint.Style.FILL);
+ mpaint.setStrokeWidth(2.0f);
+ canvas.drawLine(mleft, mtop, mleft+mwidth, mtop, mpaint);
+ canvas.drawLine(mleft+mwidth, mtop, mleft+mwidth, mtop+mheight, mpaint);
+ canvas.drawLine(mleft, mtop, mleft, mtop+mheight, mpaint);
+ canvas.drawLine(mleft, mtop+mheight, mleft+mwidth, mtop+mheight, mpaint);
+ super.onDraw(canvas);
+ }
+}
+
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/EncryptionUtils.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/EncryptionUtils.java
new file mode 100644
index 0000000..62a0773
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/EncryptionUtils.java
@@ -0,0 +1,90 @@
+package com.ipcamera.detect.utils;
+
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.security.MessageDigest;
+
+
+/**
+ * 加密工具类
+ */
+public final class EncryptionUtils {
+
+ /**
+ * Don't let anyone instantiate this class.
+ */
+ private EncryptionUtils() {
+ throw new Error("Do not need instantiate!");
+ }
+
+ // == ----------------------------------------- ==
+ private static final String TAG = "EncryptionUtils";
+ // 如需要小写则把ABCDEF改成小写,或结果直接转换
+ private static final char HEX_DIGITS[]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
+
+
+ /**
+ * 加密内容 - 32位大小MD5
+ * @param s 加密内容
+ * @return
+ */
+ public final static String MD5(String s) {
+ try {
+ byte[] btInput = s.getBytes();
+ // 获得MD5摘要算法的 MessageDigest 对象
+ MessageDigest mdInst = MessageDigest.getInstance("MD5");
+ // 使用指定的字节更新摘要
+ mdInst.update(btInput);
+ // 获得密文
+ byte[] md = mdInst.digest();
+ return toHexString(md).toLowerCase();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ /**
+ * 进行转换
+ */
+ public static String toHexString(byte[] bData) {
+ StringBuilder sb = new StringBuilder(bData.length * 2);
+ for (int i = 0; i < bData.length; i++) {
+ sb.append(HEX_DIGITS[(bData[i] & 0xf0) >>> 4]);
+ sb.append(HEX_DIGITS[bData[i] & 0x0f]);
+ }
+ return sb.toString();
+ }
+
+ /**
+ * 获取文件MD5值
+ * @param fileName 文件地址
+ * @return
+ */
+ public static String getHash(String fileName){
+ try {
+ InputStream fis = new FileInputStream(fileName);
+ byte[] buffer = new byte[1024];
+ MessageDigest md5 = MessageDigest.getInstance("MD5");
+ int numRead = 0;
+ while ((numRead = fis.read(buffer)) > 0) {
+ md5.update(buffer, 0, numRead);
+ }
+ fis.close();
+ return toHexString(md5.digest());
+ } catch (Exception e) {
+ }
+ return null;
+ }
+
+
+ /**
+ * 获取请求加密字符串 test+当前时间+随机数
+ * @param rNumber 随机数
+ * @return time 当前时间
+ */
+ public static String getRequestEncryp(String clientCode,String time, String rNumber){
+ return MD5(clientCode +time+ rNumber).toLowerCase();
+ }
+
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/GsonUtils.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/GsonUtils.java
new file mode 100644
index 0000000..b18adce
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/GsonUtils.java
@@ -0,0 +1,14 @@
+package com.ipcamera.detect.utils;
+
+import com.google.gson.Gson;
+
+/*
+ * 编写:vst on 2017/9/28 18:41
+ * //
+ * //
+ */
+public class GsonUtils {
+ public static String getJson(Object object){
+ return new Gson().toJson(object);
+ }
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/Log.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/Log.java
new file mode 100644
index 0000000..b807039
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/Log.java
@@ -0,0 +1,22 @@
+package com.ipcamera.detect.utils;
+
+/*
+ * 编写:vst on 2017/9/28 17:04
+ * //
+ * //
+ */
+public class Log {
+ public static boolean isDebug=true;
+ public static void i(String tag,String info){
+ if (isDebug)
+ System.out.println(tag+"---"+info);
+ }
+ public static void e(String tag,String info){
+ if (isDebug)
+ System.out.println(tag+"---"+info);
+ }
+ public static void print(String info){
+ if (isDebug)
+ Log.e("api","LOG PRINTLN: "+info);
+ }
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/MyRender.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/MyRender.java
new file mode 100644
index 0000000..466aa6a
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/MyRender.java
@@ -0,0 +1,402 @@
+package com.ipcamera.detect.utils;
+
+import android.opengl.GLES20;
+import android.opengl.GLSurfaceView;
+import android.opengl.GLSurfaceView.Renderer;
+import android.util.Log;
+
+import java.nio.Buffer;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.FloatBuffer;
+
+import javax.microedition.khronos.egl.EGLConfig;
+import javax.microedition.khronos.opengles.GL10;
+
+public class MyRender implements Renderer
+{
+ int mHeight = 0;
+ ByteBuffer mUByteBuffer = null;
+ ByteBuffer mVByteBuffer = null;
+ int mWidth = 0;
+ ByteBuffer mYByteBuffer = null;
+ FloatBuffer positionBuffer = null;
+ final float[] positionBufferData;
+ int positionSlot = 0;
+ int programHandle = 0;
+ int texRangeSlot = 0;
+ int[] texture = new int[3];
+ int[] textureSlot = new int[3];
+ int vertexShader = 0;
+ int yuvFragmentShader = 0;
+
+
+ byte[] yuvData = null;
+
+ final float[] textCoodBufferData;
+ FloatBuffer textCoodBuffer = null;
+
+ boolean bNeedSleep = true;
+
+ public MyRender(GLSurfaceView paramGLSurfaceView)
+ {
+ float[] arrayOfFloat1 = new float[16];
+
+ arrayOfFloat1[0] = 0.0F;
+ arrayOfFloat1[1] = 0.0F;
+ arrayOfFloat1[2] = 0.0F;
+ arrayOfFloat1[3] = 1.0F;
+
+ arrayOfFloat1[4] = 0.0F;
+ arrayOfFloat1[5] = 1.0F;
+ arrayOfFloat1[6] = 0.0F;
+ arrayOfFloat1[7] = 1.0F;
+
+ arrayOfFloat1[8] = 1.0F;
+ arrayOfFloat1[9] = 0.0F;
+ arrayOfFloat1[10] = 0.0F;
+ arrayOfFloat1[11] = 1.0F;
+
+ arrayOfFloat1[12] = 1.0F;
+ arrayOfFloat1[13] = 1.0F;
+ arrayOfFloat1[14] = 0.0F;
+ arrayOfFloat1[15] = 1.0F;
+
+ this.textCoodBufferData = arrayOfFloat1;
+
+ float[] arrayOfFloat = new float[16];
+
+ arrayOfFloat[0] = -1.0F;
+ arrayOfFloat[1] = 1.0F;
+ arrayOfFloat[2] = 0.0F;
+ arrayOfFloat[3] = 1.0F;
+
+ arrayOfFloat[4] = -1.0F;
+ arrayOfFloat[5] = -1.0F;
+ arrayOfFloat[6] = 0.0F;
+ arrayOfFloat[7] = 1.0F;
+
+ arrayOfFloat[8] = 1.0F;
+ arrayOfFloat[9] = 1.0F;
+ arrayOfFloat[10] = 0.0F;
+ arrayOfFloat[11] = 1.0F;
+
+ arrayOfFloat[12] = 1.0F;
+ arrayOfFloat[13] = -1.0F;
+ arrayOfFloat[14] = 0.0F;
+ arrayOfFloat[15] = 1.0F;
+
+ this.positionBufferData = arrayOfFloat;
+
+ paramGLSurfaceView.setEGLContextClientVersion(2);
+
+ }
+
+ public static int compileShader(String paramString, int paramInt)
+ {
+ int i = GLES20.glCreateShader(paramInt);
+ if (i != 0)
+ {
+ int[] arrayOfInt = new int[1];
+ GLES20.glShaderSource(i, paramString);
+ GLES20.glCompileShader(i);
+ GLES20.glGetShaderiv(i, 35713, arrayOfInt, 0);
+ if (arrayOfInt[0] == 0)
+ {
+ Log.e("compileShader", "compile shader err:" + GLES20.glGetProgramInfoLog(i));
+ GLES20.glDeleteShader(i);
+ i = 0;
+ }
+ }
+ return i;
+ }
+
+ public long createShaders()
+ {
+ String fragmentShaderCode ="uniform sampler2D Ytex;\n";
+ fragmentShaderCode += "uniform sampler2D Utex;\n" ;
+ fragmentShaderCode += "uniform sampler2D Vtex;\n" ;
+ fragmentShaderCode += "precision mediump float; \n";
+ fragmentShaderCode += "varying vec4 VaryingTexCoord0; \n" ;
+ fragmentShaderCode += "vec4 color;\n" ;
+ fragmentShaderCode += "void main()\n" ;
+ fragmentShaderCode += "{\n" ;
+ fragmentShaderCode += "float yuv0 = (texture2D(Ytex,VaryingTexCoord0.xy)).r;\n" ;
+ fragmentShaderCode += "float yuv1 = (texture2D(Utex,VaryingTexCoord0.xy)).r;\n" ;
+ fragmentShaderCode += "float yuv2 = (texture2D(Vtex,VaryingTexCoord0.xy)).r;\n" ;
+ fragmentShaderCode += "\n" ;
+ fragmentShaderCode += "color.r = yuv0 + 1.4022 * yuv2 - 0.7011;\n" ;
+ fragmentShaderCode += "color.r = (color.r < 0.0) ? 0.0 : ((color.r > 1.0) ? 1.0 : color.r);\n" ;
+ fragmentShaderCode += "color.g = yuv0 - 0.3456 * yuv1 - 0.7145 * yuv2 + 0.53005;\n" ;
+ fragmentShaderCode += "color.g = (color.g < 0.0) ? 0.0 : ((color.g > 1.0) ? 1.0 : color.g);\n" ;
+ fragmentShaderCode += "color.b = yuv0 + 1.771 * yuv1 - 0.8855;\n" ;
+ fragmentShaderCode += "color.b = (color.b < 0.0) ? 0.0 : ((color.b > 1.0) ? 1.0 : color.b);\n" ;
+ fragmentShaderCode += "gl_FragColor = color;\n" ;
+ fragmentShaderCode += "}\n" ;
+
+ String vertexShaderCode = "uniform mat4 uMVPMatrix; \n";
+ vertexShaderCode += "attribute vec4 vPosition; \n";
+ vertexShaderCode += "attribute vec4 myTexCoord; \n";
+ vertexShaderCode += "varying vec4 VaryingTexCoord0; \n";
+ vertexShaderCode += "void main(){ \n";
+ vertexShaderCode += "VaryingTexCoord0 = myTexCoord; \n";
+ vertexShaderCode += "gl_Position = vPosition; \n";
+ vertexShaderCode += "} \n";
+
+ int[] arrayOfInt = new int[1];
+ int i = compileShader(vertexShaderCode, 35633);
+ this.vertexShader = i;
+ if (i == 0)
+ Log.e("createShaders", "failed when compileShader(vertex)");
+
+ int j = compileShader(fragmentShaderCode, 35632);
+ this.yuvFragmentShader = j;
+ if (j == 0)
+ Log.e("createShaders", "failed when compileShader(fragment)");
+ this.programHandle = GLES20.glCreateProgram();
+ GLES20.glAttachShader(this.programHandle, this.vertexShader);
+ GLES20.glAttachShader(this.programHandle, this.yuvFragmentShader);
+ GLES20.glLinkProgram(this.programHandle);
+ GLES20.glGetProgramiv(this.programHandle, 35714, arrayOfInt, 0);
+
+ if (arrayOfInt[0] == 0)
+ {
+ //Log.e("createShaders", "link program err:" + GLES20.glGetProgramInfoLog(this.programHandle));
+ destroyShaders();
+ }
+
+ this.texRangeSlot = GLES20.glGetAttribLocation(this.programHandle, "myTexCoord");
+
+ this.textureSlot[0] = GLES20.glGetUniformLocation(this.programHandle, "Ytex");
+ this.textureSlot[1] = GLES20.glGetUniformLocation(this.programHandle, "Utex");
+ this.textureSlot[2] = GLES20.glGetUniformLocation(this.programHandle, "Vtex");
+
+ this.positionSlot = GLES20.glGetAttribLocation(this.programHandle, "vPosition");
+
+ //Log.d("aaaaa", "texRangeSlot: " + texRangeSlot) ;
+ //Log.d("aaaaa", "positionSlot: " + positionSlot) ;
+ //Log.d("aaaaa", "textureSlot[0]: " + textureSlot[0]) ;
+ //Log.d("aaaaa", "textureSlot[1]: " + textureSlot[1]) ;
+ //Log.d("aaaaa", "textureSlot[2]: " + textureSlot[2]) ;
+
+ return 0;
+ }
+
+ public long destroyShaders()
+ {
+ if (this.programHandle != 0)
+ {
+ GLES20.glDetachShader(this.programHandle, this.yuvFragmentShader);
+ GLES20.glDetachShader(this.programHandle, this.vertexShader);
+ GLES20.glDeleteProgram(this.programHandle);
+ this.programHandle = 0;
+ }
+ if (this.yuvFragmentShader != 0)
+ {
+ GLES20.glDeleteShader(this.yuvFragmentShader);
+ this.yuvFragmentShader = 0;
+ }
+ if (this.vertexShader != 0)
+ {
+ GLES20.glDeleteShader(this.vertexShader);
+ this.vertexShader = 0;
+ }
+ return 0L;
+ }
+
+
+
+ public int draw(ByteBuffer paramByteBuffer1, ByteBuffer paramByteBuffer2, ByteBuffer paramByteBuffer3, int paramInt1, int paramInt2)
+ {
+ GLES20.glClear(16384);
+ GLES20.glClearColor(0.0F, 0.0F, 0.0F, 1.0F);
+ GLES20.glUseProgram(this.programHandle);
+ paramByteBuffer1.position(0);
+ GLES20.glActiveTexture(33984);
+ loadTexture(this.texture[0], paramInt1, paramInt2, paramByteBuffer1);
+ paramByteBuffer2.position(0);
+ GLES20.glActiveTexture(33985);
+ loadTexture(this.texture[1], paramInt1 >> 1, paramInt2 >> 1, paramByteBuffer2);
+ paramByteBuffer3.position(0);
+ GLES20.glActiveTexture(33986);
+ loadTexture(this.texture[2], paramInt1 >> 1, paramInt2 >> 1, paramByteBuffer3);
+ GLES20.glUniform1i(this.textureSlot[0], 0);
+ GLES20.glUniform1i(this.textureSlot[1], 1);
+ GLES20.glUniform1i(this.textureSlot[2], 2);
+
+ this.positionBuffer.position(0);
+ GLES20.glEnableVertexAttribArray(this.positionSlot);
+ GLES20.glVertexAttribPointer(this.positionSlot, 4, GLES20.GL_FLOAT, false, 0, this.positionBuffer);
+
+ //textcood
+ this.textCoodBuffer.position(0);
+
+ GLES20.glEnableVertexAttribArray(this.texRangeSlot);
+ GLES20.glVertexAttribPointer(this.texRangeSlot, 4, GLES20.GL_FLOAT, false, 0, this.textCoodBuffer);
+
+ GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
+ GLES20.glDisableVertexAttribArray(this.positionSlot);
+
+ GLES20.glDisableVertexAttribArray(this.texRangeSlot);
+
+ return 0;
+ }
+
+ public int loadTexture(int paramInt1, int paramInt2, int paramInt3, Buffer paramBuffer)
+ {
+ GLES20.glBindTexture(3553, paramInt1);
+ GLES20.glTexParameteri(3553, 10241, 9729);
+ GLES20.glTexParameteri(3553, 10240, 9729);
+ GLES20.glTexParameteri(3553, 10242, 33071);
+ GLES20.glTexParameteri(3553, 10243, 33071);
+ GLES20.glTexImage2D(3553, 0, 6409, paramInt2, paramInt3, 0, 6409, GLES20.GL_UNSIGNED_BYTE, paramBuffer);
+ return 0;
+ }
+
+ public int loadVBOs()
+ {
+ this.textCoodBuffer = ByteBuffer.allocateDirect(4 * this.textCoodBufferData.length).order(ByteOrder.nativeOrder()).asFloatBuffer();
+ this.textCoodBuffer.put(this.textCoodBufferData).position(0);
+
+ this.positionBuffer = ByteBuffer.allocateDirect(4 * this.positionBufferData.length).order(ByteOrder.nativeOrder()).asFloatBuffer();
+ this.positionBuffer.put(this.positionBufferData).position(0);
+ return 0;
+ }
+
+ public void onDrawFrame(GL10 paramGL10)
+ {
+ //Log.d("yuvRender", "onDrawFrame");
+ GLES20.glClear(16384);
+ synchronized (this) {
+ if ((this.mWidth == 0) || (this.mHeight == 0) || (this.mYByteBuffer == null) || (this.mUByteBuffer == null) || (this.mVByteBuffer == null))
+ return;
+
+ if(bNeedSleep){
+ try {
+ Thread.sleep(10);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ bNeedSleep = true;
+
+ draw(this.mYByteBuffer, this.mUByteBuffer, this.mVByteBuffer, this.mWidth, this.mHeight);
+ }
+
+ }
+
+
+ public void onSurfaceChanged(GL10 paramGL10, int paramInt1, int paramInt2)
+ {
+ GLES20.glViewport(0, 0, paramInt1, paramInt2);
+ }
+
+ public void onSurfaceCreated(GL10 paramGL10, EGLConfig paramEGLConfig)
+ {
+ GLES20.glClearColor(0.0F, 0.0F, 0.0F, 1.0F);
+ GLES20.glGenTextures(3, this.texture, 0);
+ createShaders();
+ loadVBOs();
+ }
+
+ public int unloadVBOs()
+ {
+ if (this.positionBuffer != null)
+ this.positionBuffer = null;
+
+ return 0;
+ }
+
+ public int writeSample(byte[] paramArrayOfByte,int mSize ,int width,int height)
+ {
+ synchronized (this) {
+ if ((width == 0) || (height == 0)){
+ Log.d("writesample", "invalid param");
+ return 0;
+ }
+
+ if ((width != this.mWidth) || (height != this.mHeight))
+ {
+ this.mWidth = width;
+ this.mHeight = height;
+ this.mYByteBuffer = ByteBuffer.allocate(this.mWidth * this.mHeight);
+ this.mUByteBuffer = ByteBuffer.allocate(this.mWidth * this.mHeight / 4);
+ this.mVByteBuffer = ByteBuffer.allocate(this.mWidth * this.mHeight / 4);
+ }
+
+ if (this.mYByteBuffer != null)
+ {
+ this.mYByteBuffer.position(0);
+ this.mYByteBuffer.put(paramArrayOfByte, 0, this.mWidth * this.mHeight);
+ this.mYByteBuffer.position(0);
+ }
+
+ if (this.mUByteBuffer != null)
+ {
+ this.mUByteBuffer.position(0);
+ this.mUByteBuffer.put(paramArrayOfByte, this.mWidth * this.mHeight, this.mWidth * this.mHeight / 4);
+ this.mUByteBuffer.position(0);
+ }
+
+ if (this.mVByteBuffer != null)
+ {
+ this.mVByteBuffer.position(0);
+ this.mVByteBuffer.put(paramArrayOfByte, 5 * (this.mWidth * this.mHeight) / 4, this.mWidth * this.mHeight / 4);
+ this.mVByteBuffer.position(0);
+ }
+
+ bNeedSleep = false;
+
+ return 1;
+
+ }
+ }
+
+ public int writeSample(byte[] paramArrayOfByte ,int width,int height)
+ {
+ synchronized (this) {
+ if ((width == 0) || (height == 0)){
+ Log.d("writesample", "invalid param");
+ return 0;
+ }
+
+ if ((width != this.mWidth) || (height != this.mHeight))
+ {
+ this.mWidth = width;
+ this.mHeight = height;
+ this.mYByteBuffer = ByteBuffer.allocate(this.mWidth * this.mHeight);
+ this.mUByteBuffer = ByteBuffer.allocate(this.mWidth * this.mHeight / 4);
+ this.mVByteBuffer = ByteBuffer.allocate(this.mWidth * this.mHeight / 4);
+ }
+
+ if (this.mYByteBuffer != null)
+ {
+ this.mYByteBuffer.position(0);
+ this.mYByteBuffer.put(paramArrayOfByte, 0, this.mWidth * this.mHeight);
+ this.mYByteBuffer.position(0);
+ }
+
+ if (this.mUByteBuffer != null)
+ {
+ this.mUByteBuffer.position(0);
+ this.mUByteBuffer.put(paramArrayOfByte, this.mWidth * this.mHeight, this.mWidth * this.mHeight / 4);
+ this.mUByteBuffer.position(0);
+ }
+
+ if (this.mVByteBuffer != null)
+ {
+ this.mVByteBuffer.position(0);
+ this.mVByteBuffer.put(paramArrayOfByte, 5 * (this.mWidth * this.mHeight) / 4, this.mWidth * this.mHeight / 4);
+ this.mVByteBuffer.position(0);
+ }
+
+ bNeedSleep = false;
+
+ return 1;
+
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/MySharedPreferenceUtil.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/MySharedPreferenceUtil.java
new file mode 100644
index 0000000..c0dbccd
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/MySharedPreferenceUtil.java
@@ -0,0 +1,45 @@
+package com.ipcamera.detect.utils;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+
+
+/**
+ * store package Name
+ *
+ * @author Administrator
+ */
+public class MySharedPreferenceUtil {
+
+ private static SharedPreferences prefer;
+ public static final String STR_CAMERA_SYSTEMFIRM="system_firm";
+
+
+ //保存设备 的信息
+ public static void saveDeviceInformation(Context context, String uid, String informationType, String information) {
+ prefer = context.getSharedPreferences(uid, Context.MODE_PRIVATE);
+ prefer.edit().putString(informationType, information).commit();
+ }
+
+ //获取设备 的信息
+ public static String getDeviceInformation(Context context, String uid, String informationType) {
+ prefer = context.getSharedPreferences(uid, Context.MODE_PRIVATE);
+ String information = prefer.getString(informationType, "");
+ return information;
+ }
+
+ //保存设备版本 的信息
+ public static void saveSystemVer(Context context, String did, String ver) {
+ prefer = context.getSharedPreferences(
+ STR_CAMERA_SYSTEMFIRM, Context.MODE_PRIVATE);
+ prefer.edit().putString(did, ver).commit();
+ }
+
+ // 获取系统版本
+ public static String getSystemVer(Context context, String did) {
+ prefer = context.getSharedPreferences(
+ STR_CAMERA_SYSTEMFIRM, Context.MODE_PRIVATE);
+ String path = prefer.getString(did, "0");
+ return path;
+ }
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/MyStringUtils.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/MyStringUtils.java
new file mode 100644
index 0000000..29190ec
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/MyStringUtils.java
@@ -0,0 +1,61 @@
+package com.ipcamera.detect.utils;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import com.ipcamer.detect.R;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+
+public class MyStringUtils {
+
+ @SuppressLint("NewApi")
+ public static boolean isEmpty(String string) {
+ if (null == string || string.isEmpty()) {
+ return true;
+ }
+ return false;
+ }
+
+ public static String getNumbers(String content) {
+ Pattern pattern = Pattern.compile("\\d+");
+ Matcher matcher = pattern.matcher(content);
+ while (matcher.find()) {
+ return matcher.group(0);
+ }
+ return "";
+ }
+
+ /*
+ * public static String setNubAddOne(String content, String type) { try { if
+ * (content.contains(":")) { String pp[] = content.split(":"); String before
+ * = pp[pp.length - 1]; int after = (Integer.parseInt(getNumbers(content)) +
+ * 1); return content.replace(before, after + "") .replace(type + ":",
+ * "").replace(":", ""); } else { return content; } } catch (Exception e) {
+ * return content; } }
+ */
+
+
+ /*摄像机返回var 后面的字段*/
+ public static String spitValue(String name, String tag) {
+ String[] strs = name.split(";");
+ for (int i = 0; i < strs.length; i++) {
+ String str1 = strs[i].trim();
+ if (str1.startsWith("var ")) {
+ str1 = str1.substring(4, str1.length());
+ }
+ // Log.i(TAG, "str1:" + str1);
+ if (str1.startsWith(tag)) {
+ String result = str1.substring(str1.indexOf("=") + 1);
+ return result;
+ }
+ }
+ return -1 + "";
+ }
+
+
+
+
+
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/SensorCustomListView.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/SensorCustomListView.java
new file mode 100644
index 0000000..968fd33
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/SensorCustomListView.java
@@ -0,0 +1,21 @@
+package com.ipcamera.detect.utils;
+
+import android.content.Context;
+import android.view.View.MeasureSpec;
+import android.widget.ListView;
+
+public class SensorCustomListView extends ListView{
+ public SensorCustomListView(Context context) {
+ super(context);
+ }
+
+ public SensorCustomListView(Context context, android.util.AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+
+ int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,MeasureSpec.AT_MOST);
+ super.onMeasure(widthMeasureSpec, expandSpec);
+ }
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/SensorDoorData.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/SensorDoorData.java
new file mode 100644
index 0000000..80dd87b
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/SensorDoorData.java
@@ -0,0 +1,148 @@
+package com.ipcamera.detect.utils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.ipcamera.detect.bean.DoorBean;
+
+
+
+
+public class SensorDoorData {
+
+ public static final String TAG = "SensorDoorData";
+
+ public static ArrayList>> sensordoorItems = new ArrayList>>();// did,门磁传感器list
+
+ public static void AddSensor(String did, DoorBean door) {
+// Log.i("info", "AddSensor add==========" + did
+// + ".......door.toString():" + door.toString());
+ String doortag = door.getSensoridTag();
+
+ if (CheckSensorDoor(did, doortag)) {
+ // Log.i(TAG, "new sensordoor:" + sensordoorItems.toString());
+ int size = sensordoorItems.size();
+ if (size == 0) {
+ // Log.i(TAG, "size==0");
+ ArrayList newList = new ArrayList();
+ newList.add(door);
+ Map> map = new HashMap>();
+ map.put(did, newList);
+ sensordoorItems.add(map);
+ } else {
+ for (int i = 0; i < size; i++) {
+ if (sensordoorItems.get(i).containsKey(did)) {
+ // Log.i(TAG, "size==1111111"+i);
+ Map> map = sensordoorItems
+ .get(i);
+ ArrayList doorList = map.get(did);
+ doorList.add(door);
+ }else{
+ //Log.i(TAG, "size==2222222222"+i);
+ ArrayList newList = new ArrayList();
+ newList.add(door);
+ Map> map = new HashMap>();
+ map.put(did, newList);
+ sensordoorItems.add(map);
+ }
+ }
+
+ }
+
+ }
+
+ }
+
+ private static boolean CheckSensorDoor(String did, String tag) {
+ // TODO Auto-generated method stub
+ int size = sensordoorItems.size();
+ int i;
+ for (i = 0; i < size; i++) {
+ if (sensordoorItems.get(i).containsKey(did)) {
+ ArrayList list = sensordoorItems.get(i).get(did);
+ int num = list.size();
+ for (int j = 0; j < num; j++) {
+ DoorBean door = list.get(j);
+ String doortag = door.getSensoridTag();
+ if (tag.equals(doortag)) {
+ return false;
+ }
+ }
+ }
+ }
+ return true;
+ }
+
+ public static ArrayList getSensorDoorBeanList(String did) {
+
+ int size = sensordoorItems.size();
+ for (int i = 0; i < size; i++) {
+ if (sensordoorItems.get(i).containsKey(did)) {
+ ArrayList list = sensordoorItems.get(i).get(did);
+ return list;
+ }
+ }
+
+ return null;
+ }
+
+ public static void ChangeDoorOpenCloseStatus(String did,String tag,int status){
+ int size = sensordoorItems.size();
+ for (int i = 0; i < size; i++) {
+ if (sensordoorItems.get(i).containsKey(did)) {
+ ArrayList list = sensordoorItems.get(i).get(did);
+ int num=list.size();
+ for(int j=0;j list = sensordoorItems.get(i).get(did);
+ int num=list.size();
+ for(int j=0;j list = sensordoorItems.get(i).get(did);
+ int num=list.size();
+ for(int j=0;j> Planlist = new
+ // ArrayList>();
+
+ public static Map planMap = new HashMap();
+
+ public static boolean compare_date(String DATE1, String DATE2) {
+
+ DateFormat df = new SimpleDateFormat("hh:mm");
+ try {
+ Date dt1 = df.parse(DATE1);
+ Date dt2 = df.parse(DATE2);
+ if (dt1.getTime() > dt2.getTime()) {
+ return false;
+ } else if (dt1.getTime() < dt2.getTime()) {
+ return true;
+ } else {
+ return false;
+ }
+ } catch (Exception exception) {
+ exception.printStackTrace();
+ }
+ return false;
+ }
+
+ public static boolean checkTime(String s1, String s2, String day) {
+ int size1 = trsforTimes(s1);
+ int size2 = trsforTimes(s2) - 1;
+ String newkey = getBinary(size1, size2);
+
+ if (planMap.containsKey(day)) {
+ String value = planMap.get(day);
+// LogTools.logW("checkTime value:" + value);
+ for (int j = 0; j < 96; j++) {
+ char c1 = value.charAt(j);
+ char c2 = newkey.charAt(j);
+ if (c1 == '1' && c2 == '1') {
+ System.out.println("有冲突:" + j);
+ return true;
+ }
+
+ }
+ } else {
+// LogTools.logW("没有该日期的计划");
+ return false;
+ }
+
+ // Map map = Planlist.get(i);
+ // LogTools.logW("planListMap:"+map.toString());
+ // String listZone = map.get(day);
+ // if(listZone==null){
+ // LogTools.logW("没有该日期的计划");
+ // return false;
+ // }
+ // if(map.containsKey(day)){
+ // for (int j = 0; j < 96; j++) {
+ // char c1 = listZone.charAt(j);
+ // char c2 = newkey.charAt(j);
+ // if (c1 == '1' && c2 == '1') {
+ // System.out.println("有冲突:" + j);
+ // return true;
+ // }
+ //
+ // }
+ // }
+
+ System.out.println("没有冲突");
+ return false;
+
+ }
+
+ public static void addNewDayToMap(String key, String value) {
+ if (planMap.containsKey(key)) {
+ String mapvalue = planMap.get(key);
+ // LogTools.logW("addNewDayToMap key:" +key+",value:"+ value);
+ StringBuffer sbs = new StringBuffer();
+ for (int j = 0; j < 96; j++) {
+ char c1 = value.charAt(j);
+ char c2 = mapvalue.charAt(j);
+ if (c1 == '1' || c2 == '1') {
+ sbs.append("" + 1);
+ } else {
+ sbs.append("" + 0);
+ }
+ }
+ planMap.put(key, sbs.toString());
+ } else {
+ planMap.put(key, value);
+ // LogTools.logW("没有该日期的计划");
+ }
+ }
+
+ public static String getOneDay96Strings(String startTime, String endTime) {
+ int size1 = trsforTimes(startTime);
+ int size2 = trsforTimes(endTime) - 1;
+ String newkey = getBinary(size1, size2);
+ return newkey;
+
+ }
+
+ public static int getMinute(String time) {
+ String array[] = time.split(":");
+ int h = Integer.parseInt(array[1]);
+ return h;
+
+ }
+
+ public static int getHour(String time) {
+ String array[] = time.split(":");
+ int h = Integer.parseInt(array[0]);
+ return h;
+
+ }
+
+ public static String op2(String s) {
+ int len = s.length();
+ sb = new StringBuffer();
+ for (int i = 0; i < len; i++) {
+ char si = s.charAt(len - i - 1);
+ int ss = si & 1;
+ sb.append(ss + "");
+ }
+ return sb.toString();
+ }
+
+ public static String comString(String s1, String s2) {
+ StringBuffer sbs = new StringBuffer();
+ for (int i = 0; i < 96; i++) {
+ char c1 = s1.charAt(i);
+ char c2 = s2.charAt(i);
+ if (c1 == '1' || c2 == '1') {
+ sbs.append("1");
+ } else {
+ sbs.append("0");
+ }
+
+ }
+ return sbs.toString();
+
+ }
+
+ public static String getBinary(int size1, int size2) {
+ System.out.println("s1:" + size1 + ",s2:" + size2);
+ sb = new StringBuffer();
+ for (int i = 0; i < 96; i++) {
+
+ if (i >= size1 && i <= size2) {
+ sb.append("1");
+ } else {
+ sb.append("0");
+ }
+ }
+
+ return sb.toString();
+ }
+
+ public static int trsforTimes(String time) {
+ String array[] = time.split(":");
+ int h = Integer.parseInt(array[0]);
+ int m = Integer.parseInt(array[1]);
+ int sum = 0;
+ sum = h * 4 + m / 15;
+
+ return sum;
+
+ }
+
+
+
+
+ public static int string32toInt(String string){
+// StringBuffer sb=new StringBuffer();
+// int index=0;
+// for (int i = 31; i < 32; i--) {
+// char char_i=string.charAt(i);
+// int stringint=Integer.parseInt(char_i+"")&1;
+// if(stringint==1){
+// index=i;
+// break;
+// }
+//
+// }
+// String validString=string.substring(0, index+1);
+// LogTools.LogWe("validString:"+validString);
+//
+ return Integer.valueOf(string, 2);
+
+ }
+
+
+
+ public static String getMinutesString(int starttime, int endtime) {
+ String Stime = Integer.toBinaryString(starttime);
+ String Etime = Integer.toBinaryString(endtime);
+ String string1 = "";
+ String string2 = "";
+ int size1 = Stime.length();
+ int size2 = Etime.length();
+
+ if (size1 != 12) {
+ string1 = getInvalidBit(12 - Stime.length()) + Stime;
+ }
+ if (size2 != 12) {
+ string2 = getInvalidBit(12 - Etime.length()) + Etime;
+ }
+
+ if (starttime == 0) {
+ string1 = "000000000000";
+ }
+ if (endtime == 0) {
+ string2 = "000000000000";
+ }
+
+ // int ss1 = starttime <<(12-Stime.length());
+ // int ss2 = endtime << (12-Etime.length());
+ //
+ // if (ss1 == 0) {
+ // string1 = "000000000000";
+ // } else {
+ // string1 = Integer.toBinaryString(ss1);
+ // }
+ // if (ss2 == 0) {
+ // string2 = "000000000000";
+ // } else {
+ // string2 = Integer.toBinaryString(ss2);
+ // }
+ System.out.println("s1:" + string1 + ",s2:" + string2);
+ return string1 + string2;
+ }
+
+ public static String getInvalidBit(int num) {
+ StringBuffer sb = new StringBuffer();
+ for (int i = 0; i < num; i++) {
+ sb.append("0");
+ }
+ return sb.toString();
+ }
+
+ public static String replaceIndex(int index, String res) {
+ return res.substring(0, index) + 1 + res.substring(index + 1);
+ }
+
+ public static String get2Strings(String bit32, String week, String bit23) {
+
+ return bit32 + week + bit23;
+
+ }
+
+ public static int getPassMinutes(int hour, int minute) {
+ return hour * 60 + minute;
+
+ }
+
+
+
+
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/StringUtils.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/StringUtils.java
new file mode 100644
index 0000000..99294ab
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/StringUtils.java
@@ -0,0 +1,84 @@
+package com.ipcamera.detect.utils;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.security.MessageDigest;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Random;
+
+/*
+ * 编写:vst on 2017/9/30 14:51
+ * //
+ * //
+ */
+public class StringUtils {
+ public static String getEncryp(String clientCode,String date,String ran){
+ return EncryptionUtils.getRequestEncryp(clientCode,date,ran);
+ }
+ /**
+ * 产生4位随机数(0000-9999)
+ * @return 4位随机数
+ */
+ public static String getFourRandom(){
+ Random random = new Random();
+ String fourRandom = random.nextInt(10000) + "";
+ int randLength = fourRandom.length();
+ if(randLength<4){
+ for(int i=1; i<=4-randLength; i++)
+ fourRandom = "0" + fourRandom ;
+ }
+ return fourRandom;
+ }
+
+ public static String getSignature(String json) {
+ StringBuilder sb=new StringBuilder();
+ try {
+ JSONObject object = new JSONObject(json);
+ Iterator iterator = object.keys();
+ while (iterator.hasNext()) {
+ String key=iterator.next().toString();
+ sb.append(key+object.getString(key));
+ }
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ return encode(sb.toString());
+ }
+
+
+ private static final char[] HEX_DIGITS = {'0', '1', '2', '3', '4', '5',
+ '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
+
+ /**
+ * Takes the raw bytes from the digest and formats them correct.
+ *
+ * @param bytes the raw bytes from the digest.
+ * @return the formatted bytes.
+ */
+ private static String getFormattedText(byte[] bytes) {
+ int len = bytes.length;
+ StringBuilder buf = new StringBuilder(len * 2);
+ // 把密文转换成十六进制的字符串形式
+ for (int j = 0; j < len; j++) {
+ buf.append(HEX_DIGITS[(bytes[j] >> 4) & 0x0f]);
+ buf.append(HEX_DIGITS[bytes[j] & 0x0f]);
+ }
+ return buf.toString();
+ }
+
+ public static String encode(String str) {
+ if (str == null) {
+ return null;
+ }
+ try {
+ MessageDigest messageDigest = MessageDigest.getInstance("SHA1");
+ messageDigest.update(str.getBytes());
+ return getFormattedText(messageDigest.digest());
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/SystemValue.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/SystemValue.java
new file mode 100644
index 0000000..3e2cfaa
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/SystemValue.java
@@ -0,0 +1,22 @@
+package com.ipcamera.detect.utils;
+
+public class SystemValue {
+ public static String deviceName = null;
+ public static String devicePass = null;
+ public static String deviceId = null;
+
+ public static boolean supportLightAndSirenO13AndO10(String ver) {
+ String[] temp = ver.replace("\"","").split("\\.");
+ if (temp.length == 4) {
+ int second = Integer.parseInt(temp[1]);
+ if ((second==53 && Integer.parseInt(temp[2])==10 && Integer.parseInt(temp[0])==220) || //010 固件
+ (second==52 && Integer.parseInt(temp[2])==10 && Integer.parseInt(temp[0])==20) || //013 摄像灯固件
+ (second==53 && Integer.parseInt(temp[2])==10 && Integer.parseInt(temp[0])==20) //013 摄像灯新固件
+ || (second==53 && Integer.parseInt(temp[2])==210 && Integer.parseInt(temp[0])==20))
+ return true;
+ else
+ return false;
+ }
+ return false;
+ }
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/ToastUtils.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/ToastUtils.java
new file mode 100644
index 0000000..c853063
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/ToastUtils.java
@@ -0,0 +1,17 @@
+package com.ipcamera.detect.utils;
+
+import android.content.Context;
+import android.widget.Toast;
+
+import com.ipcamer.detect.R;
+
+/*
+ * 编写:vst on 2017/11/9 09:19
+ * //
+ * //
+ */
+public class ToastUtils {
+ public static void show(final Context context,final String string){
+ Toast.makeText(context, string,Toast.LENGTH_LONG).show();
+ }
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/Tools.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/Tools.java
new file mode 100644
index 0000000..af3e2da
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/Tools.java
@@ -0,0 +1,164 @@
+package com.ipcamera.detect.utils;
+
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.database.Cursor;
+import android.graphics.Bitmap;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Environment;
+import android.text.format.Formatter;
+import android.widget.Toast;
+
+
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+
+
+/**
+ * Created by MK on 2017/10/18.
+ */
+
+public class Tools {
+ private static float memorySizeTotal =0;
+ public static void savePicToSDcard(Context mContext,String strDID,final Bitmap bmp) {
+ if (bmp == null) {
+ return;
+ }
+ DatabaseUtil dbUtil = new DatabaseUtil(mContext);
+ String strDate = getStrDate();
+ dbUtil.open();
+ Cursor cursor = dbUtil.queryVideoOrPictureByDate(strDID, strDate, DatabaseUtil.TYPE_PICTURE);
+ int seri = cursor.getCount() + 1;
+ dbUtil.close();
+ FileOutputStream fos = null;
+ try {
+ File div = new File(Environment.getExternalStorageDirectory(), "/DCIM/Camera");
+ if (!div.exists()) {
+ div.mkdirs();
+ }
+ File file = new File(div, strDate + "_" + seri + strDID + ".jpg");
+ fos = new FileOutputStream(file);
+ if (bmp.compress(Bitmap.CompressFormat.JPEG, 50, fos)) {
+ fos.flush();
+ //Log.d("tag", "takepicture success");
+ dbUtil.open();
+ dbUtil.createVideoOrPic(strDID, file.getAbsolutePath(),
+ DatabaseUtil.TYPE_PICTURE, strDate);
+ dbUtil.close();
+ String filePath = file.getAbsolutePath();
+ String s1 = filePath
+ .substring(filePath.lastIndexOf("/") + 1);
+ String date = s1.substring(0, 10);
+ // 最后通知图库更新
+ mContext.sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse("file://" + file.getAbsolutePath())));
+ if (!bmp.isRecycled() && bmp != null) {
+ //Log.i("info", "拍照回收");
+ bmp.recycle();
+ }
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+ if (fos != null) {
+ try {
+ fos.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
+ public static String savePresetPicToSDcard(Context mContext,String strDID,int presetIndex,final Bitmap bmp) {
+ if (bmp == null) {
+ return null;
+ }
+ FileOutputStream fos = null;
+ try {
+ File div = new File(Environment.getExternalStorageDirectory(), "/eye4/preset");
+ if (!div.exists()) {
+ div.mkdirs();
+ }
+ File file = new File(div, strDID + "_" + presetIndex + ".jpg");
+ fos = new FileOutputStream(file);
+ if (bmp.compress(Bitmap.CompressFormat.JPEG, 50, fos)) {
+ fos.flush();
+ if (!bmp.isRecycled() && bmp != null) {
+ //Log.i("info", "拍照回收");
+ bmp.recycle();
+ }
+ }
+ return file.getAbsolutePath();
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+ if (fos != null) {
+ try {
+ fos.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ return null;
+ }
+
+ public static String getStrDate() {
+ Date d = new Date();
+ SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd_HH_mm");
+ String strDate = f.format(d);
+ return strDate;
+ }
+
+
+ public static int getPhoneSDKIntForPlayBack(){
+ int a =0;
+ if(Build.BRAND.toLowerCase().contains("xiaomi")) a =24;
+ else a =Integer.parseInt(android.os.Build.VERSION.SDK);
+ return a;
+ }
+
+ public static int getPhoneMemoryForPlayBack(){
+ if(Tools.getPhoneTotalMemory()>=2.8&&Integer.parseInt(android.os.Build.VERSION.SDK)>=23)
+ return 1;
+ else return 0;
+ }
+
+ public static float getPhoneTotalMemory() {
+ if(memorySizeTotal!=0)return memorySizeTotal;
+ String str1 = "/proc/meminfo";// 系统内存信息文件
+ String str2;
+ String[] arrayOfString;
+ try {
+ FileReader localFileReader = new FileReader(str1);
+ BufferedReader localBufferedReader = new BufferedReader(localFileReader, 8192);
+ str2 = localBufferedReader.readLine();// 读取meminfo第一行,系统总内存大小
+ //LogTools.e("memory","getTotalMemory---str2="+str2);
+
+ arrayOfString = str2.split("\\s+");
+ for (String num : arrayOfString) {
+ //LogTools.e("memory","getTotalMemory---num="+num);
+ }
+
+ //LogTools.e("memory","getTotalMemory---KB---arrayOfString[1]="+Integer.valueOf(arrayOfString[1]).intValue());
+ double length = ((double)Integer.valueOf(arrayOfString[1]).intValue()) / ((double)1000);// MB
+ length = length / ((double)1000);// GB
+ memorySizeTotal = (float) length;
+ localBufferedReader.close();
+
+ } catch (IOException e) {
+ }
+ return memorySizeTotal;
+ }
+
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/VideoFramePool.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/VideoFramePool.java
new file mode 100644
index 0000000..907ddb2
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/VideoFramePool.java
@@ -0,0 +1,94 @@
+package com.ipcamera.detect.utils;
+
+import android.opengl.GLSurfaceView;
+
+import java.util.concurrent.LinkedBlockingQueue;
+
+public class VideoFramePool extends Thread {
+ boolean mExitFlag = false;
+
+ private GLSurfaceView surfaceView;
+ private MyRender myRender;
+ private int mframeSize;
+
+ public VideoFramePool(GLSurfaceView surfaceView, MyRender render) {
+ this.surfaceView = surfaceView;
+ this.myRender = render;
+ //this.surfaceView.setRenderMode(RENDERMODE_WHEN_DIRTY);
+ //surfaceView.setRenderer(render);
+ }
+
+ public void exit() {
+ mExitFlag = true;
+ framePool.clear();
+ }
+ //视频流帧队列
+ private LinkedBlockingQueue framePool = new LinkedBlockingQueue<>(50);
+
+ public void setFrameRate(int frameRate) {
+ this.frameRate = frameRate;
+ this.defaultRate = frameRate;
+ this.delayTime = 1000 / defaultRate;
+ }
+
+ private int frameRate = 15;
+ private int defaultRate = 15;
+ private int delayTime = 66;
+ private long startDate;
+ private long endDate;
+ int mHeight = 0;
+ int mWidth = 0;
+
+ @Override
+ public void run() {
+ android.os.Process
+ .setThreadPriority(android.os.Process.THREAD_PRIORITY_URGENT_AUDIO);
+ while (!mExitFlag) {
+ startDate = System.currentTimeMillis();
+
+ byte[] frameData = framePool.poll();
+ if (framePool.size() <= 5) {
+ frameRate = 10;
+ } else if (framePool.size() >= 10) {
+ frameRate = defaultRate;
+ }
+ if (frameData != null) {
+ this.myRender.writeSample(frameData,mframeSize,mWidth,mHeight);
+ }
+ Log.e("pool","poolsize "+framePool.size() +"frameRate***"+frameRate);
+ try {
+ endDate = System.currentTimeMillis();
+ if (frameRate == 10) {
+ Thread.sleep(Math.max(0, 100 - (endDate - startDate)), 1000);
+ } else if (frameRate == defaultRate) {
+ Thread.sleep(Math.max(0, delayTime - (endDate - startDate)), 1000);
+ }
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public void pushBytes(byte[] bytes,int frameSize,int w,int h) {
+ mWidth = w;
+ mHeight = h;
+ mframeSize = frameSize;
+ if (mExitFlag) {
+ return;
+ }
+ while (framePool.size() > defaultRate) {
+ framePool.poll();
+ }
+ framePool.offer(bytes);
+ }
+
+ public int getFramePoolSize()
+ {
+ return framePool.size();
+ }
+
+ public void clearBuffer()
+ {
+ framePool.clear();
+ }
+}
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/VuidUtils.java b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/VuidUtils.java
new file mode 100644
index 0000000..c93fe26
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/com/ipcamera/detect/utils/VuidUtils.java
@@ -0,0 +1,21 @@
+package com.ipcamera.detect.utils;
+
+import android.app.Activity;
+import android.content.Context;
+import android.graphics.Rect;
+import android.util.DisplayMetrics;
+
+public class VuidUtils {
+ /**
+ * 判断是否是VUID
+ * @param uid
+ * @return
+ */
+ public static boolean isVuid(String uid){
+ String uidRegex = "[a-zA-Z]{1,}\\d{7,}.*[a-zA-Z]{1,}";
+ if (uid.matches(uidRegex)) {
+ return true;
+ }
+ return false;
+ }
+}
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/vstc2/.DS_Store b/src/Driving_Reminder_Assistant/app/src/main/java/vstc2/.DS_Store
new file mode 100644
index 0000000..a90b2a3
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/java/vstc2/.DS_Store differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/java/vstc2/nativecaller/NativeCaller.java b/src/Driving_Reminder_Assistant/app/src/main/java/vstc2/nativecaller/NativeCaller.java
new file mode 100644
index 0000000..0e9251c
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/java/vstc2/nativecaller/NativeCaller.java
@@ -0,0 +1,366 @@
+package vstc2.nativecaller;
+
+
+import android.content.Context;
+
+public class NativeCaller {
+ static {
+ System.loadLibrary("vstc2_jni");
+ System.loadLibrary("mi_decoder");
+ }
+
+ public native static int PPPPAlarmSetting(String did, int alarm_audio,
+ int motion_armed, int motion_sensitivity, int input_armed,
+ int ioin_level, int iolinkage, int ioout_level, int alarmpresetsit,
+ int mail, int snapshot, int record, int upload_interval,
+ int schedule_enable, int schedule_sun_0, int schedule_sun_1,
+ int schedule_sun_2, int schedule_mon_0, int schedule_mon_1,
+ int schedule_mon_2, int schedule_tue_0, int schedule_tue_1,
+ int schedule_tue_2, int schedule_wed_0, int schedule_wed_1,
+ int schedule_wed_2, int schedule_thu_0, int schedule_thu_1,
+ int schedule_thu_2, int schedule_fri_0, int schedule_fri_1,
+ int schedule_fri_2, int schedule_sat_0, int schedule_sat_1,
+ int schedule_sat_2, int defense_plan1, int defense_plan2,
+ int defense_plan3, int defense_plan4, int defense_plan5,
+ int defense_plan6, int defense_plan7, int defense_plan8,
+ int defense_plan9, int defense_plan10, int defense_plan11,
+ int defense_plan12, int defense_plan13, int defense_plan14,
+ int defense_plan15, int defense_plan16, int defense_plan17,
+ int defense_plan18, int defense_plan19, int defense_plan20,
+ int defense_plan21,int remind_rate);
+
+ public native static int RecordLocal(String uid, String path, int bRecordLocal); // 0解码后的数据,1全部数据
+
+ public native static void PPPPInitialOther(String svr);
+
+ public native static void SetAPPDataPath(String path);
+
+ public native static void UpgradeFirmware(String did, String servPath,
+ String filePath, int type);
+
+ public native static int SetSensorStatus(String did, int status);// set_sensorstatus.cgi
+
+ public native static int DeleSensor(String did, int status);// del_sensor.cgi
+
+ public native static int EditSensor(String did, int status, String name);// set_sensorname.cgi
+
+ public native static int SetSensorPrest(String did, int preset, int sensorid);// set_sensor_preset.cgi
+
+ public native static int TransferMessage(String did, String msg, int len);
+
+ /*开启局域网搜索
+ */
+ public native static void StartSearch();
+
+ /*关闭局域网搜索
+ */
+ public native static void StopSearch();
+
+ public native static void Init();
+
+ public native static void Free();
+
+ public native static void FormatSD(String did);
+
+ public native static int StartPPPP(String did, String user, String pwd,
+ int bEnableLanSearch, String accountname, int p2pVer);
+
+ public native static int StartPPPPExt(String did, String user, String pwd,
+ int bEnableLanSearch, String accountname,String svr_no, int p2pVer);
+
+ public native static int StopPPPP(String did);
+
+ public native static int StartPPPPLivestream(String did, int streamid,
+ int substreamid);
+
+ public native static int StopPPPPLivestream(String did);
+
+ //硬件接口
+ public native static int SetHardCodeing(String did,int IsSupport);
+
+ public native static int PPPPPTZControl(String did, int command);
+
+ public native static int PPPPCameraControl(String did, int param, int value);
+
+ public native static int PPPPGetCGI(String did, int cgi);
+
+ public native static int PPPPStartAudio(String did);
+
+ public native static int PPPPStopAudio(String did);
+
+ public native static int PPPPStartTalk(String did);
+ public native static int PPPPStartTalk2(String did,int nEnable);
+
+ public native static int PPPPStopTalk(String did);
+
+ public native static int PPPPTalkAudioData(String did, byte[] data, int len);
+
+ public native static int PPPPNetworkDetect();
+
+ public native static void PPPPInitial(String svr);
+
+ public native static int PPPPSetCallbackContext(Context object);
+
+ /**
+ 初化回调接收服务
+ @param object: java层接收回调的Service
+ @param version 库版本号(通过GetVersion获取,如果是值是-1代表使用的是最新版本)
+ @return 1:成功调用接口
+ */
+ public native static int PPPPSetCallbackContext2(Context object,int version);
+
+ public native static int PPPPRebootDevice(String did);
+
+ public native static int PPPPRestorFactory(String did);
+
+ //public native static int StartPlayBack(String did, String filename,
+ // int offset, int picTag);
+
+ public native static int StartPlayBack(String did, String filename, int offset, long size,String strCachePath,int sdkVersion,int isHD);
+
+ public native static int StopPlayBack(String did);
+
+ public native static int PausePlayBack(String did,int pause);
+ public native static long PlayBackMovePos(String did,float pos);
+ public native static int SetPlayBackPos(String did,long time);
+ public native static int StrarRecordPlayBack(String did, String filepath);
+ //add end
+
+ public native static int PPPPGetSDCardRecordFileList(String did,
+ int PageIndex, int PageSize);
+
+ public native static int PPPPWifiSetting(String did, int enable,
+ String ssid, int channel, int mode, int authtype, int encryp,
+ int keyformat, int defkey, String key1, String key2, String key3,
+ String key4, int key1_bits, int key2_bits, int key3_bits,
+ int key4_bits, String wpa_psk);
+
+ public native static int PPPPNetworkSetting(String did, String ipaddr,
+ String netmask, String gateway, String dns1, String dns2, int dhcp,
+ int port, int rtsport);
+
+ public native static int PPPPUserSetting(String did, String user1,
+ String pwd1, String user2, String pwd2, String user3, String pwd3);
+
+ public native static int PPPPDatetimeSetting(String did, int now, int tz,
+ int ntp_enable, String ntp_svr);
+
+ public native static int PPPPDDNSSetting(String did, int service,
+ String user, String pwd, String host, String proxy_svr,
+ int ddns_mode, int proxy_port);
+
+ public native static int PPPPMailSetting(String did, String svr, int port,
+ String user, String pwd, int ssl, String sender, String receiver1,
+ String receiver2, String receiver3, String receiver4);
+
+ public native static int PPPPFtpSetting(String did, String svr_ftp,
+ String user, String pwd, String dir, int port, int mode,
+ int upload_interval);
+
+ public native static int PPPPPTZSetting(String did, int led_mod,
+ int ptz_center_onstart, int ptz_run_times, int ptz_patrol_rate,
+ int ptz_patrul_up_rate, int ptz_patrol_down_rate,
+ int ptz_patrol_left_rate, int ptz_patrol_right_rate,
+ int disable_preset);
+
+ // public native static int PPPPAlarmSetting(String did, int motion_armed,
+ // int motion_sensitivity, int input_armed, int ioin_level,
+ // int iolinkage, int ioout_level, int alarmpresetsit, int mail,
+ // int snapshot, int record, int upload_interval, int schedule_enable,
+ // int schedule_sun_0, int schedule_sun_1, int schedule_sun_2,
+ // int schedule_mon_0, int schedule_mon_1, int schedule_mon_2,
+ // int schedule_tue_0, int schedule_tue_1, int schedule_tue_2,
+ // int schedule_wed_0, int schedule_wed_1, int schedule_wed_2,
+ // int schedule_thu_0, int schedule_thu_1, int schedule_thu_2,
+ // int schedule_fri_0, int schedule_fri_1, int schedule_fri_2,
+ // int schedule_sat_0, int schedule_sat_1, int schedule_sat_2);
+
+ public native static int PPPPSDRecordSetting(String did,
+ int record_cover_enable, int record_timer, int record_size,int record_chnl,
+ int record_time_enable, int record_schedule_sun_0,
+ int record_schedule_sun_1, int record_schedule_sun_2,
+ int record_schedule_mon_0, int record_schedule_mon_1,
+ int record_schedule_mon_2, int record_schedule_tue_0,
+ int record_schedule_tue_1, int record_schedule_tue_2,
+ int record_schedule_wed_0, int record_schedule_wed_1,
+ int record_schedule_wed_2, int record_schedule_thu_0,
+ int record_schedule_thu_1, int record_schedule_thu_2,
+ int record_schedule_fri_0, int record_schedule_fri_1,
+ int record_schedule_fri_2, int record_schedule_sat_0,
+ int record_schedule_sat_1, int record_schedule_sat_2,int audio_enble);
+
+ public native static int PPPPEverydaySetting(String did,
+ int record_cover_enable, int record_timer, int record_size,int record_chnl,
+ int record_time_enable, int audio_enble);
+
+ public native static int PPPPGetSystemParams(String did, int paramType);
+
+ // takepicture
+ public native static int YUV4202RGB565(byte[] yuv, byte[] rgb, int width,
+ int height);
+
+ public native static int DecodeH264Frame(byte[] h264frame, int bIFrame,
+ byte[] yuvbuf, int length, int[] size);
+
+ public native static int ResetDecodeH264();
+
+ public native static int FindProcessByName(String process);
+
+
+ //inputbuff//原音频数据
+ //length//原音频数据长度
+ //outputbuff//转出来的音频数据
+ //public native static int DecodeAudio(byte[] aData,int length,byte[] outbuf);
+
+ //public native static int DecodeAudio(byte[] aData,int length, int isClean,int sample,int index,byte[] outbuf);
+
+ //inputbuff//原音频数据
+ //length//原音频数据长度
+ //outputbuff//转出来的音频数据
+ public native static int DecodeAudio(byte[] aData,int length, int isClean,int sample,int index);
+
+ //不使用时释放掉调用
+ public native static int FreeDecodeAudio();
+
+
+
+ public native static void YUV420SPTOYUV420P(byte[] SrcArray,byte[] DstSrray,int ySize);
+ public native static void YUV420SPTOYUV420POFFSET(byte[] SrcArray,byte[] DstSrray,int ySize,int decYsize);
+ public native static void YUV420OFFSET(byte[] SrcArray,byte[] DstSrray,int ySize,int decYsize);
+
+
+ /**************************wifi低功耗设备端接口beg************************************/
+ //置前台需要连接服务器
+ public native static int MagLowpowerDeviceConnect(String jIP);
+ //置后台需要断开服务器
+ public native static void MagLowpowerDeviceDisconnect();
+ //初化设备
+ public native static int MagLowpowerInitDevice( String jdid);
+ //取设备的状态
+ public native static int MagLowpowerGetDeviceStatus( String jdid);
+ //唤醒设备
+ public native static int MagLowpowerAwakenDevice(String jdid);
+ // TODO: 2019-10-14 低功耗设备状态(jni__version >= 4665)
+ /*
+ -2: p2p 连接fail 需要stop p2p然后再start p2p
+ -1: 没有初始化(想要start) 不需要stop p2p可直接start p2p
+ 1: p2p 连接上
+ 0: p2p 连接中
+ */
+ public native static int GetP2PConnetState(String jdid);
+ /**
+ * 保持设备激活
+ * @param deviceIdentity 设备id
+ * @param time 设备延时休眠时间不得少5秒
+ */
+ public native static int MagLowpowerKeepDeviceActive(String jdid,int time);
+ //移除节点节点,需要重新MagLowpowerInitDevice
+ public native static int MagLowpowerRemoveDevice(String jdid);
+ /**
+ * 立刻让设备休眠
+ * @param deviceIdentity 设备id
+ */
+ public native static int MagLowpowerSleepDevice(String jdid,int time);
+ /**************************wifi低功耗设备端接口end************************************/
+
+ /**************************4G低功耗设备端接口end************************************/
+ //置前台需要连接服务器
+ public native static int FlowDeviceConnect(String jIP);
+ //置后台需要断开服务器
+ public native static void FlowDeviceDisconnect();
+ //初化设备
+ public native static int FlowInitDevice( String jdid);
+ //取设备的状态
+ public native static int FlowGetDeviceStatus( String jdid);
+ //唤醒设备
+ public native static int FlowAwakenDevice(String jdid);
+ /**
+ * 保持设备激活
+ * @param deviceIdentity 设备id
+ * @param time 设备延时休眠时间不得少5秒
+ */
+ public native static int FlowKeepDeviceActive(String jdid,int time);
+
+ /**
+ * 立刻让设备休眠
+ * @param deviceIdentity 设备id
+ */
+ public native static int FlowSleepDevice(String jdid,int time);
+ //移除节点节点,需要重新FlowInitDevice
+ public native static int FlowRemoveDevice(String jdid);
+ /**************************4G低功耗设备端接口end************************************/
+
+ /*停止P2P
+ *did 设备uid
+ *p2pVer:0->PPPP 1->XQP2P
+ */
+ public native static int GetP2PVersion(int p2pVer);
+
+ //加一个接口 //获取vstc2_jni库版本
+ public native static int GetVersion();
+
+ //PP的P2P初化
+ public native static void PTPInitial(String svr);
+ //QX的P2P初化
+ public native static void QXPTPInitial(String svr);
+ //PP的P2P是否初化了 返回 0为没有,1为已初化
+ public native static int IsPTPInitial();
+ //QX的P2P是否初化了 返回 0为没有,1为已初化
+ public native static int IsQXPTPInitial();
+
+ //打印底层jni日志,nEnable=1为开启,0为关闭
+ //默认是关闭的
+ public native static void PrintJNILog(int nEnable);
+
+ public native static void FisheyeYUVdataSplit(byte[] inYUV,byte[] OutY,byte[] OutU,byte[] OutV,int nVideoWidth,int nVideoHeight,int nCut);
+
+ /**
+ 双重认证P2P连接
+ @param did: UID
+ @param pwd: 密码
+ @param bEnableLanSearch: 指定服务器
+ @param accountname: accountname
+ @param svr_no: P2P服务器串
+ @param add: 1:首次(绑定设备时) 0:已经绑定好了设备用
+ @param strVUID: 设备VUID
+ @param timestamp 上次在线unix时间戳(取不到就传0)
+ @return
+ */
+ public native static int StartVUID(String did, String pwd,int bEnableLanSearch,String accountname,String svr_no,int add,String strVUID,long timestamp);
+ //end vuid
+
+ /**
+ * 门铃设备TCP语音对讲连接
+ *
+ * @param did: 设备UID
+ * @param strIP: 服务器地址
+ * @param port: 服务器端口
+ * @param strToken: token
+ * @param strUser: 用户
+ * @return 1:成功调用接口
+ */
+ public native static int StratVoiceChannel(String did, String strIP, int port, String strToken, String strUser,String roomId);
+
+ /**
+ * 门铃设备TCP语音对讲数据
+ *
+ * @param did: 设备UID
+ * @param data: 对讲数据
+ * @param len: 长度
+ * @return 1:成功调用接口
+ */
+ public native static int VoiceTalkAudioData(String did, byte[] data, int len);
+
+ /**
+ * 门铃设备TCP语音对讲断开
+ *
+ * @param did: 设备UID
+ * @return 1:成功调用接口
+ */
+ public native static int StopVoiceChannel(String did);
+
+ /**
+ * 播放音频
+ */
+ public native static int PlayerVoice(String path);
+}
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/jniLibs/.DS_Store b/src/Driving_Reminder_Assistant/app/src/main/jniLibs/.DS_Store
new file mode 100644
index 0000000..1a5d1ca
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/jniLibs/.DS_Store differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/jniLibs/arm64-v8a/.DS_Store b/src/Driving_Reminder_Assistant/app/src/main/jniLibs/arm64-v8a/.DS_Store
new file mode 100644
index 0000000..5008ddf
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/jniLibs/arm64-v8a/.DS_Store differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/jniLibs/arm64-v8a/libVSFisheye.so b/src/Driving_Reminder_Assistant/app/src/main/jniLibs/arm64-v8a/libVSFisheye.so
new file mode 100644
index 0000000..5834487
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/jniLibs/arm64-v8a/libVSFisheye.so differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/jniLibs/arm64-v8a/libc++_shared.so b/src/Driving_Reminder_Assistant/app/src/main/jniLibs/arm64-v8a/libc++_shared.so
new file mode 100644
index 0000000..d863779
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/jniLibs/arm64-v8a/libc++_shared.so differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/jniLibs/arm64-v8a/libgetuiext3.so b/src/Driving_Reminder_Assistant/app/src/main/jniLibs/arm64-v8a/libgetuiext3.so
new file mode 100644
index 0000000..490b1e2
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/jniLibs/arm64-v8a/libgetuiext3.so differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/jniLibs/arm64-v8a/libmi_decoder.so b/src/Driving_Reminder_Assistant/app/src/main/jniLibs/arm64-v8a/libmi_decoder.so
new file mode 100644
index 0000000..a0566df
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/jniLibs/arm64-v8a/libmi_decoder.so differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/jniLibs/arm64-v8a/libvstc2_jni.so b/src/Driving_Reminder_Assistant/app/src/main/jniLibs/arm64-v8a/libvstc2_jni.so
new file mode 100644
index 0000000..2fc6793
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/jniLibs/arm64-v8a/libvstc2_jni.so differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/jniLibs/armeabi-v7a/.DS_Store b/src/Driving_Reminder_Assistant/app/src/main/jniLibs/armeabi-v7a/.DS_Store
new file mode 100644
index 0000000..5008ddf
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/jniLibs/armeabi-v7a/.DS_Store differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/jniLibs/armeabi-v7a/libVSFisheye.so b/src/Driving_Reminder_Assistant/app/src/main/jniLibs/armeabi-v7a/libVSFisheye.so
new file mode 100644
index 0000000..f8c9ca3
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/jniLibs/armeabi-v7a/libVSFisheye.so differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/jniLibs/armeabi-v7a/libc++_shared.so b/src/Driving_Reminder_Assistant/app/src/main/jniLibs/armeabi-v7a/libc++_shared.so
new file mode 100644
index 0000000..c13b045
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/jniLibs/armeabi-v7a/libc++_shared.so differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/jniLibs/armeabi-v7a/libgetuiext3.so b/src/Driving_Reminder_Assistant/app/src/main/jniLibs/armeabi-v7a/libgetuiext3.so
new file mode 100644
index 0000000..1bb6c59
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/jniLibs/armeabi-v7a/libgetuiext3.so differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/jniLibs/armeabi-v7a/libmi_decoder.so b/src/Driving_Reminder_Assistant/app/src/main/jniLibs/armeabi-v7a/libmi_decoder.so
new file mode 100644
index 0000000..71fc353
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/jniLibs/armeabi-v7a/libmi_decoder.so differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/jniLibs/armeabi-v7a/libvstc2_jni.so b/src/Driving_Reminder_Assistant/app/src/main/jniLibs/armeabi-v7a/libvstc2_jni.so
new file mode 100644
index 0000000..fbb3b65
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/jniLibs/armeabi-v7a/libvstc2_jni.so differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/.DS_Store b/src/Driving_Reminder_Assistant/app/src/main/res/.DS_Store
new file mode 100644
index 0000000..ab02430
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/.DS_Store differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/anim/code_rotate_anim.xml b/src/Driving_Reminder_Assistant/app/src/main/res/anim/code_rotate_anim.xml
new file mode 100644
index 0000000..3b3889c
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/anim/code_rotate_anim.xml
@@ -0,0 +1,5 @@
+
+
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/anim/in_from_left.xml b/src/Driving_Reminder_Assistant/app/src/main/res/anim/in_from_left.xml
new file mode 100644
index 0000000..6172b82
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/anim/in_from_left.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/anim/in_from_right.xml b/src/Driving_Reminder_Assistant/app/src/main/res/anim/in_from_right.xml
new file mode 100644
index 0000000..8eeb40b
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/anim/in_from_right.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/anim/menu_dismiss.xml b/src/Driving_Reminder_Assistant/app/src/main/res/anim/menu_dismiss.xml
new file mode 100644
index 0000000..20a64dc
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/anim/menu_dismiss.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/anim/menu_show.xml b/src/Driving_Reminder_Assistant/app/src/main/res/anim/menu_show.xml
new file mode 100644
index 0000000..29d49a6
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/anim/menu_show.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/anim/out_to_left.xml b/src/Driving_Reminder_Assistant/app/src/main/res/anim/out_to_left.xml
new file mode 100644
index 0000000..eff0a86
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/anim/out_to_left.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/anim/out_to_right.xml b/src/Driving_Reminder_Assistant/app/src/main/res/anim/out_to_right.xml
new file mode 100644
index 0000000..9a953d8
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/anim/out_to_right.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/anim/ptz_otherset_anim.xml b/src/Driving_Reminder_Assistant/app/src/main/res/anim/ptz_otherset_anim.xml
new file mode 100644
index 0000000..be0e55e
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/anim/ptz_otherset_anim.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/anim/ptz_otherset_anim_dismiss.xml b/src/Driving_Reminder_Assistant/app/src/main/res/anim/ptz_otherset_anim_dismiss.xml
new file mode 100644
index 0000000..c5d0075
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/anim/ptz_otherset_anim_dismiss.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/anim/ptz_otherset_anim_show.xml b/src/Driving_Reminder_Assistant/app/src/main/res/anim/ptz_otherset_anim_show.xml
new file mode 100644
index 0000000..a804da5
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/anim/ptz_otherset_anim_show.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/anim/ptz_top_anim_dismiss.xml b/src/Driving_Reminder_Assistant/app/src/main/res/anim/ptz_top_anim_dismiss.xml
new file mode 100644
index 0000000..7069789
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/anim/ptz_top_anim_dismiss.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/anim/ptz_top_anim_show.xml b/src/Driving_Reminder_Assistant/app/src/main/res/anim/ptz_top_anim_show.xml
new file mode 100644
index 0000000..73c3f6d
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/anim/ptz_top_anim_show.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/anim/splash_anim.xml b/src/Driving_Reminder_Assistant/app/src/main/res/anim/splash_anim.xml
new file mode 100644
index 0000000..d5de6a0
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/anim/splash_anim.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/anim/zoomin.xml b/src/Driving_Reminder_Assistant/app/src/main/res/anim/zoomin.xml
new file mode 100644
index 0000000..7a5cabe
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/anim/zoomin.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/anim/zoomout.xml b/src/Driving_Reminder_Assistant/app/src/main/res/anim/zoomout.xml
new file mode 100644
index 0000000..6ff1816
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/anim/zoomout.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/about.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/about.png
new file mode 100644
index 0000000..3a7688a
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/about.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/abs__spinner_ab_default_holo_light.9.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/abs__spinner_ab_default_holo_light.9.png
new file mode 100644
index 0000000..46a1f19
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/abs__spinner_ab_default_holo_light.9.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/add.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/add.png
new file mode 100644
index 0000000..837c115
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/add.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/add_btn_normal.9.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/add_btn_normal.9.png
new file mode 100644
index 0000000..8feb6f1
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/add_btn_normal.9.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/add_btn_pressed.9.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/add_btn_pressed.9.png
new file mode 100644
index 0000000..7b6d584
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/add_btn_pressed.9.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/add_defense_0.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/add_defense_0.png
new file mode 100644
index 0000000..d8f7def
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/add_defense_0.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/add_defense_1.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/add_defense_1.png
new file mode 100644
index 0000000..d691553
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/add_defense_1.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/add_defense_ok.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/add_defense_ok.png
new file mode 100644
index 0000000..bbe83b8
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/add_defense_ok.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/add_sensor_ok.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/add_sensor_ok.png
new file mode 100644
index 0000000..b2c33da
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/add_sensor_ok.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/alarm_log_bg.9.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/alarm_log_bg.9.png
new file mode 100644
index 0000000..e87993a
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/alarm_log_bg.9.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/app.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/app.png
new file mode 100644
index 0000000..95f8879
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/app.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/app_title_background.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/app_title_background.png
new file mode 100644
index 0000000..53a5372
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/app_title_background.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/arrow.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/arrow.png
new file mode 100644
index 0000000..cf42de3
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/arrow.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/arrowdown.PNG b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/arrowdown.PNG
new file mode 100644
index 0000000..b5d6752
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/arrowdown.PNG differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/back_play.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/back_play.png
new file mode 100644
index 0000000..cf96bda
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/back_play.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/bad_video.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/bad_video.png
new file mode 100644
index 0000000..8dce150
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/bad_video.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/bottom.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/bottom.png
new file mode 100644
index 0000000..a39322a
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/bottom.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/btn_back_normal.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/btn_back_normal.png
new file mode 100644
index 0000000..68a57d2
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/btn_back_normal.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/btn_back_pressed.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/btn_back_pressed.png
new file mode 100644
index 0000000..e67a331
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/btn_back_pressed.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/btn_back_pressed1.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/btn_back_pressed1.png
new file mode 100644
index 0000000..0130b68
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/btn_back_pressed1.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/btn_normal.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/btn_normal.png
new file mode 100644
index 0000000..2418bad
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/btn_normal.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/btn_pressed.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/btn_pressed.png
new file mode 100644
index 0000000..bb13a8f
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/btn_pressed.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/button_loction_nor.9.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/button_loction_nor.9.png
new file mode 100644
index 0000000..20a6692
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/button_loction_nor.9.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/button_loction_press.9.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/button_loction_press.9.png
new file mode 100644
index 0000000..9c18b2a
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/button_loction_press.9.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/camera_defense_divider.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/camera_defense_divider.png
new file mode 100644
index 0000000..0c3c5dc
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/camera_defense_divider.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/camera_light_btn_off.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/camera_light_btn_off.png
new file mode 100644
index 0000000..d85f81f
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/camera_light_btn_off.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/camera_light_btn_on.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/camera_light_btn_on.png
new file mode 100644
index 0000000..f6fa45e
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/camera_light_btn_on.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/camera_siren_btn_off.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/camera_siren_btn_off.png
new file mode 100644
index 0000000..25cec8b
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/camera_siren_btn_off.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/camera_siren_btn_on.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/camera_siren_btn_on.png
new file mode 100644
index 0000000..8764a3f
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/camera_siren_btn_on.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/cancel_code.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/cancel_code.png
new file mode 100644
index 0000000..8faeb69
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/cancel_code.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/check_top_tab_pressed.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/check_top_tab_pressed.png
new file mode 100644
index 0000000..fa94479
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/check_top_tab_pressed.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/checkleft_normal.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/checkleft_normal.png
new file mode 100644
index 0000000..92d7e44
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/checkleft_normal.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/checkmiddle_normal.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/checkmiddle_normal.png
new file mode 100644
index 0000000..0a550c5
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/checkmiddle_normal.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/checkmiddle_pressed.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/checkmiddle_pressed.png
new file mode 100644
index 0000000..b7f6df5
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/checkmiddle_pressed.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/checkphone_normal.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/checkphone_normal.png
new file mode 100644
index 0000000..d3b0306
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/checkphone_normal.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/checkphone_pressed.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/checkphone_pressed.png
new file mode 100644
index 0000000..06e9f2a
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/checkphone_pressed.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/checkright_normal.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/checkright_normal.png
new file mode 100644
index 0000000..06b163e
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/checkright_normal.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/checkright_pressed.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/checkright_pressed.png
new file mode 100644
index 0000000..461baa1
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/checkright_pressed.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/checktopleft_pressed.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/checktopleft_pressed.png
new file mode 100644
index 0000000..da4b4a1
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/checktopleft_pressed.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/close_no.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/close_no.png
new file mode 100644
index 0000000..22c0309
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/close_no.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/close_press.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/close_press.png
new file mode 100644
index 0000000..09b0a1f
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/close_press.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/code_sucess_new_background.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/code_sucess_new_background.png
new file mode 100644
index 0000000..c85ea20
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/code_sucess_new_background.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/codeing.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/codeing.png
new file mode 100644
index 0000000..8b953e0
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/codeing.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/common_stretch_arrow_downward.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/common_stretch_arrow_downward.png
new file mode 100644
index 0000000..5c0af5f
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/common_stretch_arrow_downward.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/common_stretch_arrow_upward.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/common_stretch_arrow_upward.png
new file mode 100644
index 0000000..9ca2bca
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/common_stretch_arrow_upward.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/control.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/control.png
new file mode 100644
index 0000000..8dee8c0
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/control.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/del_hook.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/del_hook.png
new file mode 100644
index 0000000..8a220e8
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/del_hook.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/detailpanel_bg.9.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/detailpanel_bg.9.png
new file mode 100644
index 0000000..9ba476d
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/detailpanel_bg.9.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/down.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/down.png
new file mode 100644
index 0000000..ade7b68
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/down.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/easyicon_cn.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/easyicon_cn.png
new file mode 100644
index 0000000..ed5c94c
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/easyicon_cn.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/edit_bg.9.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/edit_bg.9.png
new file mode 100644
index 0000000..44ded1e
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/edit_bg.9.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/emoji.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/emoji.png
new file mode 100644
index 0000000..b2146ae
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/emoji.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/exit.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/exit.png
new file mode 100644
index 0000000..05577f2
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/exit.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/exitbutton.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/exitbutton.png
new file mode 100644
index 0000000..64867d3
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/exitbutton.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/gas.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/gas.png
new file mode 100644
index 0000000..fd7add4
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/gas.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/grid_bg.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/grid_bg.png
new file mode 100644
index 0000000..c1fe2f0
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/grid_bg.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/have_new.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/have_new.png
new file mode 100644
index 0000000..62fa618
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/have_new.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ic_delete_camera.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ic_delete_camera.png
new file mode 100644
index 0000000..b2b4e66
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ic_delete_camera.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ic_edit_camera.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ic_edit_camera.png
new file mode 100644
index 0000000..f13a01a
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ic_edit_camera.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ic_menu_album_inverse.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ic_menu_album_inverse.png
new file mode 100644
index 0000000..f93d050
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ic_menu_album_inverse.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ic_setting_camera.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ic_setting_camera.png
new file mode 100644
index 0000000..a3c9295
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ic_setting_camera.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/icon_gpio.JPG b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/icon_gpio.JPG
new file mode 100644
index 0000000..90cdee7
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/icon_gpio.JPG differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/icon_motion.JPG b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/icon_motion.JPG
new file mode 100644
index 0000000..2a5bdd9
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/icon_motion.JPG differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/icon_rec.PNG b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/icon_rec.PNG
new file mode 100644
index 0000000..e6b429b
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/icon_rec.PNG differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/info.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/info.png
new file mode 100644
index 0000000..d9ae475
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/info.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/infrared.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/infrared.png
new file mode 100644
index 0000000..0852c9f
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/infrared.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/left.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/left.png
new file mode 100644
index 0000000..c6c5eaf
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/left.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/list_bg.9.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/list_bg.9.png
new file mode 100644
index 0000000..50eba83
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/list_bg.9.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/list_switch_closed.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/list_switch_closed.png
new file mode 100644
index 0000000..5ee50d0
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/list_switch_closed.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/list_switch_open.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/list_switch_open.png
new file mode 100644
index 0000000..d5968c6
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/list_switch_open.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/listview_single_white_line.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/listview_single_white_line.png
new file mode 100644
index 0000000..f0c7d7b
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/listview_single_white_line.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/magnetic.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/magnetic.png
new file mode 100644
index 0000000..bc151fa
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/magnetic.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/main_addcamera_normal.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/main_addcamera_normal.png
new file mode 100644
index 0000000..04a55b6
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/main_addcamera_normal.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/main_alarm.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/main_alarm.png
new file mode 100644
index 0000000..07f9566
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/main_alarm.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/main_bottom_bg.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/main_bottom_bg.png
new file mode 100644
index 0000000..4f9d752
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/main_bottom_bg.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/main_bottomtab_bg_pressed.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/main_bottomtab_bg_pressed.png
new file mode 100644
index 0000000..c4e8b87
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/main_bottomtab_bg_pressed.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/main_picture.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/main_picture.png
new file mode 100644
index 0000000..e6ad75e
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/main_picture.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/main_right_menu.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/main_right_menu.png
new file mode 100644
index 0000000..ad3208a
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/main_right_menu.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/main_video.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/main_video.png
new file mode 100644
index 0000000..bcfc9e5
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/main_video.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/menu_bg_down.9.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/menu_bg_down.9.png
new file mode 100644
index 0000000..6def4cc
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/menu_bg_down.9.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/mic.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/mic.png
new file mode 100644
index 0000000..49575a4
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/mic.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/more_activity_logout_button_background.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/more_activity_logout_button_background.png
new file mode 100644
index 0000000..40d7e17
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/more_activity_logout_button_background.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/more_listtem_gonext.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/more_listtem_gonext.png
new file mode 100644
index 0000000..1c71295
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/more_listtem_gonext.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ok.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ok.png
new file mode 100644
index 0000000..7d44c18
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ok.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/one.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/one.png
new file mode 100644
index 0000000..f022a36
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/one.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/order_details_bg.9.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/order_details_bg.9.png
new file mode 100644
index 0000000..3353bad
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/order_details_bg.9.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/pic_defulte.9.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/pic_defulte.9.png
new file mode 100644
index 0000000..cbae1fe
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/pic_defulte.9.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/picture_default.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/picture_default.png
new file mode 100644
index 0000000..5c788dc
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/picture_default.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/play_video.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/play_video.png
new file mode 100644
index 0000000..01966ec
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/play_video.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_audio_off.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_audio_off.png
new file mode 100644
index 0000000..9c34f13
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_audio_off.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_audio_on.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_audio_on.png
new file mode 100644
index 0000000..2156ce1
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_audio_on.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_brightness.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_brightness.png
new file mode 100644
index 0000000..64d7990
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_brightness.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_center.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_center.png
new file mode 100644
index 0000000..8a70155
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_center.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_contrast.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_contrast.png
new file mode 100644
index 0000000..9b08ce3
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_contrast.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_default_set.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_default_set.png
new file mode 100644
index 0000000..d2eb01a
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_default_set.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_download.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_download.png
new file mode 100644
index 0000000..3247efe
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_download.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_hori_mirror.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_hori_mirror.png
new file mode 100644
index 0000000..e1a2f0c
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_hori_mirror.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_hori_mirror_press.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_hori_mirror_press.png
new file mode 100644
index 0000000..450dc97
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_hori_mirror_press.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_hori_tour.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_hori_tour.png
new file mode 100644
index 0000000..db70836
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_hori_tour.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_microphone_off.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_microphone_off.png
new file mode 100644
index 0000000..79cc11a
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_microphone_off.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_microphone_on.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_microphone_on.png
new file mode 100644
index 0000000..8396cfd
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_microphone_on.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_pause.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_pause.png
new file mode 100644
index 0000000..7386113
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_pause.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_play.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_play.png
new file mode 100644
index 0000000..c10267e
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_play.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_playmode_enlarge.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_playmode_enlarge.png
new file mode 100644
index 0000000..2cec4f3
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_playmode_enlarge.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_playmode_fullscreen.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_playmode_fullscreen.png
new file mode 100644
index 0000000..0eb4d3b
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_playmode_fullscreen.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_playmode_standard.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_playmode_standard.png
new file mode 100644
index 0000000..ef8fcc8
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_playmode_standard.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_resolution_720p.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_resolution_720p.png
new file mode 100644
index 0000000..299e64f
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_resolution_720p.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_resolution_preset.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_resolution_preset.png
new file mode 100644
index 0000000..d4ac8e7
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_resolution_preset.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_resolution_qvga.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_resolution_qvga.png
new file mode 100644
index 0000000..f506271
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_resolution_qvga.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_resolution_vga.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_resolution_vga.png
new file mode 100644
index 0000000..aca094e
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_resolution_vga.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_takepic.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_takepic.png
new file mode 100644
index 0000000..b01916c
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_takepic.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_takevideo.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_takevideo.png
new file mode 100644
index 0000000..4786969
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_takevideo.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_takevideo_pressed.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_takevideo_pressed.png
new file mode 100644
index 0000000..a3a8de3
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_takevideo_pressed.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_vert_mirror.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_vert_mirror.png
new file mode 100644
index 0000000..25b54f9
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_vert_mirror.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_vert_mirror_press.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_vert_mirror_press.png
new file mode 100644
index 0000000..4fefb6b
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_vert_mirror_press.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_vert_tour.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_vert_tour.png
new file mode 100644
index 0000000..baa70e0
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/ptz_vert_tour.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/red.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/red.png
new file mode 100644
index 0000000..3f097ef
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/red.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/refresh.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/refresh.png
new file mode 100644
index 0000000..ac6b138
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/refresh.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/right.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/right.png
new file mode 100644
index 0000000..e507e99
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/right.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/rightdown.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/rightdown.png
new file mode 100644
index 0000000..b3721c2
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/rightdown.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/rightdown_pressed.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/rightdown_pressed.png
new file mode 100644
index 0000000..d2dc208
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/rightdown_pressed.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/search.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/search.png
new file mode 100644
index 0000000..625f669
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/search.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/seekbg.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/seekbg.png
new file mode 100644
index 0000000..c6a8cc1
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/seekbg.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/seekprogress.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/seekprogress.png
new file mode 100644
index 0000000..2b5184c
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/seekprogress.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensor_add_new.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensor_add_new.png
new file mode 100644
index 0000000..62fa618
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensor_add_new.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensor_back.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensor_back.png
new file mode 100644
index 0000000..bbf468c
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensor_back.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensor_code_new.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensor_code_new.png
new file mode 100644
index 0000000..25212ed
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensor_code_new.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensor_siren_icon.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensor_siren_icon.png
new file mode 100644
index 0000000..aef1fb0
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensor_siren_icon.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensorlist_background.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensorlist_background.png
new file mode 100644
index 0000000..8c4a891
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensorlist_background.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensorlist_item_control.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensorlist_item_control.png
new file mode 100644
index 0000000..902d04a
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensorlist_item_control.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensorlist_item_gas.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensorlist_item_gas.png
new file mode 100644
index 0000000..363efe4
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensorlist_item_gas.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensorlist_item_infrared.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensorlist_item_infrared.png
new file mode 100644
index 0000000..63e2433
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensorlist_item_infrared.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensorlist_item_magnetic.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensorlist_item_magnetic.png
new file mode 100644
index 0000000..e7b49c7
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensorlist_item_magnetic.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensorlist_item_smoke.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensorlist_item_smoke.png
new file mode 100644
index 0000000..4d33be2
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sensorlist_item_smoke.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/somke.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/somke.png
new file mode 100644
index 0000000..dad2a75
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/somke.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sos.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sos.png
new file mode 100644
index 0000000..30abdc7
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/sos.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/splash.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/splash.png
new file mode 100644
index 0000000..b5a58ef
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/splash.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/start_code_mangetic_5.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/start_code_mangetic_5.png
new file mode 100644
index 0000000..f30d57f
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/start_code_mangetic_5.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/start_code_siren_1.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/start_code_siren_1.png
new file mode 100644
index 0000000..b94f92c
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/start_code_siren_1.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/start_code_siren_2.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/start_code_siren_2.png
new file mode 100644
index 0000000..1cffa94
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/start_code_siren_2.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/start_code_siren_3.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/start_code_siren_3.png
new file mode 100644
index 0000000..31c1871
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/start_code_siren_3.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/start_code_siren_4.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/start_code_siren_4.png
new file mode 100644
index 0000000..4631129
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/start_code_siren_4.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/title_back.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/title_back.png
new file mode 100644
index 0000000..23ebf0c
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/title_back.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/top.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/top.png
new file mode 100644
index 0000000..4e969e5
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/top.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/top_bg.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/top_bg.png
new file mode 100644
index 0000000..79f8838
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/top_bg.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/top_bg_blue.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/top_bg_blue.png
new file mode 100644
index 0000000..e78bb1a
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/top_bg_blue.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/toptitle.9.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/toptitle.9.png
new file mode 100644
index 0000000..51a0ad4
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/toptitle.9.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/up.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/up.png
new file mode 100644
index 0000000..0a3318f
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/up.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/userinfo_list_back_1.9.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/userinfo_list_back_1.9.png
new file mode 100644
index 0000000..442e71b
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/userinfo_list_back_1.9.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/video_default.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/video_default.png
new file mode 100644
index 0000000..f806347
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/video_default.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/video_play_left_normal.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/video_play_left_normal.png
new file mode 100644
index 0000000..8776006
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/video_play_left_normal.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/video_play_left_pressed.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/video_play_left_pressed.png
new file mode 100644
index 0000000..dd282e4
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/video_play_left_pressed.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/video_play_pause_normal.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/video_play_pause_normal.png
new file mode 100644
index 0000000..906ec4c
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/video_play_pause_normal.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/video_play_pause_pressed.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/video_play_pause_pressed.png
new file mode 100644
index 0000000..99f3b02
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/video_play_pause_pressed.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/video_play_play_normal.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/video_play_play_normal.png
new file mode 100644
index 0000000..c311f3a
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/video_play_play_normal.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/video_play_play_pressed.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/video_play_play_pressed.png
new file mode 100644
index 0000000..d3c5b0f
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/video_play_play_pressed.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/video_play_right_normal.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/video_play_right_normal.png
new file mode 100644
index 0000000..53bdfba
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/video_play_right_normal.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/video_play_right_pressed.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/video_play_right_pressed.png
new file mode 100644
index 0000000..bf33611
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/video_play_right_pressed.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/vidicon.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/vidicon.png
new file mode 100644
index 0000000..464a0df
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/vidicon.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/vidicon_add.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/vidicon_add.png
new file mode 100644
index 0000000..1d58ca0
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/vidicon_add.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/vidicon_bottom.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/vidicon_bottom.png
new file mode 100644
index 0000000..5296d2a
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-hdpi/vidicon_bottom.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-ldpi/ic_launcher.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-ldpi/ic_launcher.png
new file mode 100644
index 0000000..1095584
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-ldpi/ic_launcher.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable-mdpi/ic_launcher.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-mdpi/ic_launcher.png
new file mode 100644
index 0000000..a07c69f
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable-mdpi/ic_launcher.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/about_text_bg.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/about_text_bg.xml
new file mode 100644
index 0000000..d47ec86
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/about_text_bg.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/add_btn_selector.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/add_btn_selector.xml
new file mode 100644
index 0000000..f467490
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/add_btn_selector.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/addvidiconshape.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/addvidiconshape.xml
new file mode 100644
index 0000000..482a888
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/addvidiconshape.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/back.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/back.png
new file mode 100644
index 0000000..cf460a1
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/back.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/background_grayblack.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/background_grayblack.xml
new file mode 100644
index 0000000..932c577
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/background_grayblack.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/background_image.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/background_image.xml
new file mode 100644
index 0000000..58e62b6
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/background_image.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/background_osd.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/background_osd.xml
new file mode 100644
index 0000000..636ec20
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/background_osd.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/background_separate_vertical.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/background_separate_vertical.xml
new file mode 100644
index 0000000..6f57833
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/background_separate_vertical.xml
@@ -0,0 +1,5 @@
+
+
+
+
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/background_silver.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/background_silver.xml
new file mode 100644
index 0000000..51ef4e0
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/background_silver.xml
@@ -0,0 +1,5 @@
+
+
+
+
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/background_silver_light.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/background_silver_light.xml
new file mode 100644
index 0000000..699795a
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/background_silver_light.xml
@@ -0,0 +1,5 @@
+
+
+
+
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/background_white_corner.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/background_white_corner.xml
new file mode 100644
index 0000000..5bf1be0
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/background_white_corner.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/bottle_night_bg.jpg b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/bottle_night_bg.jpg
new file mode 100644
index 0000000..57ea249
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/bottle_night_bg.jpg differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/brightcontrastprogress.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/brightcontrastprogress.xml
new file mode 100644
index 0000000..12c1522
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/brightcontrastprogress.xml
@@ -0,0 +1,14 @@
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/btn_back_selector.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/btn_back_selector.xml
new file mode 100644
index 0000000..78726ba
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/btn_back_selector.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/btnselector.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/btnselector.xml
new file mode 100644
index 0000000..e9e5959
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/btnselector.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/button_loct.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/button_loct.xml
new file mode 100644
index 0000000..fa3fc54
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/button_loct.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/button_selector.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/button_selector.xml
new file mode 100644
index 0000000..fefbe23
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/button_selector.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/checkphone_selector.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/checkphone_selector.xml
new file mode 100644
index 0000000..d13d9f4
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/checkphone_selector.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/choose_video_plan.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/choose_video_plan.xml
new file mode 100644
index 0000000..6202b04
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/choose_video_plan.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/close_selector.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/close_selector.xml
new file mode 100644
index 0000000..48e45de
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/close_selector.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/contanct.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/contanct.png
new file mode 100644
index 0000000..74c63f6
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/contanct.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/customprogress.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/customprogress.xml
new file mode 100644
index 0000000..24d0db2
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/customprogress.xml
@@ -0,0 +1,26 @@
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/customprogress_thumb.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/customprogress_thumb.xml
new file mode 100644
index 0000000..740b2ab
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/customprogress_thumb.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/del.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/del.png
new file mode 100644
index 0000000..e6e372c
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/del.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/eject.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/eject.png
new file mode 100644
index 0000000..2b8baa2
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/eject.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/handle.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/handle.png
new file mode 100644
index 0000000..15c3b32
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/handle.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/icon.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/icon.png
new file mode 100644
index 0000000..63e3a10
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/icon.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/list_bgnull_selector.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/list_bgnull_selector.xml
new file mode 100644
index 0000000..f6cdca1
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/list_bgnull_selector.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/list_item_divider.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/list_item_divider.xml
new file mode 100644
index 0000000..26dae0e
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/list_item_divider.xml
@@ -0,0 +1,6 @@
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/listitem_bg_selector.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/listitem_bg_selector.xml
new file mode 100644
index 0000000..c78e07a
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/listitem_bg_selector.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/listitem_one_pressed.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/listitem_one_pressed.xml
new file mode 100644
index 0000000..508705e
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/listitem_one_pressed.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/listitem_one_pressed_selector.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/listitem_one_pressed_selector.xml
new file mode 100644
index 0000000..aa7c568
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/listitem_one_pressed_selector.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/listitem_pressed_bottom_corner.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/listitem_pressed_bottom_corner.xml
new file mode 100644
index 0000000..23f876c
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/listitem_pressed_bottom_corner.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/listitem_pressed_bottom_corner_selector.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/listitem_pressed_bottom_corner_selector.xml
new file mode 100644
index 0000000..8937996
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/listitem_pressed_bottom_corner_selector.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/listitem_pressed_selector.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/listitem_pressed_selector.xml
new file mode 100644
index 0000000..975848b
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/listitem_pressed_selector.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/listitem_pressed_top_corner.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/listitem_pressed_top_corner.xml
new file mode 100644
index 0000000..617239f
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/listitem_pressed_top_corner.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/listitem_pressed_top_corner_selector.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/listitem_pressed_top_corner_selector.xml
new file mode 100644
index 0000000..bf051a2
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/listitem_pressed_top_corner_selector.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/localpic_selector.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/localpic_selector.xml
new file mode 100644
index 0000000..d1d7f79
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/localpic_selector.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/main_search_add_corner.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/main_search_add_corner.xml
new file mode 100644
index 0000000..0a2bef0
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/main_search_add_corner.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/mainsetting_dialog_frame.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/mainsetting_dialog_frame.xml
new file mode 100644
index 0000000..c2b84a0
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/mainsetting_dialog_frame.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/my_switch.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/my_switch.xml
new file mode 100644
index 0000000..df223f7
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/my_switch.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/myseekbar.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/myseekbar.xml
new file mode 100644
index 0000000..f3a6039
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/myseekbar.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/pause.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/pause.png
new file mode 100644
index 0000000..ff4eb53
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/pause.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/play.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/play.png
new file mode 100644
index 0000000..01d22cf
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/play.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/ptz_brightness_selector.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/ptz_brightness_selector.xml
new file mode 100644
index 0000000..e934877
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/ptz_brightness_selector.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/ptz_default_set_selector.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/ptz_default_set_selector.xml
new file mode 100644
index 0000000..0e2b0b4
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/ptz_default_set_selector.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/ptz_takepic_selector.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/ptz_takepic_selector.xml
new file mode 100644
index 0000000..eba7977
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/ptz_takepic_selector.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/ptz_takevideo_selector.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/ptz_takevideo_selector.xml
new file mode 100644
index 0000000..4b52322
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/ptz_takevideo_selector.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/rightdown_selector.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/rightdown_selector.xml
new file mode 100644
index 0000000..a55d4da
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/rightdown_selector.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/sound_line.bmp b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/sound_line.bmp
new file mode 100644
index 0000000..4b47d01
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/sound_line.bmp differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/sound_line1.BMP b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/sound_line1.BMP
new file mode 100644
index 0000000..5c23ad5
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/sound_line1.BMP differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/sounddisable.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/sounddisable.png
new file mode 100644
index 0000000..e295b64
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/sounddisable.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/soundenable.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/soundenable.png
new file mode 100644
index 0000000..6e2b7a1
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/soundenable.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/stepbackward.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/stepbackward.png
new file mode 100644
index 0000000..4b3bd2c
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/stepbackward.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/stepforward.png b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/stepforward.png
new file mode 100644
index 0000000..26f71fa
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/stepforward.png differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/style_image_border.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/style_image_border.xml
new file mode 100644
index 0000000..7a8356c
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/style_image_border.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/video_play_left_selector.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/video_play_left_selector.xml
new file mode 100644
index 0000000..0cf3812
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/video_play_left_selector.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/video_play_pause_selector.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/video_play_pause_selector.xml
new file mode 100644
index 0000000..826c8f3
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/video_play_pause_selector.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/video_play_play_selector.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/video_play_play_selector.xml
new file mode 100644
index 0000000..74e4a6b
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/video_play_play_selector.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/video_play_right_selector.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/video_play_right_selector.xml
new file mode 100644
index 0000000..9782376
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/video_play_right_selector.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/drawable/vidicon_selector.xml b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/vidicon_selector.xml
new file mode 100644
index 0000000..ee5512a
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/drawable/vidicon_selector.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/activity_ip_connect.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/activity_ip_connect.xml
new file mode 100644
index 0000000..c2b353b
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/activity_ip_connect.xml
@@ -0,0 +1,131 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/activity_message.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/activity_message.xml
new file mode 100644
index 0000000..8fe1eac
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/activity_message.xml
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/add_camera.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/add_camera.xml
new file mode 100644
index 0000000..7f18152
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/add_camera.xml
@@ -0,0 +1,283 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/alermaudiopopwindow.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/alermaudiopopwindow.xml
new file mode 100644
index 0000000..01f4776
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/alermaudiopopwindow.xml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/alermiooutpopwindow.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/alermiooutpopwindow.xml
new file mode 100644
index 0000000..afe4100
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/alermiooutpopwindow.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/alermpresetmovepopwindow.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/alermpresetmovepopwindow.xml
new file mode 100644
index 0000000..a351c05
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/alermpresetmovepopwindow.xml
@@ -0,0 +1,277 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/alermsensitivepopwindow.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/alermsensitivepopwindow.xml
new file mode 100644
index 0000000..35ef8c2
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/alermsensitivepopwindow.xml
@@ -0,0 +1,171 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/alermtriggerpopwindow.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/alermtriggerpopwindow.xml
new file mode 100644
index 0000000..2fd4eec
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/alermtriggerpopwindow.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/brightprogress.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/brightprogress.xml
new file mode 100644
index 0000000..a8ab863
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/brightprogress.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/control_device_view.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/control_device_view.xml
new file mode 100644
index 0000000..f2db348
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/control_device_view.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/edit_sensor.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/edit_sensor.xml
new file mode 100644
index 0000000..1761905
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/edit_sensor.xml
@@ -0,0 +1,220 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/linkcamera_layout.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/linkcamera_layout.xml
new file mode 100644
index 0000000..7045e5a
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/linkcamera_layout.xml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/loadmorecount.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/loadmorecount.xml
new file mode 100644
index 0000000..219cf39
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/loadmorecount.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/local_picture.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/local_picture.xml
new file mode 100644
index 0000000..7b75916
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/local_picture.xml
@@ -0,0 +1,112 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/localpicture_listitem.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/localpicture_listitem.xml
new file mode 100644
index 0000000..ef61214
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/localpicture_listitem.xml
@@ -0,0 +1,109 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/main.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/main.xml
new file mode 100644
index 0000000..aed556a
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/main.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/message_list_item.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/message_list_item.xml
new file mode 100644
index 0000000..9e4af05
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/message_list_item.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/move_message.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/move_message.xml
new file mode 100644
index 0000000..13025a2
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/move_message.xml
@@ -0,0 +1,110 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/play.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/play.xml
new file mode 100644
index 0000000..8deecdd
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/play.xml
@@ -0,0 +1,225 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/playback.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/playback.xml
new file mode 100644
index 0000000..e328cc1
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/playback.xml
@@ -0,0 +1,260 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/playbacktf.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/playbacktf.xml
new file mode 100644
index 0000000..e88d710
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/playbacktf.xml
@@ -0,0 +1,314 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/playbacktf_listitem.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/playbacktf_listitem.xml
new file mode 100644
index 0000000..842b28e
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/playbacktf_listitem.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/popup_d.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/popup_d.xml
new file mode 100644
index 0000000..bf71b77
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/popup_d.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/popuppreset.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/popuppreset.xml
new file mode 100644
index 0000000..e336159
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/popuppreset.xml
@@ -0,0 +1,215 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/preset_view.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/preset_view.xml
new file mode 100644
index 0000000..9eb1776
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/preset_view.xml
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/ptz_resolution_h264.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/ptz_resolution_h264.xml
new file mode 100644
index 0000000..2ab2706
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/ptz_resolution_h264.xml
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/ptz_resolution_jpeg.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/ptz_resolution_jpeg.xml
new file mode 100644
index 0000000..1611ef5
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/ptz_resolution_jpeg.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/search_list_item.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/search_list_item.xml
new file mode 100644
index 0000000..e0bfdab
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/search_list_item.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/sensoradapterlayout.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/sensoradapterlayout.xml
new file mode 100644
index 0000000..7256bfb
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/sensoradapterlayout.xml
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/sensorlist_item_sensortype_item.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/sensorlist_item_sensortype_item.xml
new file mode 100644
index 0000000..a21d489
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/sensorlist_item_sensortype_item.xml
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/setting.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/setting.xml
new file mode 100644
index 0000000..0d366f7
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/setting.xml
@@ -0,0 +1,143 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/setting_list_item.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/setting_list_item.xml
new file mode 100644
index 0000000..ac87769
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/setting_list_item.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/settingalarm.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/settingalarm.xml
new file mode 100644
index 0000000..1a2d726
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/settingalarm.xml
@@ -0,0 +1,156 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/settingdate.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/settingdate.xml
new file mode 100644
index 0000000..e542f41
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/settingdate.xml
@@ -0,0 +1,281 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/settingdate_ntpserver_popwindow.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/settingdate_ntpserver_popwindow.xml
new file mode 100644
index 0000000..5df83fc
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/settingdate_ntpserver_popwindow.xml
@@ -0,0 +1,104 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/settingdate_timezone_popwindow.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/settingdate_timezone_popwindow.xml
new file mode 100644
index 0000000..acf2d56
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/settingdate_timezone_popwindow.xml
@@ -0,0 +1,688 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/settingsdcard.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/settingsdcard.xml
new file mode 100644
index 0000000..317e466
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/settingsdcard.xml
@@ -0,0 +1,462 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/settingsensorlist.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/settingsensorlist.xml
new file mode 100644
index 0000000..cb668a2
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/settingsensorlist.xml
@@ -0,0 +1,153 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/settinguser.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/settinguser.xml
new file mode 100644
index 0000000..de213f8
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/settinguser.xml
@@ -0,0 +1,125 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/settingwifi.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/settingwifi.xml
new file mode 100644
index 0000000..b5134b8
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/settingwifi.xml
@@ -0,0 +1,290 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/settingwifi_list_item.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/settingwifi_list_item.xml
new file mode 100644
index 0000000..e071da3
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/settingwifi_list_item.xml
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/showlocalpicgrid.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/showlocalpicgrid.xml
new file mode 100644
index 0000000..d0ea73a
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/showlocalpicgrid.xml
@@ -0,0 +1,162 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/showlocalpicgrid_griditem.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/showlocalpicgrid_griditem.xml
new file mode 100644
index 0000000..e66b967
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/showlocalpicgrid_griditem.xml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/showlocalvideo_activity.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/showlocalvideo_activity.xml
new file mode 100644
index 0000000..176983a
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/showlocalvideo_activity.xml
@@ -0,0 +1,214 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/start.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/start.xml
new file mode 100644
index 0000000..962c075
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/start.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/startcode_layout.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/startcode_layout.xml
new file mode 100644
index 0000000..f9de96f
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/startcode_layout.xml
@@ -0,0 +1,182 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/timing_video_item.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/timing_video_item.xml
new file mode 100644
index 0000000..e59b6d6
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/timing_video_item.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/update_firmware_view.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/update_firmware_view.xml
new file mode 100644
index 0000000..260b949
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/update_firmware_view.xml
@@ -0,0 +1,282 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/layout/videotape_timing_setting.xml b/src/Driving_Reminder_Assistant/app/src/main/res/layout/videotape_timing_setting.xml
new file mode 100644
index 0000000..202337f
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/layout/videotape_timing_setting.xml
@@ -0,0 +1,282 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/raw/fatigue1.mp3 b/src/Driving_Reminder_Assistant/app/src/main/res/raw/fatigue1.mp3
new file mode 100644
index 0000000..94231fb
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/raw/fatigue1.mp3 differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/raw/fatigue2.mp3 b/src/Driving_Reminder_Assistant/app/src/main/res/raw/fatigue2.mp3
new file mode 100644
index 0000000..a230ae3
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/raw/fatigue2.mp3 differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/raw/fatigue3.mp3 b/src/Driving_Reminder_Assistant/app/src/main/res/raw/fatigue3.mp3
new file mode 100644
index 0000000..d276fe6
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/raw/fatigue3.mp3 differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/raw/fatigue4.mp3 b/src/Driving_Reminder_Assistant/app/src/main/res/raw/fatigue4.mp3
new file mode 100644
index 0000000..69ef1a4
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/raw/fatigue4.mp3 differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/raw/first_init.mp3 b/src/Driving_Reminder_Assistant/app/src/main/res/raw/first_init.mp3
new file mode 100644
index 0000000..17324c9
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/raw/first_init.mp3 differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/raw/headnod.mp3 b/src/Driving_Reminder_Assistant/app/src/main/res/raw/headnod.mp3
new file mode 100644
index 0000000..96cf295
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/raw/headnod.mp3 differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/raw/init_fail.mp3 b/src/Driving_Reminder_Assistant/app/src/main/res/raw/init_fail.mp3
new file mode 100644
index 0000000..45f3fe7
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/raw/init_fail.mp3 differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/raw/init_fail_notdetect.mp3 b/src/Driving_Reminder_Assistant/app/src/main/res/raw/init_fail_notdetect.mp3
new file mode 100644
index 0000000..e6ff1b5
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/raw/init_fail_notdetect.mp3 differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/raw/init_success.mp3 b/src/Driving_Reminder_Assistant/app/src/main/res/raw/init_success.mp3
new file mode 100644
index 0000000..9b6bb49
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/raw/init_success.mp3 differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/raw/notdetect.mp3 b/src/Driving_Reminder_Assistant/app/src/main/res/raw/notdetect.mp3
new file mode 100644
index 0000000..a4a1467
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/raw/notdetect.mp3 differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/raw/notice.mp3 b/src/Driving_Reminder_Assistant/app/src/main/res/raw/notice.mp3
new file mode 100644
index 0000000..fb637b0
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/raw/notice.mp3 differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/raw/reinit.mp3 b/src/Driving_Reminder_Assistant/app/src/main/res/raw/reinit.mp3
new file mode 100644
index 0000000..a05c005
Binary files /dev/null and b/src/Driving_Reminder_Assistant/app/src/main/res/raw/reinit.mp3 differ
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/values-zh-rCN/strings.xml b/src/Driving_Reminder_Assistant/app/src/main/res/values-zh-rCN/strings.xml
new file mode 100644
index 0000000..ee5c743
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/values-zh-rCN/strings.xml
@@ -0,0 +1,513 @@
+
+
+
+ /sdcard/test0.mp4
+
+ 驾驶提醒助手
+ 用户名
+ 版本号
+ 软件名
+ 密码
+ 确定
+ 取消
+ 确认退出吗 ?
+ 密码:
+ 显示密码
+ 已连接
+ 密码不能为空
+ 端口
+ 发送失败
+ 接收失败
+ 未知错误
+ 深圳市欧杰特科技有限公司保留本软件的所有权,盗版必究。
+ V 0.0.0.1
+ "公司网站: http://www.object-camera.com客服邮箱:
+ support@object-camera.com"
+
+ 软件声明
+ 版本信息
+ 联系我们
+ 相机断线,请回首页重连
+ 正在运行
+
+ 添加新设备
+ 传感器
+ 您已添加的设备
+ 红外是利用红外辐射的热效应,检测是否有人或者动物经过。
+ 气感是通过气体传感器探测周围环境中可燃气体是否超过安全值。
+ 烟感是通过监测烟雾的浓度来实现火灾防范。
+ 无线遥控就是一种用来远程控制机器的装置。
+ 警笛可以接收遥控器,无线门磁、无线红外等传感器的报警信号
+ 门磁是用来探测门、窗、抽屉等是否被非法打开或者移动。
+ 按下侧边的按钮,红色指示灯闪动即可
+ 按下侧边的按钮,有声音提示完成对码
+ 手在红外前摆动一下
+ 接通警笛电源
+ 门磁
+ 红外
+ 烟感
+ 警笛
+ 气感
+ 遥控器
+ 摄像头
+ 幕帘
+
+
+ 版本
+
+
+ 已连接, 正在初始化
+ 删除
+ 操作
+ 确认删除?
+ 局域网搜索(得到外网的设备ID)
+ 查看录像
+ 添加
+ 关于
+ 正在连接...
+ 初始化网络失败
+ 连接失败
+ 修改
+ 设置
+ 关于我们
+ 摄像机类型
+ ID:
+ 类型:
+ 状态:
+ 未知状态
+ 正在连接
+ 在线
+ 断线
+ 连接失败
+ 密码错误
+ ID号无效
+ 未知类型
+ 摄像机不在线
+ 模式:
+ p2p连接
+ p2p转发
+ 未知
+ 连接超时
+ 请按此处新增摄像机
+ 返回
+ 完成
+ 全选
+ 反选
+ 编辑
+ 查看
+ 摄像机
+ 报警事件
+ 图片
+ 录像
+ 远程
+ 手机
+ 摄像机不在线,无法进行设置
+ 摄像机不在线,无法进行检测
+ 退出
+ 报警
+ 更多
+ 请先添加摄像机
+ 该用户不是管理员
+ 再按一次,退出程序!
+
+ 普清
+ 高清
+ 手机
+ 最低
+ 低
+ 中
+ 高
+ 最高
+ 向右
+ 向左
+ 向上
+ 向下
+ 预置位设置
+ 预置位调用
+
+
+ 请输入摄像机名称
+ 添加摄像机
+ 修改摄像机
+ 名称
+ IP地址
+ 请输入IP地址
+ 请输入端口
+ 请输入用户名
+ 请输入设备ID
+ 设备ID
+ 扫描条码
+ 扫描失败,请重新扫描
+ 搜索结果
+ 没有搜索到,请重试...
+ 正在启动二维码程序...
+
+
+ 正在搜索,请稍候...
+ 搜索摄像机
+ 刷新
+
+
+ 摄像机设置
+ Wifi设置
+ 用户设置
+ Ftp设置
+ 布防设置
+ 设备时钟设置
+ 邮件设置
+ SD卡设置
+ 时间设置
+ 邮件设置
+ Ftp设置
+ 布防设置
+
+ 正在获取SDCard信息...
+ SD卡总容量(M):
+ SD卡剩余量(M):
+ SD卡状态:
+ 格式化
+ SD卡已经插入
+ 没有插SD卡
+ 录像中...
+ 文件系统错误
+ SD卡正在格式化中...
+ 没有插卡或者需要格式化
+ 录像覆盖:
+ 录像时长(分钟):
+ 定时录像:
+ SD卡设置
+ 范围5-180
+ SD卡设置失败
+ SD卡设置成功
+ 格式化SD卡需要30秒钟,是否格式化?
+ 没有插SD卡,格式化失败!
+ 再次点击程序将在后台运行,按“确定”按钮,关闭程序。
+
+
+ Wifi
+ 验证类型:
+ 管理WiFi网络
+ 信号强度:
+ 安全性:
+ 无
+ WiFi设置失败
+ WiFi设置成功,摄像机正在重启...
+ 未连接
+ WiFi正在扫描,请稍候...
+ WiFi扫描失败
+ 正在获取WiFi信息...
+ 获取WiFi信息失败
+ WiFi没有更改,不需要设置
+ 密码不能超过128位
+
+ 管理员
+ 操作者
+ 参观者
+ 用户设置
+ 用户设置失败
+ 用户设置成功,摄像机正在重启
+ 用户名不能为空
+ 用户名:
+ 正在获取用户信息...
+ 获取用户信息失败
+ 用户名不能超过64位
+ 密码不能超过64位
+
+
+ 移动侦测布防
+ 移动侦测灵敏度
+ (数值越小越灵敏)
+ 报警输入布防
+ 触发电平
+ 报警时预置位联动
+ 声音侦测布防
+ 灵敏度
+ 上传图片张数
+ 报警后 IO 联动
+ 输出电平
+ 报警后邮件通知
+ 报警后上传图片
+ 上传图片时间间隔(秒)
+ 报警触发事件
+ 布防设置失败
+ 布防设置成功
+ 高灵敏度
+ 中灵敏度
+ 低灵敏度
+ 高电平
+ 禁止检测
+ 低电平
+ 正在获取报警信息...
+ 获取报警信息失败
+ 无
+ 上传时间不能超过3600秒
+ 0或空表示不上传图片
+ 报警日志
+ 移动侦测报警
+ IO联动报警
+ 无报警日志
+ 报警后录像
+
+
+ 设备时钟时间
+ 设备时区设定
+ 使用 NTP服务器自动校时
+ 使用手机时间校准设备时钟
+ NTP服务器
+ (GMT-11:00)中途岛,萨摩亚群岛
+ (GMT -10:00) 夏威夷
+ (GMT-09:00)阿拉斯加
+ (GMT-08:00)太平洋时间(美国和加拿大)
+ (GMT-07:00)山地时间(美国和加拿大)
+ (GMT-06:00)中部时间(美国和加拿大),墨西哥城
+ (GMT-05:00)东部时间(美国和加拿大),利马,波哥大
+ (GMT-04:00)大西洋时间(加拿大),圣地亚哥,拉巴斯
+ (GMT-03:30)纽芬兰
+ (GMT-03:00)巴西利亚,布宜若斯艾丽斯,乔治敦
+ (GMT-02:00)中大西洋
+ (GMT-01:00)佛得角群岛
+ (GMT)格林威治平时,伦敦,里斯本,卡萨布兰卡
+ (GMT+01:00)布鲁赛尔,巴黎,柏林,罗马,马德里,斯多哥尔摩, 贝尔格莱德, 布拉格
+
+ (GMT +02:00) 雅典, 耶路撒冷, 开罗, 赫尔辛基
+ (GMT +03:00) 内罗毕, 利雅得, 莫斯科
+ (GMT +03:30) 德黑兰
+ (GMT +04:00) 巴库, 第比利斯, 阿布扎比, 马斯科特
+ (GMT +04:30) 科布尔
+ (GMT +05:00) 伊斯兰堡, 卡拉奇, 塔森干
+ (GMT +05:30) 加尔各答, 孟买, 马德拉斯, 新德里
+ (GMT +06:00) 阿拉木图, 新西伯利亚, 阿斯塔南, 达尔
+ (GMT +07:00) 曼谷, 河内, 雅加达
+ (GMT +08:00) 北京, 新加坡, 台北
+ (GMT +09:00) 首尔, 雅库茨克, 东京
+ (GMT +09:30) 达尔文
+ (GMT +10:00) 关岛, 墨尔本, 悉尼, 莫尔兹比港, 符拉迪沃斯托克
+ (GMT +11:00)马加丹,所罗门群岛, 新喀里多尼亚
+ (GMT +12:00) 奥克兰, 惠灵顿, 斐济
+ time.nist.gov
+ time.kriss.re.kr
+ time.windows.com
+ time.nuri.net
+ 设备时钟时间设置成功
+ 设备时钟时间设置失败
+ 正在获取时钟信息...
+
+
+ 发送者
+ SMTP服务器
+ SMTP端口
+ 需要验证
+ SSL
+ NONE
+ SSL
+ TLS
+ SMTP用户
+ SMTP密码
+ 接受者1
+ 接受者2
+ 接受者3
+ 接受者4
+ smtp.163.com
+ smtp.126.com
+ smtp.sina.com
+ smtp.mail.yahoo.com
+ smtp.sohu.com
+ smtp.yeah.net
+ smtp.tom.com
+ smtp.21cn.com
+ smtp.qq.com
+ smtp.gmail.com
+ smtp.eyou.com
+ smtp.263.net
+ 邮件设置成功
+ 邮件设置失败
+ 正在获取邮件信息...
+
+
+ FTP服务器
+ FTP端口
+ FTP用户
+ FTP密码
+ 上传图片时间间隔(秒)
+ 空或者0表示不定时上传图片
+ Ftp设置成功
+ Ftp设置失败
+ 正在获取Ftp信息...
+
+
+
+ 查看快照
+ 时间:
+ 张
+
+ 删除该照片
+ 删除所有照片
+ 个
+ 共:
+ 沒有照片
+ 本地图片
+
+
+ 摄像机不在线, 无法播放远程图片
+
+
+ 查看本地
+ 录像时间:
+ 文件已损坏
+
+
+ 远程录像
+ 没有远程录像文件
+ 正在获取远程录像信息...
+ 摄像机不在线, 无法播放远程录像
+ 开始日期不能大于结束日期
+ 结束日期不能小于开始日期
+ 至
+
+
+ 结束播放?
+ MJPEG
+ H.264
+ H.264主码流
+ H.264次码流
+ MJPEG码流
+ H.264码流
+ 选择码流
+ 已到观看时间
+ 转发模式观看,剩余时间:
+ 秒
+ 拍照成功
+ 拍照失败
+ 视频参数恢复默认值
+ 请按菜单键,进行云台控制
+ 该设备没有SDCard,照片保存失败
+ 开始录像
+ 录像结束
+
+
+
+ 请连接上再操作
+ U盘模式
+ 预览模式
+ 系统设置
+ 录像中....
+ Wifi
+ 保存ID用户名密码
+ 未绑定Wifi
+ 奥尼行车记录仪
+ 绑定成功
+ 本地录像中,请先停止再退出!
+ 连接状态
+ 切换中...
+ 进入U盘
+ 进入预览
+ 手机录像文件
+ 远程下载文件
+ 播放结束
+ 文件损坏
+ 本地录像中,请先停止再进入U盘模式!
+ 手机录像文件
+ 远程下载文件
+ 时间搜索
+ 扫描Wifi
+ 录像中...
+ 正在录像,请先停止再切换!
+ 此设备不支持二维码扫描!
+ 相机状态
+ 提示:
+ 删除本地文 件
+ 取 消
+ 确认退出播放?
+ 确认退出程序?
+
+ 其他
+ 当前设备信息:
+ 当前界面固件:
+ 固件更新
+ 最新设备信息:
+ 录像模式:
+ 计划录像
+ 添加录像计划
+ 移动侦测录像
+ 添加移动侦测录像
+ 添加时段
+ 星期一
+ 星期二
+ 星期三
+ 星期四
+ 星期五
+ 星期六
+ 星期日
+ 保存
+ 开始时间
+ 结束时间
+ 添加时段
+ 编辑时段
+ 请选择星期
+ 确认删除?
+ 一
+ 二
+ 三
+ 四
+ 五
+ 六
+ 日
+ 移动侦测报警通知计划
+ 报警通知
+ 添加移动侦测报警通知计划
+
+ 连接
+ 预览模式
+ 本地图片
+ 修改密码
+ 传感器设置
+ TF卡远程录像
+ 退出对码
+ 对码状态中...
+
+ 绑定别名
+ 绑定别名失败,未知异常
+ 绑定别名成功
+ 绑定别名失败,请求频次超限
+ 绑定别名失败,参数错误
+ 绑定别名失败,请求被过滤
+ 绑定别名失败,未获取到cid
+ 绑定别名失败,网络错误
+ 绑定别名失败,别名无效
+ 绑定别名失败,sn无效
+ 解绑别名
+ 取消绑定别名失败,未知异常
+ 取消绑定别名成功
+ 取消绑定别名失败,请求频次超限
+ 取消绑定别名失败,参数错误
+ 取消绑定别名失败,请求被过滤
+ 取消绑定别名失败,未获取到cid
+ 取消绑定别名失败,网络错误
+ 取消绑定别名失败,别名无效
+ 取消绑定别名失败,sn无效
+ 添加标签
+ 设置标签失败,未知异常
+ 接口调用成功
+ 接口调用失败, tag数量过大, 最大不能超过200个
+ 设置标签失败,频率过快
+ 接口调用失败, tag 为空
+ 设置标签失败, 标签重复
+ 设置标签失败, 服务未初始化成功
+ 还未登陆成功
+ 该应用已经在黑名单中,请联系售后支持!
+ 已存 tag 超过限制
+ 获取个推Token
+ 绑定设备
+ 解绑设备
+ 设置推送语言
+ 注册推送设置
+
+ 离线
+ 消息记录
+ 存在输入框为空
+
+
+ 正在初始化人体姿态
+ 初始化成功
+ 初始化失败
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/values/colors.xml b/src/Driving_Reminder_Assistant/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..0124058
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/values/colors.xml
@@ -0,0 +1,60 @@
+
+
+
+ #ff494949
+ #ffffffff
+ #ff333333
+ #00000000
+ #ffdddddd
+ #ff000000
+ #000000
+ #ee000000
+ #ff7F7F7F
+ #ff0044ff
+ #ff0000ff
+ #ff888888
+ #ff00dd11
+ #88888888
+ #ff444444
+ #ff333333
+ #FF0EAAE4
+ #ff0caae4
+ #ff888888
+ #ff32aff6
+ #ff0044aa
+ #ff666666
+ #60ffffff
+
+
+ #EDEDED
+ #ff000000
+ #ffffffff
+ #ffcccccc
+ #ff404040
+ #c0ffff00
+ #ffffffff
+ #ffc0c0c0
+ #c000ff00
+ #ffffffff
+ #b0000000
+ #ff808080
+ #ffffffff
+ #fffff0e0
+ #ffffffff
+ #ff000000
+ #ff4b4b4b
+ #ff000000
+ #ffffffff
+ #50000000
+ #ffffffff
+ #00000000
+ #ff000000
+ #ffff0000
+ #60000000
+ #58567D
+ #686868
+ #cccccc
+ #5C5B5B
+ #2EC6F6
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/values/dimens.xml b/src/Driving_Reminder_Assistant/app/src/main/res/values/dimens.xml
new file mode 100644
index 0000000..0f01f25
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/values/dimens.xml
@@ -0,0 +1,8 @@
+
+
+ 12.0sp
+ 15.0sp
+
+ 16dp
+ 16dp
+
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/values/strings.xml b/src/Driving_Reminder_Assistant/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..9b5f2be
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/values/strings.xml
@@ -0,0 +1,499 @@
+
+
+
+ /sdcard/test0.mp4
+
+ Driving reminder assistant
+ username
+ version number
+ software name
+ password
+ OK
+ cancel
+ Confirm exit?
+ Password:
+ Show password
+ connected
+ Password cannot be empty
+ Port
+ Send failed
+ Receive failed
+ Unknown error
+ Shenzhen Oujiete Technology Co., Ltd. reserves the ownership of this software, piracy is reserved.
+ V 0.0.0.1
+
+ "Company Website: http://www.object-camera.com Customer Service Email: support@object-camera.com"
+ Software Declaration
+ version information
+ Contact Us
+ camera disconnected, please reconnect to the home page
+ is running
+ Add new device
+ sensor
+ The device you have added
+ Infrared uses the thermal effect of infrared radiation to detect whether someone or an animal has passed.
+ The sense of gas is detected by a gas sensor to detect whether the combustible gas in the surrounding environment exceeds a safe value.
+ Smoke Sense is to prevent fire by monitoring the smoke concentration.
+ wireless remote control is a device used to remotely control the machine.
+ alarm siren can receive remote control, wireless sensor, wireless infrared sensor alarm signal
+ The door magnet is used to detect if doors, windows, drawers, etc. have been illegally opened or moved.
+ press the button on the side, red indicator light flashes
+ press the button on the side, there is a voice prompt to complete the code
+ hand swings in front of the infrared
+ switch on siren power
+ door magnet
+ Infrared
+ smoke
+ siren
+ gas sense
+ remote controller
+ camera
+ curtain
+
+
+ version
+
+ connected, initializing
+ delete
+ operation
+ Confirm delete?
+ LAN search
+ View video
+ Add
+ About
+ Connecting...
+ Initialize network failure
+ connection failed
+ Modify
+ settings
+ About us
+ camera type
+ ID:
+ type:
+ Status:
+ Unknown State
+ Connecting
+ Online
+ broken
+ connection failed
+ password error
+ invalid ID number
+ Unknown type
+ camera is not online
+ Mode:
+ p2p connection
+ p2p forwarding
+ Unknown
+ connection timeout
+ Click here to add the camera
+ returns
+ complete
+ select all
+ Inverse
+ edit
+ view
+ Camera
+ Alarm Events
+ image
+ Video
+ Remote
+ mobile phone
+ Camera is offline and cannot be set
+ Camera is offine and cannot detect
+ exit
+ Alarm
+ more
+ Please add camera
+ This user is not an administrator
+ Press again to exit the program!
+
+ Pu Qing
+ HD
+ mobile phone
+ lowest
+ low
+ in
+ high
+ highest
+ right
+ leftward
+ up
+ down
+ preset settings
+ preset call
+
+
+ Please enter the camera name
+ Add Camera
+ modify the camera
+ name
+ IP address
+ Please enter the IP address
+ Please enter the port
+ Please enter the username
+ Please enter device ID
+ device ID
+ scan bar code
+ scan failed, please rescan
+ search results
+ did not search, please try again ...
+ Starting QR code program...
+
+
+ Searching, please wait...
+ search camera
+ refresh
+
+
+ camera settings
+ Wifi settings
+ user settings
+ Ftp settings
+ alarm settings
+ device clock settings
+ Mail Settings
+ SD card settings
+ time setting
+ Mail Settings
+ Ftp settings
+ alarm settings
+
+
+ Getting SDCard information...
+
+ SD card total capacity (M):
+
+ SD card remaining amount (M):
+
+ SD card status:
+
+ Format
+
+ SD card has been inserted
+
+ No SD card inserted
+
+ video...
+
+ File System Error
+
+ SD card is being formatted...
+
+ No card or need to be formatted
+
+ video coverage:
+
+ recording duration (minutes):
+
+ Timing video:
+
+ SD card settings
+
+ range 5-180
+
+ SD card setup failed
+
+ SD card set up successfully
+
+ formatting SD card takes 30 seconds, is it formatted?
+
+ No SD card inserted, formatting failed!
+
+ Clicking on the program again will run in the background, pressing the "OK" button to close the program.
+
+
+ Wifi
+ Verification type:
+ Manage WiFi Network
+ signal strength:
+ Security:
+ None
+ WiFi setting failed
+ WiFi setup is successful, camera is restarting...
+ not connected
+ WiFi is scanning, please wait...
+ WiFi scan failed
+ is getting WiFi information...
+ Failed to get WiFi information
+ WiFi has not changed, do not need to set
+ password can not exceed 128 bits
+
+ administrator
+ operator
+ visitors
+ user settings
+ user settings failed
+ user settings is successful, the camera is restarting
+ username cannot be empty
+ username:
+ is getting user information...
+ Failed to get user information
+ user name can not exceed 64
+ password can not exceed 64
+
+
+ Motion Detection Arming
+ motion detection sensitivity
+ (The smaller the value, the more sensitive)
+ alarm input arming
+ trigger level
+ alarm presets linkage
+ sound detection arming
+ Sensitivity
+ upload picture number
+ alarm after IO linkage
+ output level
+ email notification after alarm
+ upload pictures after alarm
+ upload image interval (seconds)
+ Alarm Trigger Event
+ alarm setting failed
+ alarm setting is successful
+ high sensitivity
+ medium sensitivity
+ low sensitivity
+ high
+ Disable Detection
+ low
+ is getting alarm information...
+ Failed to get alarm information
+ None
+ Upload time cannot exceed 3600 seconds
+ 0 or empty means not upload pictures
+ Alarm Log
+ Motion Detection Alarm
+ IO linkage alarm
+ no alarm log
+ after the alarm recording
+
+
+ device clock time
+ device time zone setting
+ automatic time using NTP server
+ use mobile phone time calibration device clock
+ NTP server
+ (GMT-11:00) Midway, Samoa
+ (GMT -10:00) Hawaii
+ (GMT-09:00) Alaska
+ (GMT-08:00) Pacific Time (U.S. and Canada)
+ (GMT-07:00) Mountain Time (U.S. and Canada)
+ (GMT-06:00) Central Time (US and Canada), Mexico City
+ (GMT-05:00) Eastern Time (US and Canada), Lima, Bogota
+ (GMT-04:00) Atlantic Time (Canada), Santiago, La Paz
+ (GMT-03:30)Newfoundland
+ (GMT-03:00) Brasilia, Buenos Aires, Georgetown
+ (GMT-02:00) Atlantic
+ (GMT-01:00) Cape Verde Islands
+ (GMT) Greenwich Meantime, London, Lisbon, Casablanca
+ (GMT+01:00) Brussels, Paris, Berlin, Rome, Madrid, Stockholm, Belgrade, Prague
+
+ (GMT +02:00) Athens, Jerusalem, Cairo, Helsinki
+ (GMT +03:00) Nairobi, Riyadh, Moscow
+ (GMT +03:30) Tehran
+ (GMT +04:00) Baku, Tbilisi, Abu Dhabi, Mascott
+ (GMT +04:30) Cobb
+ (GMT +05:00) Islamabad, Karachi, Tashkent
+ (GMT +05:30) Calcutta, Mumbai, Madras, New Delhi
+ (GMT +06:00) Almaty, Novosibirsk, Astana, Dahl
+ (GMT +07:00) Bangkok, Hanoi, Jakarta
+ (GMT +08:00) Beijing, Singapore, Taipei
+ (GMT +09:00) Seoul, Yakutsk, Tokyo
+ (GMT +09:30) Darwin
+ (GMT +10:00) Guam, Melbourne, Sydney, Port Moresby, Vladivostok
+ (GMT +11:00) Magadan, Solomon Islands, New Caledonia
+ (GMT +12:00) Oakland, Wellington, Fiji
+ time.nist.gov
+ time.kriss.re.kr
+ time.windows.com
+ time.nuri.net
+ device clock time is set successfully
+ device clock time setting failed
+ is getting clock information...
+
+
+ Sender
+ SMTP server
+ SMTP port
+ need to verify
+ SSL
+ NONE
+ SSL
+ TLS
+ SMTP user
+ SMTP password
+ Acceptor1
+ Acceptor 2
+ Acceptor 3
+ Acceptor 4
+ smtp.163.com
+ smtp.126.com
+ smtp.sina.com
+ smtp.mail.yahoo.com
+ smtp.sohu.com
+ smtp.yeah.net
+ smtp.tom.com
+ smtp.21cn.com
+ smtp.qq.com
+ smtp.gmail.com
+ smtp.eyou.com
+ smtp.263.net
+ mail settings success
+ mail setting failed
+ is getting email info...
+
+
+ FTP server
+ FTP port
+ FTP user
+ FTP password
+ Upload image interval (seconds)
+ empty or 0 to upload pictures from time to time
+ Ftp setting is successful
+ Ftp setting failed
+ is getting Ftp information...
+
+
+
+ View Snapshot
+ Time:
+ Zhang
+ delete the photo
+ Delete All Photos
+
+ Total:
+ No photo
+ local image
+
+
+ Camera is offline, unable to play remote pictures
+
+
+ View Local
+ recording time:
+ file is damaged
+
+
+ Remote Video
+ No remote video file
+ is getting remote video information...
+ Camera is offline, can not play remote video
+ start date cannot be greater than end date
+ end date can not be less than the start date
+ to
+
+
+ end playing?
+ MJPEG
+ H.264
+ H.264 main stream
+ H.264 times stream
+ MJPEG stream
+ H.264 stream
+ select stream
+ time to watch
+ forwarding mode to watch, remaining time:
+ second
+ photographed successfully
+ photographed failed
+ Video Parameter Recovery Defaults
+ Press the menu key to perform PTZ control
+ The device does not have an SDCard, photos are saved
+ Start recording
+ End of recording
+
+ Please connect to operate
+ U disk mode
+ preview mode
+ System Settings
+ recording....
+ Wifi
+ Save ID username and password
+ Unbound Wifi
+ Onyx Drive Recorder
+ binding is successful
+ In the local recording, please stop and exit!
+ connection state
+ switching...
+ into the U disk
+ into the preview
+ mobile phone video file
+ download file remotely
+ End of play
+ File Corrupted
+ In the local recording, please stop and enter U disk mode first!
+ mobile phone video file
+ remote download file
+ time search
+ Scan Wifi
+ recording...
+ is recording, please stop and switch!
+ This device does not support QR code scanning!
+ Camera Status
+ Tip:
+ Delete local file
+ cancel
+ Confirm to exit playback?
+ Confirm exit program?
+ Other
+ current device information:
+ current interface firmware:
+ Firmware Update
+ the latest device information:
+
+ Video mode:
+ planned video
+ Add video plan
+ motion detection video
+ Add motion detection video
+ add period
+ Monday
+ Tuesday
+ Wednesday
+ Thursday
+ Friday
+ Saturday
+ Sunday
+ Save
+ start time
+ end time
+ Add period
+ Edit Period
+ Please select week
+ Confirm delete?
+ a
+ two
+ three
+ four
+ five
+ six
+ day
+ motion detection alarm notification plan
+ alarm notification
+ Add motion detection alarm notification plan
+
+ Connect
+ Preview mode
+ Local photo
+ change Password
+ Sensor settings
+ TF card remote video
+ Exit code
+ In code state...
+
+ Get Push Token
+ Bing Device
+ Unbing Device
+ Setting Push Language
+ Registered Push Setting
+
+ offline
+ Message record
+ The input content is empty
+
+
+ initializing body posture
+ initialize successfully
+ initialization failed
+ 10
+
+
diff --git a/src/Driving_Reminder_Assistant/app/src/main/res/values/styles.xml b/src/Driving_Reminder_Assistant/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..012bb05
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/app/src/main/res/values/styles.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/build.gradle b/src/Driving_Reminder_Assistant/build.gradle
new file mode 100644
index 0000000..043e357
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/build.gradle
@@ -0,0 +1,17 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+buildscript {
+ repositories {
+ google()
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:3.5.1'
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ jcenter()
+ }
+}
diff --git a/src/Driving_Reminder_Assistant/gradle.properties b/src/Driving_Reminder_Assistant/gradle.properties
new file mode 100644
index 0000000..769bad2
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/gradle.properties
@@ -0,0 +1,18 @@
+## Project-wide Gradle settings.
+#
+# 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.
+# Default value: -Xmx1024m -XX:MaxPermSize=256m
+# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
+#
+# 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
+#Mon Apr 02 17:33:30 CST 2018
+
+android.enableJetifier=true
+android.useAndroidX=true
\ No newline at end of file
diff --git a/src/Driving_Reminder_Assistant/gradle/.DS_Store b/src/Driving_Reminder_Assistant/gradle/.DS_Store
new file mode 100644
index 0000000..f842978
Binary files /dev/null and b/src/Driving_Reminder_Assistant/gradle/.DS_Store differ
diff --git a/src/Driving_Reminder_Assistant/gradle/wrapper/gradle-wrapper.jar b/src/Driving_Reminder_Assistant/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..13372ae
Binary files /dev/null and b/src/Driving_Reminder_Assistant/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/src/Driving_Reminder_Assistant/gradle/wrapper/gradle-wrapper.properties b/src/Driving_Reminder_Assistant/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..b8a2d8f
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Mon Jul 10 11:06:56 CST 2017
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
diff --git a/src/Driving_Reminder_Assistant/gradlew b/src/Driving_Reminder_Assistant/gradlew
new file mode 100644
index 0000000..9d82f78
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/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/Driving_Reminder_Assistant/gradlew.bat b/src/Driving_Reminder_Assistant/gradlew.bat
new file mode 100644
index 0000000..8a0b282
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/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/Driving_Reminder_Assistant/import-summary.txt b/src/Driving_Reminder_Assistant/import-summary.txt
new file mode 100644
index 0000000..b6668a3
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/import-summary.txt
@@ -0,0 +1,56 @@
+ECLIPSE ANDROID PROJECT IMPORT SUMMARY
+======================================
+
+Ignored Files:
+--------------
+The following files were *not* copied into the new Gradle project; you
+should evaluate whether these are still needed in your project and if
+so manually move them:
+
+* proguard.cfg
+
+Replaced Jars with Dependencies:
+--------------------------------
+The importer recognized the following .jar files as third party
+libraries and replaced them with Gradle dependencies instead. This has
+the advantage that more explicit version information is known, and the
+libraries can be updated automatically. However, it is possible that
+the .jar file in your project was of an older version than the
+dependency we picked, which could render the project not compileable.
+You can disable the jar replacement in the import wizard and try again:
+
+android-support-v4.jar => com.android.support:support-v4:19.1.0
+
+Moved Files:
+------------
+Android Gradle projects use a different directory structure than ADT
+Eclipse projects. Here's how the projects were restructured:
+
+* AndroidManifest.xml => app/src/main/AndroidManifest.xml
+* assets/ => app/src/main/assets
+* libs/armeabi-v7a/libffmpeg.so => app/src/main/jniLibs/armeabi-v7a/libffmpeg.so
+* libs/armeabi-v7a/libvstc2_jni.so => app/src/main/jniLibs/armeabi-v7a/libvstc2_jni.so
+* libs/armeabi/libffmpeg.so => app/src/main/jniLibs/armeabi/libffmpeg.so
+* libs/armeabi/libvstc2_jni.so => app/src/main/jniLibs/armeabi/libvstc2_jni.so
+* res/ => app/src/main/res/
+* src/ => app/src/main/java/
+* arrowdown.PNG => arrowdown.png
+* icon_gpio.JPG => icon_gpio.jpg
+* icon_motion.JPG => icon_motion.jpg
+* icon_rec.PNG => icon_rec.png
+* sound_line1.BMP => sound_line1.bmp
+
+Next Steps:
+-----------
+You can now build the project. The Gradle project needs network
+connectivity to download dependencies.
+
+Bugs:
+-----
+If for some reason your project does not build, and you determine that
+it is due to a bug or limitation of the Eclipse to Gradle importer,
+please file a bug at http://b.android.com with category
+Component-Tools.
+
+(This import summary is for your information only, and can be deleted
+after import once you are satisfied with the results.)
diff --git a/src/Driving_Reminder_Assistant/settings.gradle b/src/Driving_Reminder_Assistant/settings.gradle
new file mode 100644
index 0000000..b0135c4
--- /dev/null
+++ b/src/Driving_Reminder_Assistant/settings.gradle
@@ -0,0 +1,2 @@
+//..
+include ':app'