├── Part 1 ├── AndroidClient │ ├── app │ │ ├── .gitignore │ │ ├── .idea │ │ │ ├── .name │ │ │ ├── caches │ │ │ │ ├── gradle_models.ser │ │ │ │ └── build_file_checksums.ser │ │ │ ├── vcs.xml │ │ │ ├── misc.xml │ │ │ ├── modules.xml │ │ │ ├── libraries │ │ │ │ ├── Gradle__com_google_code_findbugs_jsr305_2_0_1_jar.xml │ │ │ │ ├── Gradle__com_android_support_support_annotations_28_0_0_jar.xml │ │ │ │ ├── Gradle__com_android_support_constraint_constraint_layout_solver_1_1_3_jar.xml │ │ │ │ ├── Gradle__com_android_support_constraint_constraint_layout_1_1_3_aar.xml │ │ │ │ ├── Gradle__com_squareup_okio_okio_1_9_0_jar.xml │ │ │ │ ├── Gradle__android_arch_core_common_1_0_0_jar.xml │ │ │ │ ├── Gradle__com_squareup_okhttp3_okhttp_3_4_1_jar.xml │ │ │ │ ├── Gradle__android_arch_lifecycle_common_1_0_0_jar.xml │ │ │ │ ├── Gradle__android_arch_lifecycle_runtime_1_0_0_aar.xml │ │ │ │ ├── Gradle__com_android_support_test_monitor_1_0_2_aar.xml │ │ │ │ ├── Gradle__com_android_support_test_runner_1_0_2_aar.xml │ │ │ │ ├── Gradle__com_android_support_support_v4_26_1_0_aar.xml │ │ │ │ ├── Gradle__com_android_support_appcompat_v7_26_1_0_aar.xml │ │ │ │ ├── Gradle__junit_junit_4_12_jar.xml │ │ │ │ ├── Gradle__com_android_support_support_compat_26_1_0_aar.xml │ │ │ │ ├── Gradle__com_android_support_support_core_ui_26_1_0_aar.xml │ │ │ │ ├── Gradle__com_android_support_support_fragment_26_1_0_aar.xml │ │ │ │ ├── Gradle__com_android_support_support_core_utils_26_1_0_aar.xml │ │ │ │ ├── Gradle__com_android_support_support_media_compat_26_1_0_aar.xml │ │ │ │ ├── Gradle__net_sf_kxml_kxml2_2_3_0_jar.xml │ │ │ │ ├── Gradle__com_android_support_support_vector_drawable_26_1_0_aar.xml │ │ │ │ ├── Gradle__com_android_support_test_espresso_espresso_core_3_0_2_aar.xml │ │ │ │ ├── Gradle__com_android_support_animated_vector_drawable_26_1_0_aar.xml │ │ │ │ ├── Gradle__javax_inject_javax_inject_1_jar.xml │ │ │ │ ├── Gradle__com_android_support_test_espresso_espresso_idling_resource_3_0_2_aar.xml │ │ │ │ ├── Gradle__com_squareup_javawriter_2_1_1_jar.xml │ │ │ │ ├── Gradle__org_hamcrest_hamcrest_core_1_3_jar.xml │ │ │ │ ├── Gradle__org_hamcrest_hamcrest_library_1_3_jar.xml │ │ │ │ └── Gradle__org_hamcrest_hamcrest_integration_1_3_jar.xml │ │ │ ├── runConfigurations.xml │ │ │ ├── gradle.xml │ │ │ ├── codeStyles │ │ │ │ └── Project.xml │ │ │ ├── assetWizardSettings.xml │ │ │ └── workspace.xml │ │ ├── src │ │ │ ├── main │ │ │ │ ├── res │ │ │ │ │ ├── values │ │ │ │ │ │ ├── strings.xml │ │ │ │ │ │ ├── ic_launcher_background.xml │ │ │ │ │ │ ├── colors.xml │ │ │ │ │ │ └── styles.xml │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ ├── ic_launcher_round.png │ │ │ │ │ │ └── ic_launcher_foreground.png │ │ │ │ │ ├── xml │ │ │ │ │ │ └── network_security_config.xml │ │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ │ │ ├── ic_launcher.xml │ │ │ │ │ │ └── ic_launcher_round.xml │ │ │ │ │ ├── drawable-v24 │ │ │ │ │ │ └── ic_launcher_foreground.xml │ │ │ │ │ ├── layout │ │ │ │ │ │ └── activity_main.xml │ │ │ │ │ └── drawable │ │ │ │ │ │ └── ic_launcher_background.xml │ │ │ │ ├── ic_launcher-web.png │ │ │ │ ├── AndroidManifest.xml │ │ │ │ └── java │ │ │ │ │ └── gad │ │ │ │ │ └── heartbeat │ │ │ │ │ └── androidflask │ │ │ │ │ └── easyupload │ │ │ │ │ └── MainActivity.java │ │ │ ├── test │ │ │ │ └── java │ │ │ │ │ └── gad │ │ │ │ │ └── example │ │ │ │ │ └── dell │ │ │ │ │ └── androidflask │ │ │ │ │ └── ExampleUnitTest.java │ │ │ └── androidTest │ │ │ │ └── java │ │ │ │ └── gad │ │ │ │ └── example │ │ │ │ └── dell │ │ │ │ └── androidflask │ │ │ │ └── ExampleInstrumentedTest.java │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── release │ │ │ └── output.json │ │ ├── local.properties │ │ ├── proguard-rules.pro │ │ ├── build.gradle │ │ ├── gradlew.bat │ │ └── gradlew │ ├── settings.gradle │ ├── .idea │ │ ├── caches │ │ │ ├── gradle_models.ser │ │ │ └── build_file_checksums.ser │ │ ├── encodings.xml │ │ ├── vcs.xml │ │ ├── modules.xml │ │ ├── runConfigurations.xml │ │ ├── gradle.xml │ │ ├── misc.xml │ │ ├── codeStyles │ │ │ └── Project.xml │ │ └── assetWizardSettings.xml │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── .gitignore │ ├── build.gradle │ ├── gradle.properties │ ├── gradlew.bat │ └── gradlew └── FlaskServer │ └── flask_server.py ├── 3.jpg ├── 6.jpg ├── 7.jpg ├── 9.jpg ├── .gitattributes ├── Part 2 ├── FlaskServer │ ├── model.h5 │ ├── androidFlask.jpg │ └── flask_server.py └── MLP_MNIST_Keras.py ├── .github └── FUNDING.yml ├── License.md └── README.md /Part 1/AndroidClient/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/.name: -------------------------------------------------------------------------------- 1 | AndroidClient -------------------------------------------------------------------------------- /Part 1/AndroidClient/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedfgad/AndroidFlask/HEAD/3.jpg -------------------------------------------------------------------------------- /6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedfgad/AndroidFlask/HEAD/6.jpg -------------------------------------------------------------------------------- /7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedfgad/AndroidFlask/HEAD/7.jpg -------------------------------------------------------------------------------- /9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedfgad/AndroidFlask/HEAD/9.jpg -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /Part 2/FlaskServer/model.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedfgad/AndroidFlask/HEAD/Part 2/FlaskServer/model.h5 -------------------------------------------------------------------------------- /Part 2/FlaskServer/androidFlask.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedfgad/AndroidFlask/HEAD/Part 2/FlaskServer/androidFlask.jpg -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | EasyUpload 3 | 4 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/.idea/caches/gradle_models.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedfgad/AndroidFlask/HEAD/Part 1/AndroidClient/.idea/caches/gradle_models.ser -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/caches/gradle_models.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedfgad/AndroidFlask/HEAD/Part 1/AndroidClient/app/.idea/caches/gradle_models.ser -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedfgad/AndroidFlask/HEAD/Part 1/AndroidClient/app/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /Part 1/AndroidClient/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedfgad/AndroidFlask/HEAD/Part 1/AndroidClient/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /Part 1/AndroidClient/.idea/caches/build_file_checksums.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedfgad/AndroidFlask/HEAD/Part 1/AndroidClient/.idea/caches/build_file_checksums.ser -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedfgad/AndroidFlask/HEAD/Part 1/AndroidClient/app/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/caches/build_file_checksums.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedfgad/AndroidFlask/HEAD/Part 1/AndroidClient/app/.idea/caches/build_file_checksums.ser -------------------------------------------------------------------------------- /Part 1/AndroidClient/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedfgad/AndroidFlask/HEAD/Part 1/AndroidClient/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedfgad/AndroidFlask/HEAD/Part 1/AndroidClient/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedfgad/AndroidFlask/HEAD/Part 1/AndroidClient/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedfgad/AndroidFlask/HEAD/Part 1/AndroidClient/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Part 1/AndroidClient/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedfgad/AndroidFlask/HEAD/Part 1/AndroidClient/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedfgad/AndroidFlask/HEAD/Part 1/AndroidClient/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedfgad/AndroidFlask/HEAD/Part 1/AndroidClient/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedfgad/AndroidFlask/HEAD/Part 1/AndroidClient/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #604DA6 4 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedfgad/AndroidFlask/HEAD/Part 1/AndroidClient/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedfgad/AndroidFlask/HEAD/Part 1/AndroidClient/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedfgad/AndroidFlask/HEAD/Part 1/AndroidClient/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedfgad/AndroidFlask/HEAD/Part 1/AndroidClient/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedfgad/AndroidFlask/HEAD/Part 1/AndroidClient/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedfgad/AndroidFlask/HEAD/Part 1/AndroidClient/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahmedfgad/AndroidFlask/HEAD/Part 1/AndroidClient/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /Part 1/AndroidClient/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/release/output.json: -------------------------------------------------------------------------------- 1 | [{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"0.1","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Jul 25 21:04:01 EET 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip 7 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Sep 20 00:10:08 EET 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip 7 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/src/main/res/xml/network_security_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 192.168.43.177 5 | 6 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/local.properties: -------------------------------------------------------------------------------- 1 | ## This file must *NOT* be checked into Version Control Systems, 2 | # as it contains information specific to your local configuration. 3 | # 4 | # Location of the SDK. This is only used by Gradle. 5 | # For customization when using a Version Control System, please read the 6 | # header note. 7 | #Fri Sep 20 00:09:57 EET 2019 8 | sdk.dir=D\:\\AndroidSDK 9 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_2_0_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/libraries/Gradle__com_android_support_support_annotations_28_0_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/libraries/Gradle__com_android_support_constraint_constraint_layout_solver_1_1_3_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/src/test/java/gad/example/dell/androidflask/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package gad.example.dell.androidflask; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/libraries/Gradle__com_android_support_constraint_constraint_layout_1_1_3_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/libraries/Gradle__com_squareup_okio_okio_1_9_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/libraries/Gradle__android_arch_core_common_1_0_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/libraries/Gradle__com_squareup_okhttp3_okhttp_3_4_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/libraries/Gradle__android_arch_lifecycle_common_1_0_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | 5 | repositories { 6 | google() 7 | jcenter() 8 | } 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:3.4.2' 11 | 12 | 13 | // NOTE: Do not place your application dependencies here; they belong 14 | // in the individual module build.gradle files 15 | } 16 | } 17 | 18 | allprojects { 19 | repositories { 20 | google() 21 | jcenter() 22 | } 23 | } 24 | 25 | task clean(type: Delete) { 26 | delete rootProject.buildDir 27 | } 28 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 16 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/libraries/Gradle__android_arch_lifecycle_runtime_1_0_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/libraries/Gradle__com_android_support_test_monitor_1_0_2_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/libraries/Gradle__com_android_support_test_runner_1_0_2_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/libraries/Gradle__com_android_support_support_v4_26_1_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/libraries/Gradle__com_android_support_appcompat_v7_26_1_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/libraries/Gradle__junit_junit_4_12_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/libraries/Gradle__com_android_support_support_compat_26_1_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/libraries/Gradle__com_android_support_support_core_ui_26_1_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/libraries/Gradle__com_android_support_support_fragment_26_1_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/libraries/Gradle__com_android_support_support_core_utils_26_1_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/libraries/Gradle__com_android_support_support_media_compat_26_1_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/libraries/Gradle__net_sf_kxml_kxml2_2_3_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/libraries/Gradle__com_android_support_support_vector_drawable_26_1_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/libraries/Gradle__com_android_support_test_espresso_espresso_core_3_0_2_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/libraries/Gradle__com_android_support_animated_vector_drawable_26_1_0_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Part 2/FlaskServer/flask_server.py: -------------------------------------------------------------------------------- 1 | import flask 2 | import werkzeug 3 | import keras.models 4 | import numpy 5 | import scipy.misc 6 | 7 | app = flask.Flask(__name__) 8 | 9 | @app.route('/', methods = ['GET', 'POST']) 10 | def handle_request(): 11 | imagefile = flask.request.files['image0'] 12 | filename = werkzeug.utils.secure_filename(imagefile.filename) 13 | print("\nReceived image File name : " + imagefile.filename) 14 | imagefile.save(filename) 15 | 16 | img = scipy.misc.imread(filename, mode="L") 17 | img = img.reshape(784) 18 | loaded_model = keras.models.load_model('model.h5') 19 | predicted_label = loaded_model.predict_classes(numpy.array([img]))[0] 20 | print(predicted_label) 21 | 22 | return str(predicted_label) 23 | 24 | app.run(host="0.0.0.0", port=5000, debug=True) 25 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | # paypal: http://paypal.me/ahmedfgad # Replace with a single Patreon username 5 | open_collective: pygad 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: ['https://donate.stripe.com/eVa5kO866elKgM0144', 'http://paypal.me/ahmedfgad'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/libraries/Gradle__javax_inject_javax_inject_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/libraries/Gradle__com_android_support_test_espresso_espresso_idling_resource_3_0_2_aar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/libraries/Gradle__com_squareup_javawriter_2_1_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 21 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/libraries/Gradle__org_hamcrest_hamcrest_library_1_3_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /Part 1/FlaskServer/flask_server.py: -------------------------------------------------------------------------------- 1 | import flask 2 | import werkzeug 3 | import time 4 | 5 | app = flask.Flask(__name__) 6 | 7 | @app.route('/', methods = ['GET', 'POST']) 8 | def handle_request(): 9 | files_ids = list(flask.request.files) 10 | print("\nNumber of Received Images : ", len(files_ids)) 11 | image_num = 1 12 | for file_id in files_ids: 13 | print("\nSaving Image ", str(image_num), "/", len(files_ids)) 14 | imagefile = flask.request.files[file_id] 15 | filename = werkzeug.utils.secure_filename(imagefile.filename) 16 | print("Image Filename : " + imagefile.filename) 17 | timestr = time.strftime("%Y%m%d-%H%M%S") 18 | imagefile.save(timestr+'_'+filename) 19 | image_num = image_num + 1 20 | print("\n") 21 | return "Image(s) Uploaded Successfully. Come Back Soon." 22 | 23 | app.run(host="0.0.0.0", port=5000, debug=True) -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/libraries/Gradle__org_hamcrest_hamcrest_integration_1_3_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/src/androidTest/java/gad/example/dell/androidflask/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package gad.example.dell.androidflask; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.example.dell.androidflask", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /License.md: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Copyright (c) [2020] [**Ahmed Fawzy Mohamed Gad**] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 28 5 | defaultConfig { 6 | applicationId "gad.heartbeat.androidflask.easyupload" 7 | minSdkVersion 19 8 | targetSdkVersion 28 9 | versionCode 1 10 | versionName "0.1" 11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | implementation 'com.android.support:support-annotations:28.0.0' 23 | implementation fileTree(dir: 'libs', include: ['*.jar']) 24 | implementation 'com.android.support:appcompat-v7:26.1.0' 25 | implementation 'com.android.support.constraint:constraint-layout:1.1.3' 26 | testImplementation 'junit:junit:4.12' 27 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 28 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 29 | implementation 'com.squareup.okhttp3:okhttp:3.4.1' 30 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AndroidFlask 2 | 3 | ## Image Upload from Android to a Python-Based Flask Server 4 | 5 | Documentation: https://heartbeat.comet.ml/uploading-images-from-android-to-a-python-based-flask-server-691e4092a95e 6 | 7 | The repository consists of 2 main folders: 8 | 1. **AndroidClient**: Represents the Android Studio project which builds an Android app working as a client. 9 | 2. **FlaskServer**: The Python-Based server using Flask. 10 | 11 | To use this project, do the following: 12 | * Open the **Android Studio** project and run it to create the APK and run the app. 13 | * After that, run the **Flask** app Python file. It is enough to run it in the console. 14 | * After the server is up and running, then go back to the Android app. Edit the EditText boxe of the **IPv4 address** to reflect the current IPv4 address of the server. 15 | * If the **port number** used in the project which is **5000** is used by another app in your machine, you need to change the port number in both the client and server. 16 | * Select an image file to be uploaded to the server by clikcing on the **Select Image** button. 17 | * Click on the **Connect to Server** button to establish a connection with the server and upload the selected image. 18 | -------------------------------------------------------------------------------- /Part 2/MLP_MNIST_Keras.py: -------------------------------------------------------------------------------- 1 | import keras.datasets.mnist 2 | import keras.models 3 | import keras.layers 4 | import keras.optimizers 5 | import numpy 6 | 7 | batch_size = 128 8 | num_classes = 10 9 | epochs = 20 10 | 11 | # the data, split between train and test sets 12 | (x_train, y_train), (x_test, y_test) = keras.datasets.mnist.load_data() 13 | print(x_train.shape) # (60000, 28, 28) 14 | print(y_train.shape) # (60000,) 15 | 16 | print(x_test.shape) # (10000, 28, 28) 17 | print(y_test.shape) # (10000,) 18 | 19 | x_train = x_train.reshape(60000, 784) 20 | x_test = x_test.reshape(10000, 784) 21 | x_train = x_train.astype('float32') / 255 22 | x_test = x_test.astype('float32') / 255 23 | 24 | y_train = keras.utils.to_categorical(y_train, num_classes) # (60000, 10) 25 | y_test = keras.utils.to_categorical(y_test, num_classes) # (10000, 10) 26 | 27 | model = keras.models.Sequential() 28 | model.add(keras.layers.Dense(512, activation='relu', input_shape=(784,))) 29 | model.add(keras.layers.Dropout(0.2)) 30 | model.add(keras.layers.Dense(512, activation='relu')) 31 | model.add(keras.layers.Dropout(0.2)) 32 | model.add(keras.layers.Dense(num_classes, activation='softmax')) 33 | 34 | model.summary() 35 | 36 | model.compile(loss='categorical_crossentropy', 37 | optimizer=keras.optimizers.RMSprop(), 38 | metrics=['accuracy']) 39 | 40 | history = model.fit(x_train, y_train, 41 | batch_size=batch_size, 42 | epochs=epochs, 43 | verbose=1, 44 | validation_data=(x_test, y_test)) 45 | 46 | score = model.evaluate(x_test, y_test, verbose=0) 47 | print('Test loss:', score[0]) 48 | print('Test accuracy:', score[1]) 49 | 50 | model.save("model.h5") 51 | 52 | loaded_model = keras.models.load_model('model.h5') 53 | predicted_label = loaded_model.predict_classes(numpy.array([x_test[0, :]]))[0] 54 | print(predicted_label) 55 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/app/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 37 | 38 | 39 | 40 | 41 | 42 | 44 | -------------------------------------------------------------------------------- /Part 1/AndroidClient/.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | xmlns:android 14 | 15 | ^$ 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | xmlns:.* 25 | 26 | ^$ 27 | 28 | 29 | BY_NAME 30 | 31 |
32 |
33 | 34 | 35 | 36 | .*:id 37 | 38 | http://schemas.android.com/apk/res/android 39 | 40 | 41 | 42 |
43 |
44 | 45 | 46 | 47 | .*:name 48 | 49 | http://schemas.android.com/apk/res/android 50 | 51 | 52 | 53 |
54 |
55 | 56 | 57 | 58 | name 59 | 60 | ^$ 61 | 62 | 63 | 64 |
65 |
66 | 67 | 68 | 69 | style 70 | 71 | ^$ 72 | 73 | 74 | 75 |
76 |
77 | 78 | 79 | 80 | .* 81 | 82 | ^$ 83 | 84 | 85 | BY_NAME 86 | 87 |
88 |
89 | 90 | 91 | 92 | .* 93 | 94 | http://schemas.android.com/apk/res/android 95 | 96 | 97 | ANDROID_ATTRIBUTE_ORDER 98 | 99 |
100 |
101 | 102 | 103 | 104 | .* 105 | 106 | .* 107 | 108 | 109 | BY_NAME 110 | 111 |
112 |
113 |
114 |
115 |
116 |
-------------------------------------------------------------------------------- /Part 1/AndroidClient/app/.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | xmlns:android 14 | 15 | ^$ 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | xmlns:.* 25 | 26 | ^$ 27 | 28 | 29 | BY_NAME 30 | 31 |
32 |
33 | 34 | 35 | 36 | .*:id 37 | 38 | http://schemas.android.com/apk/res/android 39 | 40 | 41 | 42 |
43 |
44 | 45 | 46 | 47 | .*:name 48 | 49 | http://schemas.android.com/apk/res/android 50 | 51 | 52 | 53 |
54 |
55 | 56 | 57 | 58 | name 59 | 60 | ^$ 61 | 62 | 63 | 64 |
65 |
66 | 67 | 68 | 69 | style 70 | 71 | ^$ 72 | 73 | 74 | 75 |
76 |
77 | 78 | 79 | 80 | .* 81 | 82 | ^$ 83 | 84 | 85 | BY_NAME 86 | 87 |
88 |
89 | 90 | 91 | 92 | .* 93 | 94 | http://schemas.android.com/apk/res/android 95 | 96 | 97 | ANDROID_ATTRIBUTE_ORDER 98 | 99 |
100 |
101 | 102 | 103 | 104 | .* 105 | 106 | .* 107 | 108 | 109 | BY_NAME 110 | 111 |
112 |
113 |
114 |
115 |
116 |
-------------------------------------------------------------------------------- /Part 1/AndroidClient/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |