Merge pull request '1' (#5) from test into 李贽

李贽
prmjiylkn 3 years ago
commit 2c9dae4b42

@ -1 +0,0 @@
Hello world!

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 28 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 12 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 18 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 9.5 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

@ -0,0 +1,14 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

@ -0,0 +1,116 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<codeStyleSettings language="XML">
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:android</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:id</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>style</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>ANDROID_ATTRIBUTE_ORDER</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>.*</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
</rules>
</arrangement>
</codeStyleSettings>
</code_scheme>
</component>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="1.8" />
</component>
</project>

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<targetSelectedWithDropDown>
<Target>
<type value="QUICK_BOOT_TARGET" />
<deviceKey>
<Key>
<type value="VIRTUAL_DEVICE_PATH" />
<value value="C:\Users\smith\.android\avd\Nexus_4_API_30.avd" />
</Key>
</deviceKey>
</Target>
</targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2022-04-19T02:44:13.063728800Z" />
</component>
</project>

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="BintrayJCenter" />
<option name="name" value="BintrayJCenter" />
<option name="url" value="https://jcenter.bintray.com/" />
</remote-repository>
<remote-repository>
<option name="id" value="Google" />
<option name="name" value="Google" />
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
</remote-repository>
</component>
</project>

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DesignSurface">
<option name="filePathToZoomLevelMap">
<map>
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/drawable/backbtn.xml" value="0.159375" />
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/drawable/bg_color.xml" value="0.159375" />
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/drawable/ic_contact.xml" value="0.159375" />
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/drawable/ic_person_add_white_60dp.xml" value="0.159375" />
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/drawable/ic_thumb_down_red_150dp.xml" value="0.159375" />
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/drawable/ic_thumb_up_black_150dp.xml" value="0.159375" />
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/drawable/ic_warning_black_24dp.xml" value="0.159375" />
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/font/quicksand.xml" value="0.14351851851851852" />
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/font/quicksand_medium.xml" value="0.14351851851851852" />
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/layout/activity_contacts.xml" value="0.1" />
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/layout/activity_edit.xml" value="0.14322916666666666" />
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/layout/activity_main.xml" value="0.14322916666666666" />
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/layout/activity_post_fall_detected.xml" value="0.14322916666666666" />
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/layout/activity_splash_screen.xml" value="0.14322916666666666" />
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/layout/app_widget.xml" value="0.14322916666666666" />
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/layout/contacts_row.xml" value="0.14322916666666666" />
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/layout/emergencia_activity.xml" value="0.14322916666666666" />
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml" value="0.19895833333333332" />
<entry key="..\:/Desktop/FallSafety-DetectorCaidas-master/FallSafety-DetectorCaidas-master/FallSafety/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml" value="0.19895833333333332" />
</map>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RenderSettings">
<option name="showDecorations" value="true" />
</component>
</project>

@ -0,0 +1,15 @@
f
java:S1301*"KReplace this "switch" statement by "if" statements to increase readability.(ד¾ñùÿÿÿÿ
P java:S110"<This class has 9 parents which is greater than 5 authorized.(¿Ì<C2BF>
o
java:S1450"YRemove the "btnNoCaida" field and declare it as a local variable in the relevant methods.(û¨ã‹
o
java:S1450"TRemove the "count" field and declare it as a local variable in the relevant methods.(•©Äûýÿÿÿÿ
o
java:S1450"YRemove the "btnSiCaida" field and declare it as a local variable in the relevant methods.(ôÆòÃ

java:S1186E"€Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.(îñë‡
< java:S131*""Add a default case to this switch.(ד¾ñùÿÿÿÿ
D
java:S1068")Remove this unused "count" private field.(•©Äûýÿÿÿÿ

@ -0,0 +1,15 @@
E
java:S3740/"/Provide the parametrized type for this generic.(<28>‡²“
X
java:S1874"=Remove this use of "EXTRA_INCOMING_NUMBER"; it is deprecated.(ãüÔìúÿÿÿÿ
E
java:S37406"/Provide the parametrized type for this generic.(ÐÙŸ…
i
java:S3008 "NRename this field "TAG" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(åî<C3A5>”ÿÿÿÿÿ
B
java:S30112",This accessibility update should be removed.(á„â·
D
java:S1444 ")Make this "public static TAG" field final(åî<C3A5>”ÿÿÿÿÿ
j
java:S1104 "OMake TAG a static final constant or non-public and provide accessors if needed.(åî<C3A5>”ÿÿÿÿÿ

@ -0,0 +1,4 @@
L
java:S1128"1Remove this unused import 'android.widget.Toast'.(©›ïÍúÿÿÿÿ
< java:S131""Add a default case to this switch.(ÍÑÆ¸øÿÿÿÿ

@ -0,0 +1,27 @@
N java:S106u"9Replace this use of System.out or System.err by a logger.(ùàèü
Q java:S125¯"<This block of commented-out lines of code should be removed.(˜à‹>
O java:S106¼"9Replace this use of System.out or System.err by a logger.(öï‰Ê
˜
java:S1186§"€Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.(ÁïÕÒ
V java:S110"<This class has 9 parents which is greater than 5 authorized.(§ÍÑÍúÿÿÿÿ
N java:S106X"9Replace this use of System.out or System.err by a logger.(ÐÚ°Å
˜
java:S1186<18>"€Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.(ÀÄÞ’
N java:S106z"9Replace this use of System.out or System.err by a logger.(<28><>˜°
N java:S106\"9Replace this use of System.out or System.err by a logger.(ÅÛÄç
X
java:S1858º"A"valueOf" returns a string, there's no need to call "toString()".(¡„—þ
P java:S125G"<This block of commented-out lines of code should be removed.(¡Ç<C2A1>C
N java:S106["9Replace this use of System.out or System.err by a logger.(’ãøê
˜
java:S1186¢"€Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.(çÅðÙ

java:S1186-"€Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.(¤äˆ‚
N java:S106p"9Replace this use of System.out or System.err by a logger.(ð<>¿”
O java:S106É"9Replace this use of System.out or System.err by a logger.(‰­‹Ð
N java:S106Y"9Replace this use of System.out or System.err by a logger.(ð<>¿”
N java:S106o"9Replace this use of System.out or System.err by a logger.(ÐÚ°Å
B
java:S1659%"'Declare "longitude" on a separate line.(öîƒÆÿÿÿÿÿ
O java:S106ƒ"9Replace this use of System.out or System.err by a logger.(©Æš§

@ -0,0 +1,2 @@
V java:S110 "<This class has 9 parents which is greater than 5 authorized.(ÄË›ºøÿÿÿÿ

@ -0,0 +1,26 @@
˜
java:S1186ï"€Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.(Њ߱

java:S1186E"€Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.(ð¬Çÿ
T
java:S1659$">Declare "y" and all following declarations on a separate line.(ÏÔ•µ
W
java:S1659%"ADeclare "medY" and all following declarations on a separate line.(Ñßž’
o
java:S1450#"YRemove the "mSensorAcc" field and declare it as a local variable in the relevant methods.(<28>ÞèÌ
`
java:S1124="EReorder the modifiers to comply with the Java Language Specification.(Ê䊮ÿÿÿÿÿ
[
java:S1124>"EReorder the modifiers to comply with the Java Language Specification.(þ¡ÝŠ
N java:S106V"9Replace this use of System.out or System.err by a logger.(ŽƒÙ<C692>
S java:S106^"9Replace this use of System.out or System.err by a logger.(ϺžÑûÿÿÿÿ
N java:S106z"9Replace this use of System.out or System.err by a logger.(лâ‘
O
java:S1854¤"8Remove this useless assignment to local variable "acel".(æ÷Öá
@
java:S1481¤")Remove this unused "acel" local variable.(æ÷Öá
K
java:S1144Å"/Remove this unused private "crearNotif" method.(³åË¡úÿÿÿÿ
W
java:S1144Ý";Remove this unused private "crearCanalNotificacion" method.(Éò†þÿÿÿÿ

@ -0,0 +1,9 @@
V java:S110"<This class has 9 parents which is greater than 5 authorized.(˜ª‡Žúÿÿÿÿ
A
java:S1172I"+Remove this unused method parameter "view".(´É¸ù
o java:S116"URename this field "m_listview" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(¡”´—þÿÿÿÿ
H
java:S1128 "2Remove this unused import 'android.view.MenuItem'.(Ьӑ
D
java:S1128".Remove this unused import 'android.view.Menu'.(£¯Ò…

@ -0,0 +1,25 @@
\
java:S1854("ARemove this useless assignment to local variable "confirmButton".(ûì¶Éøÿÿÿÿ
G
java:S1659",Declare "mPrioridadText" on a separate line.(è÷ÍÆþÿÿÿÿ
y
java:S3252\"^Use static access with "android.provider.ContactsContract$ContactsColumns" for "DISPLAY_NAME".(ŒÊ¤ßùÿÿÿÿ
H
java:S1128"-Remove this unused import 'android.Manifest'.(¦øïŽúÿÿÿÿ
V java:S110"<This class has 9 parents which is greater than 5 authorized.(Ì<>ûÞøÿÿÿÿ
Y
java:S1128">Remove this unused import 'android.content.pm.PackageManager'.(€®¥õÿÿÿÿÿ
F
java:S1659"+Declare "mTelefonoText" on a separate line.(è÷ÍÆþÿÿÿÿ
F
java:S1172v"+Remove this unused method parameter "view".(Ðöˆøúÿÿÿÿ
H
java:S1128
"-Remove this unused import 'android.os.Build'.(ãǤÚýÿÿÿÿ
F
java:S1172k"+Remove this unused method parameter "view".(š¶öÞøÿÿÿÿ
M
java:S1481("2Remove this unused "confirmButton" local variable.(ûì¶Éøÿÿÿÿ
J
java:S1066V"/Merge this if statement with the enclosing one.(±„‘‰ýÿÿÿÿ

@ -0,0 +1,20 @@
P
java:S1161x":Add the "@Override" annotation above this method signature(ŸŒ¹Ñ
B
java:S1172"+Remove this unused method parameter "view".(ºóðê
d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ºóðê
D
java:S1066|"/Merge this if statement with the enclosing one.(ǶÀ(

java:S1186&"€Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.(—¦‹ã
U
java:S1854;":Remove this useless assignment to local variable "mRowId".(Ýúøšúÿÿÿÿ
Q java:S110"<This class has 9 parents which is greater than 5 authorized.(ÄÇ‚·
Q
java:S26967"6Make the enclosing method "static" or remove this set.(·¥Ç…üÿÿÿÿ
F
java:S1481;"+Remove this unused "mRowId" local variable.(Ýúøšúÿÿÿÿ
? java:S108œ")Either remove or fill this block of code.(¹‚ä·
o
java:S3008"YRename this field "TTS_DATA_CHECK" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Á¡ÝÍ

@ -0,0 +1,56 @@
P
app/src/main/AndroidManifest.xml,8\c\8c55c3ccc257e5907959013f99656e4c8ec3903e
h
8app/src/main/java/com/example/fallsafety/CallHelper.java,1\c\1c2ab64142f0f5030f61b56701c99af9d8c46ce0
o
?app/src/main/java/com/example/fallsafety/ContactsDbAdapter.java,2\8\2838cca4d9366e68bea04876b0b6ac18707db3c5
h
8app/src/main/java/com/example/fallsafety/Emergencia.java,5\8\58b36f2c0756c995764b9533aafec672bb436a71
j
:app/src/main/java/com/example/fallsafety/MainActivity.java,e\a\ea375f37886bafe63f95ef39e765923c1380607f
j
:app/src/main/java/com/example/fallsafety/SplashScreen.java,8\d\8d1fd446c8c6d99790fde41bbe380ade9f0ca396
o
?app/src/main/java/com/example/fallsafety/TelephonyReceiver.java,4\d\4dd16f90068ddc23e53589a394e09d84e34dca70
n
>app/src/main/java/com/example/fallsafety/PostFallDetected.java,1\b\1bde2df39dafd6172c4acd09bb6ab162d1b564f3
j
:app/src/main/java/com/example/fallsafety/EditActivity.java,d\d\dd1ca85ccab4875ceabface9e43219792c8be9c3
T
$.idea/modules/app/FallSafety.app.iml,9\7\976d53529601c2301bf234ecaf0dfa80efd4d05f
r
B.idea/libraries/Gradle__androidx_appcompat_appcompat_1_2_0_aar.xml,b\a\ba1ffd1a9040a917162df3da1563e36410b4a33b
m
=app/src/test/java/com/example/fallsafety/ExampleUnitTest.java,5\6\568a87091bc33befac86bcc677e70c7e9868c5ff
L
.idea/codeStyles/Project.xml,6\e\6ecd6000a7b6f4a2884412ff19f74193ed089648
p
@.idea/libraries/Gradle__androidx_activity_activity_1_0_0_aar.xml,4\8\48fd53478cffefbba80fa711af4c2c369c8641fd
n
>app/src/main/java/com/example/fallsafety/ContactsActivity.java,b\9\b985de2409fd2f293c2d4c9b033860b3f0fb6816
:
.gitignore,a\5\a5cc2925ca8258af241be7e5b0381edf30266302
A
gradle.properties,2\a\2afbb999f001938c88fa43fc2ef52abf0f8213e4
7
gradlew,5\b\5bbfa66edb4db3c7c33c5181f43510990d3307f9
;
gradlew.bat,2\a\2a45a911a8f1836b0b6c5b758962572012d8f8c3
@
local.properties,0\7\0712df971a99ac4d2fccb8e0fb19f377f3374cca
?
settings.gradle,0\5\05efc8b1657769a27696d478ded1e95f38737233
>
app/.gitignore,5\1\51e1c5d383dfaa35e0e7e5873a0a99355a86880f
F
app/proguard-rules.pro,9\e\9e08934d811afe28fbc77aaa3c0d747b94348db9
g
7app/src/main/java/com/example/fallsafety/AppWidget.java,3\9\39a15e2d95c0634318403cc36976da21b44cbdfe
@
app/build.gradle,f\4\f4a01d6a4fcb971362ec00a83903fd3902f52164
<
build.gradle,f\0\f07866736216be0ee2aba49e392191aeae700a35
k
;app/src/main/java/com/example/fallsafety/ActiveService.java,8\d\8dfb3e76c976382683b78bf748cdcdc30f45b844

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

@ -0,0 +1,31 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.example.fallsafety"
minSdkVersion 23
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.android.material:material:1.2.0'
}

@ -0,0 +1,27 @@
package com.example.fallsafety;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.example.fallsafety", appContext.getPackageName());
}
}

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.fallsafety">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
<receiver android:name=".AppWidget">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/new_app_widget_info" />
</receiver>
<activity
android:name=".SplashScreen"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity" />
<activity
android:name=".ContactsActivity"
android:label="@string/contactos"
android:parentActivityName=".MainActivity" />
<activity
android:name=".EditActivity"
android:label="@string/editContact"
android:parentActivityName=".ContactsActivity" />
<activity android:name=".PostFallDetected"
android:label="@string/postFallDetected"
android:parentActivityName=".MainActivity"/>
<activity android:name=".Emergencia"
android:label="@string/emergency"
android:parentActivityName=".MainActivity"/>
<service
android:name=".ActiveService"
android:process=":service" />
<receiver
android:name=".TelephonyReceiver"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.PHONE_STATE" />
<action android:name="android.intent.action.NEW_OUTGOING_CALL" /> <!-- en principio este no hace falta -->
</intent-filter>
</receiver>
<meta-data
android:name="preloaded_fonts"
android:resource="@array/preloaded_fonts" />
</application>
</manifest>

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

@ -0,0 +1,243 @@
package com.example.fallsafety;
import android.Manifest;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.Build;
import android.os.CountDownTimer;
import android.os.IBinder;
import android.speech.tts.TextToSpeech;
import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.core.app.NotificationCompat;
import androidx.core.content.ContextCompat;
//X
//通过传感器实现跌倒检测
public class ActiveService extends Service implements SensorEventListener, TextToSpeech.OnInitListener {
/*
*
*/
private SensorManager mSensorManager;
private Sensor mSensorAcc;
double x, y, z;
double medX, medY, medZ;
int i = 0;
boolean min = false;
boolean max = false;
boolean vertical = false;
/*
tts
*/
private TextToSpeech tts = null;
double totalX = 0;
double totalY = 0;
double totalZ = 0;
/*
*
*/
private final static String CHANNEL_ID = "NOTIFICACION";
public final static int NOTIFICACION_ID = 0;
static CountDownTimer countDownTimer;
Emergencia emergencia;
public ActiveService() {
}
@Override
public void onCreate() {
// 传感器加速度计初始化
//得到系统服务传感器服务得到senorManger对象
mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
//获得加速度传感器服务
mSensorAcc = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
//调用SensorManager 的 registerListener() 方法来注册SensorEventListener 才能使其生效
mSensorManager.registerListener(this, mSensorAcc, SensorManager.SENSOR_DELAY_NORMAL);
System.out.println("主动服务");
Toast.makeText(this, "服务激活", Toast.LENGTH_SHORT).show();
emergencia = new Emergencia();
emergencia.getLocation();
if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {
System.out.println("没有手机读权限");
}
//文字转语音
tts = new TextToSpeech(this, this);
}
@Nullable
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
return Service.START_NOT_STICKY;
}
@Override
public void onDestroy() {
/*
*/
super.onDestroy();
mSensorManager.unregisterListener(this);
System.out.println("停用服务");
Toast.makeText(this, "服务已禁用", Toast.LENGTH_SHORT).show();
countDownTimer.cancel();
if (tts != null) {
tts.stop();
tts.shutdown();
}
}
@Override
public void onInit(int status) {
//检查实例化是否成功
if (status == TextToSpeech.SUCCESS) {
tts.setPitch(0.8f);
tts.setSpeechRate(1.1f);
} else if (status == TextToSpeech.ERROR) {
Toast.makeText(this, " 文本到语音转换失败 ", Toast.LENGTH_LONG).show();
}
}
@Override
public void onSensorChanged(SensorEvent event) {
synchronized (this) {
if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {
/*
XYZ.
*/
x = event.values[0];
y = event.values[1];
z = event.values[2];
double sum = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2) + Math.pow(z, 2));
double acel = sum / SensorManager.GRAVITY_EARTH;
/*
*/
}
}
}
public void fallDetected() {
/*
:
20
*/
Toast.makeText(this, "跌倒", Toast.LENGTH_LONG).show();
String textCaida = getResources().getString(R.string.textCaida);
textSpoken(textCaida);
}
private void crearNotif() {
//应用程序按钮的创建意图和挂起意图
Intent intentCancelar = new Intent(this, PostFallDetected.class);
PendingIntent pendingIntentCancelar = PendingIntent.getActivity(this, 0, intentCancelar, 0);
NotificationCompat.Builder builder = new NotificationCompat.Builder(getApplicationContext(), CHANNEL_ID);
builder.setSmallIcon(R.mipmap.ic_launcher_foreground);
builder.setContentTitle("检测到坠落");
builder.setContentText("他们会打电话给你的紧急联系人");
builder.setPriority(NotificationCompat.PRIORITY_HIGH);
builder.setVibrate(new long[]{1000, 1000, 2000, 1000});
builder.setDefaults(Notification.DEFAULT_SOUND);
builder.setContentIntent(pendingIntentCancelar);
builder.setAutoCancel(true);
NotificationManager mNotifyMgr =
(NotificationManager) getSystemService(NOTIFICATION_SERVICE);
mNotifyMgr.notify(NOTIFICACION_ID, builder.build());
}
private void crearCanalNotificacion() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
CharSequence name = "Notification";
NotificationChannel notificationChannel = new NotificationChannel(CHANNEL_ID, name, NotificationManager.IMPORTANCE_HIGH);
NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
notificationManager.createNotificationChannel(notificationChannel);
}
}
private void textSpoken(String text) {
tts.speak(text, TextToSpeech.QUEUE_ADD, null, "speak");
}
@Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {
}
}

@ -0,0 +1,50 @@
package com.example.fallsafety;
import android.app.PendingIntent;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.Context;
import android.content.Intent;
import android.widget.RemoteViews;
//Y
//应用程序小部件功能的实现。
public class AppWidget extends AppWidgetProvider {
static void updateAppWidget(Context context, AppWidgetManager appWidgetManager,
int appWidgetId) {
Intent intent= new Intent(context, Emergencia.class);
PendingIntent pendingIntent= PendingIntent.getActivity(context,0,intent,0);
// 构造RemoteView对象
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.app_widget);
views.setOnClickPendingIntent(R.id.btnadvicewidget, pendingIntent);
// 指示小部件管理器更新小部件
appWidgetManager.updateAppWidget(appWidgetId, views);
}
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
// 可能有多个窗口小部件处于活动状态,因此请更新所有窗口小部件
for (int appWidgetId : appWidgetIds) {
updateAppWidget(context, appWidgetManager, appWidgetId);
}
}
@Override
public void onEnabled(Context context) {
// 输入创建第一个小部件时的相关功能
}
@Override
public void onDisabled(Context context) {
// 输入最后一个小部件被禁用时的相关功能
}
}

@ -0,0 +1,65 @@
package com.example.fallsafety;
import java.lang.reflect.Method;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.TelephonyManager;
import android.util.Log;
//Y
//拨号及辅助功能
public class CallHelper extends BroadcastReceiver {
public static String TAG="PhoneStateReceiver";
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals("android.intent.action.PHONE_STATE")) {
String state = intent.getStringExtra(TelephonyManager.EXTRA_STATE);
Log.d(TAG,"PhoneStateReceiver**Call State=" + state);
if (state.equals(TelephonyManager.EXTRA_STATE_IDLE)) {
Log.d(TAG,"PhoneStateReceiver**Idle");
} else if (state.equals(TelephonyManager.EXTRA_STATE_RINGING)) {
// 来电
String incomingNumber = intent.getStringExtra(TelephonyManager.EXTRA_INCOMING_NUMBER);
Log.d(TAG,"PhoneStateReceiver**Incoming call " + incomingNumber);
if (!killCall(context)) {
// 使用先前定义的方法
Log.d(TAG,"PhoneStateReceiver **Unable to kill incoming call");
}
} else if (state.equals(TelephonyManager.EXTRA_STATE_OFFHOOK)) {
Log.d(TAG,"PhoneStateReceiver **Offhook");
}
} else if (intent.getAction().equals("android.intent.action.NEW_OUTGOING_CALL")) {
// 去电
String outgoingNumber = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
Log.d(TAG,"PhoneStateReceiver **Outgoing call " + outgoingNumber);
setResultData(null);
// 杀死去电进程
} else {
Log.d(TAG,"PhoneStateReceiver **unexpected intent.action=" + intent.getAction());
}
}
public boolean killCall(Context context) {
try {
// Get the boring old TelephonyManager电话管理员寻址
TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
// 获取getITelephony方法
Class classTelephony = Class.forName(telephonyManager.getClass().getName());
Method methodGetITelephony = classTelephony.getDeclaredMethod("getITelephony");
// 忽略方法应该是私有的
methodGetITelephony.setAccessible(true);
//调用getITelephony以获取ITelephony接口
Object telephonyInterface = methodGetITelephony.invoke(telephonyManager);
// 从ITelephony获取endCall方法
Class telephonyInterfaceClass = Class.forName(telephonyInterface.getClass().getName());
Method methodEndCall = telephonyInterfaceClass.getDeclaredMethod("endCall");
//调用endCall
methodEndCall.invoke(telephonyInterface);
} catch (Exception ex) {
// 反射呼叫可能会导致错误
Log.d(TAG,"PhoneStateReceiver **" + ex.toString());
return false;
} return true;
}
}

@ -0,0 +1,86 @@
package com.example.fallsafety;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;
//X
//有关建立便笺及编辑(应用于添加联系人的初始界面)
public class ContactsActivity extends AppCompatActivity {
private ContactsDbAdapter dbAdapter;
private ListView m_listview;
// 指示是否要创建新便笺或编辑现有便笺
private static final int ACTIVITY_CREATE=0;
private static final int ACTIVITY_EDIT=1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_contacts);
//创建BD适配器并打开它
dbAdapter = new ContactsDbAdapter(this);
dbAdapter.open();
//我们创建一个ListView它将包含所有注释的标题和
//当我们点击一个标题时,我们会启动一个编辑活动
//具有相应ID的便笺
m_listview = (ListView) findViewById(R.id.id_list_view);
m_listview.setOnItemClickListener(
new AdapterView.OnItemClickListener()
{
@Override
public void onItemClick(AdapterView<?> arg0, View view, int position, long id)
{
Intent i = new Intent(view.getContext(), EditActivity.class);
i.putExtra(ContactsDbAdapter.KEY_ROWID, id);
startActivityForResult(i, ACTIVITY_EDIT);
}
}
);
//我们用BD中所有注释的标题填充ListView
fillData();
}
private void fillData() {
Cursor contactsCursor = dbAdapter.fetchAllContacts();
//创建一个数组其中包含要在ListView中显示的字段仅限于注释标题
String[] from = new String[]{ContactsDbAdapter.KEY_NOMBRE, ContactsDbAdapter.KEY_TELEFONO};
//数组,其中包含要绑定到前一行数组中的字段
int[] to = new int[]{R.id.text1, R.id.text2};
//创建了一个SimpleCursorAdapter并将其分配给ListView以显示它
SimpleCursorAdapter contacts =
new SimpleCursorAdapter(this, R.layout.contacts_row, contactsCursor, from, to, 0);
m_listview.setAdapter(contacts);
}
public void createContact(View view) {
Intent i = new Intent(this, EditActivity.class);
startActivityForResult(i, ACTIVITY_CREATE);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
fillData();
}
}

@ -0,0 +1,179 @@
package com.example.fallsafety;
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;
//X
//数据库类
//类适配器方便我们使用BD
public class ContactsDbAdapter {
private static final String TAG = "APMOV: NotesDbAdapter"; //用于日志消息
//数据库名称、表在本例中为a和版本
private static final String DATABASE_NAME = "data";
private static final String DATABASE_TABLE = "CONTACTS";
private static final int DATABASE_VERSION = 1;
//数据库表字段
public static final String KEY_NOMBRE = "NOMBRE";
public static final String KEY_TELEFONO = "TELEFONO";
public static final String KEY_PRIORIDAD = "PRIORIDAD";
public static final String KEY_ROWID = "_id";
//创建数据库表的SQL语句
private static final String DATABASE_CREATE = "create table " + DATABASE_TABLE + " (" +
KEY_ROWID +" integer primary key autoincrement, " +
KEY_NOMBRE +" text not null, " +
KEY_TELEFONO +" text not null, " +
KEY_PRIORIDAD + " integer not null);";
private DatabaseHelper mDbHelper;
private SQLiteDatabase mDb;
private final Context mCtx;
private static class DatabaseHelper extends SQLiteOpenHelper {
DatabaseHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL(DATABASE_CREATE);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
Log.w(TAG, "Upgrading database from version " + oldVersion + " to "
+ newVersion + ", which will destroy all old data");
db.execSQL("DROP TABLE IF EXISTS " + DATABASE_TABLE);
onCreate(db);
}
}
/**
* -/
*
* @param ctx the Context within which to work
*/
public ContactsDbAdapter(Context ctx) {
this.mCtx = ctx;
}
/**
* notes
*
*
*
* @return this (self reference, allowing this to be chained in an
* initialization call)
* @throws SQLException if the database could be neither opened or created
*/
public ContactsDbAdapter open() throws SQLException {
mDbHelper = new DatabaseHelper(mCtx);
mDb = mDbHelper.getWritableDatabase();
return this;
}
public void close() {
mDbHelper.close();
}
/**
*使
*便rowId
* a-1
*
* @param nombre the name of the contact
* @param telefono the number of the contact
* @return rowId or -1 if failed
*/
public long createContact(String nombre, String telefono, int prioridad) {
ContentValues initialValues = new ContentValues();
initialValues.put(KEY_NOMBRE, nombre);
initialValues.put(KEY_TELEFONO, telefono);
initialValues.put(KEY_PRIORIDAD, prioridad);
return mDb.insert(DATABASE_TABLE, null, initialValues);
}
/**
* rowId
*
* @param rowId id of note to delete
* @return true if deleted, false otherwise
*/
public boolean deleteContact(long rowId) {
return mDb.delete(DATABASE_TABLE, KEY_ROWID + "=" + rowId, null) > 0;
}
/**
*
*
* @return Cursor over all notes
*/
public Cursor fetchAllContacts() {
return mDb.query(DATABASE_TABLE, new String[] {KEY_ROWID, KEY_NOMBRE,
KEY_TELEFONO, KEY_PRIORIDAD}, null, null, null, null, KEY_PRIORIDAD+" ASC");
}
/**
* rowId
*
* @param rowId id of note to retrieve
* @return Cursor positioned to matching note, if found
* @throws SQLException if note could not be found/retrieved
*/
public Cursor fetchContact(long rowId) throws SQLException {
Cursor mCursor =
mDb.query(true, DATABASE_TABLE, new String[] {KEY_ROWID,
KEY_NOMBRE, KEY_TELEFONO, KEY_PRIORIDAD}, KEY_ROWID + "=" + rowId, null,
null, null, null, null);
if (mCursor != null) {
mCursor.moveToFirst();
}
return mCursor;
}
public Cursor fetchContactPriority(int priority) throws SQLException{
Cursor mCursor =
mDb.query(true, DATABASE_TABLE, new String[] {KEY_ROWID,
KEY_NOMBRE, KEY_TELEFONO, KEY_PRIORIDAD}, KEY_PRIORIDAD + "=" + priority, null,
null, null, null, null);
if (mCursor != null) {
mCursor.moveToFirst();
}
return mCursor;
}
/**
* 使
*使rowId使
*
*
* @param rowId id of note to update
* @param nombre value to set note title to
* @param telefono value to set note body to
* @return true if the note was successfully updated, false otherwise
*/
public boolean updateContact(long rowId, String nombre, String telefono, int prioridad) {
ContentValues args = new ContentValues();
args.put(KEY_NOMBRE, nombre);
args.put(KEY_TELEFONO, telefono);
args.put(KEY_PRIORIDAD,prioridad);
return mDb.update(DATABASE_TABLE, args, KEY_ROWID + "=" + rowId, null) > 0;
}
}

@ -0,0 +1,155 @@
package com.example.fallsafety;
import androidx.appcompat.app.AppCompatActivity;
import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.ContactsContract;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
//X
//创建三元素的列表相关(应用于添加联系人的编辑界面)
public class EditActivity extends AppCompatActivity {
private EditText mNombreText, mTelefonoText, mPrioridadText;
private Long mRowId;
private ContactsDbAdapter dbAdapter;
private static final int PICK_CONTACT_REQUEST=1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// infla el layout充气布局
setContentView(R.layout.activity_edit);
// 获取对构成布局的三个视图的引用。
mNombreText = (EditText) findViewById(R.id.nombreContacto);
mTelefonoText = (EditText) findViewById(R.id.numeroContacto);
mPrioridadText= (EditText) findViewById(R.id.prioridadContacto);
Button confirmButton = (Button) findViewById(R.id.guardar);
//我们创建了BD适配器并打开它
dbAdapter = new ContactsDbAdapter(this);
dbAdapter.open();
// 获取传递给它的表的行ID单击联系人编辑0
mRowId = (savedInstanceState == null) ? null :
(Long) savedInstanceState.getSerializable(ContactsDbAdapter.KEY_ROWID);
if (mRowId == null) {
Bundle extras = getIntent().getExtras();
mRowId = extras != null ? extras.getLong(ContactsDbAdapter.KEY_ROWID) : null;
}
// 如果您传递了一个ID不是空的则用保存在BD中的字段填充否则留空
if (mRowId != null) {
Cursor contact = dbAdapter.fetchContact(mRowId);
mNombreText.setText(contact.getString(
contact.getColumnIndexOrThrow(ContactsDbAdapter.KEY_NOMBRE)));
mTelefonoText.setText(contact.getString(
contact.getColumnIndexOrThrow(ContactsDbAdapter.KEY_TELEFONO)));
mPrioridadText.setText(contact.getString(
contact.getColumnIndexOrThrow(ContactsDbAdapter.KEY_PRIORIDAD)));
}
FloatingActionButton fab= (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
seleccionarContacto();
}
});
}
private void seleccionarContacto() {
Intent selectContacto = new Intent(Intent.ACTION_PICK, Uri.parse("content://contacts"));
selectContacto.setType(ContactsContract.CommonDataKinds.Phone.CONTENT_TYPE);
startActivityForResult(selectContacto, PICK_CONTACT_REQUEST);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == PICK_CONTACT_REQUEST) {
if (resultCode == RESULT_OK) {
Uri uri = data.getData();
Cursor cursor = getContentResolver().query(uri, null, null, null, null);
if(cursor.moveToFirst()){
int columnaNombre=cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME);
int columnaNumero=cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER);
String nombre= cursor.getString(columnaNombre);
String numero= cursor.getString(columnaNumero);
mNombreText.setText(nombre);
mTelefonoText.setText(numero);
}
}
}
}
public void deleteContact(View view){
if (mRowId != null) {
dbAdapter.deleteContact(mRowId);
}
setResult(RESULT_OK);
dbAdapter.close();
finish();
}
//添加联系人
public void saveNote(View view) {
String nombre = mNombreText.getText().toString();
String telefono = mTelefonoText.getText().toString();
String prioridad= mPrioridadText.getText().toString();
if (telefono.length()!=9 && telefono.length()!=12 && telefono.length()!=16 && telefono.length()==0){
Toast.makeText(this,"无效号码", Toast.LENGTH_LONG).show();
} else if(nombre.length() == 0){
Toast.makeText(this, "输入一个名字", Toast.LENGTH_LONG).show();
} else if(prioridad.length() == 0 ){
Toast.makeText(this, "优先级错误", Toast.LENGTH_LONG).show();
} else {
int priority= Integer.parseInt(prioridad);
if (mRowId == null) {
long id = dbAdapter.createContact(nombre, telefono,priority);
if (id > 0) {
mRowId = id;
}
} else {
dbAdapter.updateContact(mRowId, nombre, telefono,priority);
}
Toast.makeText(this,"联系人添加正确", Toast.LENGTH_LONG).show();
setResult(RESULT_OK);
dbAdapter.close();
finish();
}
}
}

@ -0,0 +1,214 @@
package com.example.fallsafety;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import android.Manifest;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.net.Uri;
import android.os.Bundle;
import android.telephony.SmsManager;
import android.util.Log;
import android.widget.Toast;
//X
//紧急情况响应
public class Emergencia extends AppCompatActivity{
/*
*/
SmsManager smsManager;
String phoneNumber;
String textMsg;
/*
*/
double latitude, longitude;
/*
*/
private ContactsDbAdapter dbAdapter;
public Emergencia(){
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.emergencia_activity);
getLocation();
Toast.makeText(this, "clase emergencia", Toast.LENGTH_LONG).show();
String smsEmergencia=getResources().getString(R.string.smsEmergencia);
sendSMS(this, smsEmergencia);
makeCall(this);
}
public void sendSMS(Context context, String txt){
getLocation();
smsManager= SmsManager.getDefault();
//textMsg=txt + "https://maps.google.com/?q="+String.valueOf(latitude)+","+String.valueOf(longitude) ;
textMsg=txt + "https://maps.google.com/?q=40.332853,-3.765089" ;
Toast.makeText(context,"ENVIADO SMS", Toast.LENGTH_LONG).show();
/*
*/
//我们创建了BD适配器并打开它
dbAdapter = new ContactsDbAdapter(context);
dbAdapter.open();
Cursor contactsCursor= dbAdapter.fetchAllContacts();
if (contactsCursor.getCount()!=0){
contactsCursor.moveToFirst();
do{
System.out.println("NOMBRE: " + contactsCursor.getString(1));
System.out.println("TELEFONO: " + contactsCursor.getString(2));
phoneNumber= contactsCursor.getString(2);
System.out.println("PHONE NUMBER A MANDAR SMS: " + phoneNumber);
System.out.println(textMsg);
smsManager.sendTextMessage(phoneNumber, null, textMsg, null, null);
} while (contactsCursor.moveToNext());
}
}
public void makeCall(Context context){
//我们创建了BD适配器并打开它
dbAdapter = new ContactsDbAdapter(context);
dbAdapter.open();
Cursor contactsCursor= dbAdapter.fetchAllContacts();
if (contactsCursor.getCount()!=0){
contactsCursor.moveToFirst();
System.out.println("NOMBRE: " + contactsCursor.getString(1));
System.out.println("TELEFONO: " + contactsCursor.getString(2));
phoneNumber=contactsCursor.getString(2);
try{
System.out.println("OK");
if(ContextCompat.checkSelfPermission(context, Manifest.permission.CALL_PHONE)
!= PackageManager.PERMISSION_GRANTED){
System.out.println("没有呼叫权限");
}
Intent intentLlamada = new Intent(Intent.ACTION_CALL, Uri.parse("tel:"+phoneNumber));
intentLlamada.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intentLlamada);
} catch (Exception e){
System.out.println("错误");
e.printStackTrace();
}
}
}
public void getLocation(){
try{
String serviceString= Context.LOCATION_SERVICE;
LocationManager locationManager = (LocationManager) getSystemService(serviceString);
LocationListener locationListener= new LocationListener() {
@Override
public void onLocationChanged(Location location) {
latitude= location.getLatitude();
longitude= location.getLongitude();
}
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
}
@Override
public void onProviderEnabled(String provider) {
}
@Override
public void onProviderDisabled(String provider) {
}
};
// 检查访问位置的权限
if(ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION)
!= PackageManager.PERMISSION_GRANTED){
//ActivityCompat.requestPermissions(MainActivity.this.getApplicationContext(), new String[]{Manifest.permission.SEND_SMS}, REQUEST_PERMISSION_ACCESS_FINE_LOCATION);
Toast.makeText(this.getApplicationContext(), "没有位置权限", Toast.LENGTH_SHORT).show();
}
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5000, 0, locationListener);
Criteria criteria= new Criteria();
String provider= String.valueOf(locationManager.getBestProvider(criteria, true)).toString();
System.out.println("provider: " + provider);
Location location= locationManager.getLastKnownLocation(provider);
if(location!=null){
Log.e("TAG", "GPS ON");
latitude=location.getLatitude();
longitude=location.getLongitude();
} else{
locationManager.requestLocationUpdates(provider, 1000,0, locationListener );
}
locationManager.requestLocationUpdates(provider, 5000, 0, locationListener);
System.out.println("lat" + latitude + "lon " + longitude);
} catch (Exception e){
e.printStackTrace();
}
}
}

@ -0,0 +1,164 @@
package com.example.fallsafety;
import androidx.appcompat.app.AppCompatActivity;
import android.Manifest;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.os.Build;
import android.os.Bundle;
import android.speech.tts.TextToSpeech;
import android.view.View;
import android.widget.ImageButton;
import android.widget.Switch;
import android.widget.TextView;
import android.widget.Toast;
//X
//有关主界面的内部逻辑
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
private Context mCtx =this;
/*
TTS
*/
private static int TTS_DATA_CHECK=1;
private TextView textEstado;
private Switch aSwitch;
static ContactsDbAdapter dbAdapter;
private ImageButton btnAdvice;
public MainActivity(){
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
checkPermissions();
textEstado= (TextView) findViewById(R.id.textEstado);
aSwitch= (Switch) findViewById(R.id.btnswitch);
// 我们创建了BD适配器并打开它
dbAdapter = new ContactsDbAdapter(this);
dbAdapter.open();
// 获取传递给它的表的行ID单击联系人编辑0
Long mRowId = (savedInstanceState == null) ? null :
(Long) savedInstanceState.getSerializable(ContactsDbAdapter.KEY_ROWID);
btnAdvice= (ImageButton) findViewById(R.id.btnadvice);
btnAdvice.setOnClickListener(this);
Emergencia emergencia = new Emergencia();
emergencia.getLocation();
/*
TTS
*/
Intent checkTTs= new Intent();
checkTTs.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);
startActivityForResult(checkTTs, TTS_DATA_CHECK);
}
@Override
public void onClick(View v){
Cursor contactsCursor = dbAdapter.fetchAllContacts();
if(contactsCursor.getCount()==0) {
Toast.makeText(this, getResources().getString(R.string.noContactos), Toast.LENGTH_SHORT).show();
} else {
if (v.getId() == btnAdvice.getId()) {
Toast.makeText(this, "紧急按钮", Toast.LENGTH_LONG).show();
Intent intent= new Intent(this, Emergencia.class);
startActivity(intent);
}
}
}
public void clickSwitch(View view){
Cursor contactsCursor = dbAdapter.fetchAllContacts();
if(contactsCursor.getCount()==0) {
aSwitch.setChecked(false);
Toast.makeText(this, getResources().getString(R.string.noContactos), Toast.LENGTH_SHORT).show();
} else{
if(view.getId() == R .id.btnswitch){
if(aSwitch.isChecked()){
textEstado.setText(getResources().getString(R.string.estadoOn));
startService(new Intent(mCtx, ActiveService.class));
} else {
textEstado.setText(getResources().getString(R.string.estadoOff));
stopService(new Intent(mCtx, ActiveService.class));
}
}
}
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == TTS_DATA_CHECK) {
if (resultCode != TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {
// 无数据-立即安装
Intent installTTSIntent = new Intent();
installTTSIntent.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
startActivity(installTTSIntent);
}
}
}
public void Contact(View view){
Intent contact= new Intent(this, ContactsActivity.class);
startActivity(contact);
}
public void checkPermissions(){
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M){
int permsRequestCode = 100;
String[] perms = {Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.CALL_PHONE, Manifest.permission.SEND_SMS, Manifest.permission.READ_PHONE_STATE, Manifest.permission.READ_CONTACTS};
int accessFinePermission = checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION);
int accessCoarsePermission = checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION);
int callPermission = checkSelfPermission(Manifest.permission.CALL_PHONE);
int smsPermission= checkSelfPermission(Manifest.permission.SEND_SMS);
int readPhonePermission= checkSelfPermission(Manifest.permission.READ_PHONE_STATE);
int readContacts = checkSelfPermission(Manifest.permission.READ_CONTACTS);
if (callPermission == PackageManager.PERMISSION_GRANTED && accessFinePermission == PackageManager.PERMISSION_GRANTED && accessCoarsePermission == PackageManager.PERMISSION_GRANTED && smsPermission==PackageManager.PERMISSION_GRANTED && readPhonePermission==PackageManager.PERMISSION_GRANTED && readContacts==PackageManager.PERMISSION_GRANTED) {
} else {
requestPermissions(perms, permsRequestCode);
}
}
}
}

@ -0,0 +1,79 @@
package com.example.fallsafety;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.view.Gravity;
import android.view.View;
import android.widget.ImageButton;
import android.widget.Toast;
//Y
//故障后检测
public class PostFallDetected extends AppCompatActivity implements View.OnClickListener {
private Context mCtx =this;
private ImageButton btnNoCaida;
private ImageButton btnSiCaida;
private CountDownTimer count;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_post_fall_detected);
btnNoCaida = (ImageButton) findViewById(R.id.btnNoCaida);
btnNoCaida.setOnClickListener(this);
btnSiCaida= (ImageButton) findViewById(R.id.btnSiCaida);
btnSiCaida.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.btnNoCaida:
cancelarServicio();
Toast toast = Toast.makeText(this, "AVISO CANCELADO", Toast.LENGTH_LONG);
toast.setGravity(Gravity.CENTER,0,0);
toast.show();
break;
case R.id.btnSiCaida:
cancelarServicio();
Intent intent= new Intent(this, Emergencia.class);
startActivity(intent);
break;
}
}
public void cancelarServicio(){
stopService(new Intent(mCtx, ActiveService.class));
count = new CountDownTimer( 30000,1000) {
@Override
public void onTick(long millisUntilFinished) {
}
@Override
public void onFinish() {
startService(new Intent(mCtx, ActiveService.class));
}
}.start();
}
}

@ -0,0 +1,36 @@
package com.example.fallsafety;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
//X
//初始化界面的设计
public class SplashScreen extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash_screen);
int time=2000;
// 输入一个延迟时间,使活动持续运行运行几秒钟。
new Handler().postDelayed(new Runnable() {
@Override
//在一段时间后运行下面的内容
public void run() {
Intent intent = new Intent (SplashScreen.this, MainActivity.class);
startActivity(intent);
}
},time); //暂定4秒
}
}

@ -0,0 +1,40 @@
package com.example.fallsafety;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.media.AudioManager;
import android.telephony.TelephonyManager;
import android.widget.Toast;
//Y
//收电话
public class TelephonyReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
TelephonyManager telephonyManager= (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
switch (telephonyManager.getCallState()){
case TelephonyManager.CALL_STATE_RINGING:
break;
case TelephonyManager.CALL_STATE_IDLE:
AudioManager man= (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
man.setSpeakerphoneOn(false);
break;
case TelephonyManager.CALL_STATE_OFFHOOK:
AudioManager manager= (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
manager.setMode(AudioManager.MODE_IN_COMMUNICATION);
manager.setStreamVolume(AudioManager.STREAM_VOICE_CALL,manager.getStreamMaxVolume(AudioManager.STREAM_VOICE_CALL),0);
manager.setSpeakerphoneOn(true);
break;
}
}
}

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/colorVerde"
android:state_checked="true" />
<item android:color="@color/colorRojo"/>
</selector>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/colorPastel"/>
<corners android:radius="200dp"/>
</shape>

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="225"
android:endColor="@color/colorBlanco"
android:startColor="@color/colorBlanco"/>
</shape>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
</vector>

@ -0,0 +1,5 @@
<vector android:height="60dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="60dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#F0000000" android:pathData="M15,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM6,10L6,7L4,7v3L1,10v2h3v3h2v-3h3v-2L6,10zM15,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
</vector>

@ -0,0 +1,5 @@
<vector android:height="250dp" android:tint="#F20D0C"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="250dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M15,3L6,3c-0.83,0 -1.54,0.5 -1.84,1.22l-3.02,7.05c-0.09,0.23 -0.14,0.47 -0.14,0.73v1.91l0.01,0.01L1,14c0,1.1 0.9,2 2,2h6.31l-0.95,4.57 -0.03,0.32c0,0.41 0.17,0.79 0.44,1.06L9.83,23l6.59,-6.59c0.36,-0.36 0.58,-0.86 0.58,-1.41L17,5c0,-1.1 -0.9,-2 -2,-2zM19,3v12h4L23,3h-4z"/>
</vector>

@ -0,0 +1,5 @@
<vector android:height="250dp" android:tint="#11F222"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="250dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M1,21h4L5,9L1,9v12zM23,10c0,-1.1 -0.9,-2 -2,-2h-6.31l0.95,-4.57 0.03,-0.32c0,-0.41 -0.17,-0.79 -0.44,-1.06L14.17,1 7.59,7.59C7.22,7.95 7,8.45 7,9v10c0,1.1 0.9,2 2,2h9c0.83,0 1.54,-0.5 1.84,-1.22l3.02,-7.05c0.09,-0.23 0.14,-0.47 0.14,-0.73v-1.91l-0.01,-0.01L23,10z"/>
</vector>

@ -0,0 +1,5 @@
<vector android:height="250dp" android:tint="#F20D0C"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="250dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M1,21h22L12,2 1,21zM13,18h-2v-2h2v2zM13,14h-2v-4h2v4z"/>
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:app="http://schemas.android.com/apk/res-auto"
app:fontProviderAuthority="com.google.android.gms.fonts"
app:fontProviderPackage="com.google.android.gms"
app:fontProviderQuery="Quicksand"
app:fontProviderCerts="@array/com_google_android_gms_fonts_certs">
</font-family>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:app="http://schemas.android.com/apk/res-auto"
app:fontProviderAuthority="com.google.android.gms.fonts"
app:fontProviderPackage="com.google.android.gms"
app:fontProviderQuery="name=Quicksand&amp;weight=500"
app:fontProviderCerts="@array/com_google_android_gms_fonts_certs">
</font-family>

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_color">
<Button
android:id="@+id/addContact"
android:layout_width="match_parent"
android:layout_height="80dp"
android:background="@color/colorGris"
android:fontFamily="@font/quicksand_medium"
android:onClick="createContact"
android:text="@string/addContact"
android:textSize="30sp"
android:textStyle="bold" />
<ListView
android:id="@+id/id_list_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>

@ -0,0 +1,102 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".EditActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_color"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingTop="16dp"
android:paddingRight="16dp"
android:paddingBottom="16dp">
<EditText
android:id="@+id/nombreContacto"
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_marginTop="20dp"
android:fontFamily="@font/quicksand_medium"
android:hint="@string/editNombre"
android:inputType="text"
android:textSize="24sp" />
<EditText
android:id="@+id/numeroContacto"
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_below="@+id/nombreContacto"
android:layout_marginTop="30dp"
android:fontFamily="@font/quicksand_medium"
android:hint="@string/editNumero"
android:inputType="phone"
android:textSize="24sp" />
<EditText
android:id="@+id/prioridadContacto"
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_below="@+id/numeroContacto"
android:layout_marginTop="30dp"
android:layout_marginBottom="40dp"
android:fontFamily="@font/quicksand_medium"
android:hint="@string/editPrioridad"
android:inputType="number"
android:textSize="24sp" />
<Button
android:id="@+id/guardar"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_below="@+id/prioridadContacto"
android:layout_marginTop="10dp"
android:background="@drawable/backbtn"
android:fontFamily="@font/quicksand_medium"
android:onClick="saveNote"
android:text="@string/guardar"
android:textSize="24sp"
android:textStyle="bold" />
<Button
android:id="@+id/borrar"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_alignEnd="@+id/prioridadContacto"
android:layout_alignBottom="@+id/guardar"
android:layout_marginTop="10dp"
android:onClick="deleteContact"
android:background="@drawable/backbtn"
android:text="@string/borrar"
android:fontFamily="@font/quicksand_medium"
android:textStyle="bold"
android:textSize="24sp"/>
</RelativeLayout>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="16dp"
app:srcCompat="@drawable/ic_person_add_white_60dp"
app:fabCustomSize="80dp"
app:maxImageSize="50dp"
android:scaleType="center"/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/bg_color">
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
android:paddingBottom="50dp"
android:paddingEnd="100dp"
android:paddingStart="100dp">
<ImageButton
android:id="@+id/btnadvice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:src="@drawable/backbtn" />
<TextView
android:id="@+id/textEstado"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginStart="8dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="8dp"
android:fontFamily="@font/quicksand_medium"
android:text="@string/estadoOff"
android:textColor="@color/colorBlack"
android:gravity="center"
android:textSize="30sp" />
<Switch
android:id="@+id/btnswitch"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleX="3"
android:scaleY="3"
style="@style/SwitchCompatTheme"
android:onClick="clickSwitch"/>
<Button
android:id="@+id/btnContactos"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:alpha="0.9"
android:background="@drawable/backbtn"
android:fontFamily="@font/quicksand_medium"
android:textStyle="bold"
android:textSize="35sp"
android:onClick="Contact"
android:text="@string/contactos" />
</LinearLayout>
</ScrollView>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:background="@drawable/bg_color"
tools:context=".PostFallDetected">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<ImageButton
android:id="@+id/btnNoCaida"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:src="@drawable/ic_thumb_up_black_150dp" />
<ImageButton
android:id="@+id/btnSiCaida"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:src="@drawable/ic_thumb_down_red_150dp" />
</LinearLayout>
</LinearLayout>

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:background="@color/colorPastel">
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/image"/>
</LinearLayout>

@ -0,0 +1,16 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@null"
android:padding="@dimen/widget_margin">
<ImageButton
android:id="@+id/btnadvicewidget"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:src="@drawable/ic_warning_black_24dp" />
</LinearLayout>

@ -0,0 +1,51 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="horizontal"
android:background="@color/colorBack">
<ImageView
android:id="@+id/imageContact"
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_weight="30"
android:padding="10dp"
android:src="@drawable/ic_contact"
android:background="@color/colorRosa"/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_weight="80"
android:orientation="vertical">
<TextView
android:id="@+id/text1"
android:layout_width="match_parent"
android:layout_height="50dp"
android:paddingStart="20dp"
android:paddingEnd="10dp"
android:fontFamily="@font/quicksand_medium"
android:gravity="center|start"
android:textStyle="bold"
android:textSize="20sp" />
<TextView
android:id="@+id/text2"
android:layout_width="match_parent"
android:layout_height="50dp"
android:paddingStart="20dp"
android:paddingEnd="10dp"
android:fontFamily="@font/quicksand_medium"
android:gravity="center|start"
android:textStyle="bold"
android:textSize="18sp"/>
</LinearLayout>
</LinearLayout>

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Emergencia">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
android:paddingBottom="40dp"
android:paddingEnd="40dp"
android:paddingStart="40dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingTop="10dp"
android:layout_marginStart="8dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="8dp"
android:fontFamily="@font/quicksand_medium"
android:text="@string/emergencia1"
android:textColor="@color/colorBlack"
android:gravity="center"
android:textSize="30sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingTop="20dp"
android:layout_marginStart="8dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="8dp"
android:fontFamily="@font/quicksand_medium"
android:text="@string/emergencia2"
android:textColor="@color/colorBlack"
android:gravity="center"
android:textSize="30sp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/icon"
android:paddingTop="50dp"/>
</LinearLayout>
</LinearLayout>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save