diff --git a/AndroidStudioProjects/.idea/.gitignore b/AndroidStudioProjects/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/AndroidStudioProjects/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/AndroidStudioProjects/.idea/AndroidStudioProjects.iml b/AndroidStudioProjects/.idea/AndroidStudioProjects.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/AndroidStudioProjects/.idea/AndroidStudioProjects.iml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="JAVA_MODULE" version="4"> + <component name="NewModuleRootManager" inherit-compiler-output="true"> + <exclude-output /> + <content url="file://$MODULE_DIR$" /> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + </component> +</module> \ No newline at end of file diff --git a/AndroidStudioProjects/.idea/caches/deviceStreaming.xml b/AndroidStudioProjects/.idea/caches/deviceStreaming.xml new file mode 100644 index 0000000..e05e216 --- /dev/null +++ b/AndroidStudioProjects/.idea/caches/deviceStreaming.xml @@ -0,0 +1,373 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="DeviceStreaming"> + <option name="deviceSelectionList"> + <list> + <PersistentDeviceSelectionData> + <option name="api" value="27" /> + <option name="brand" value="DOCOMO" /> + <option name="codename" value="F01L" /> + <option name="id" value="F01L" /> + <option name="manufacturer" value="FUJITSU" /> + <option name="name" value="F-01L" /> + <option name="screenDensity" value="360" /> + <option name="screenX" value="720" /> + <option name="screenY" value="1280" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="34" /> + <option name="brand" value="OPPO" /> + <option name="codename" value="OP573DL1" /> + <option name="id" value="OP573DL1" /> + <option name="manufacturer" value="OPPO" /> + <option name="name" value="CPH2557" /> + <option name="screenDensity" value="480" /> + <option name="screenX" value="1080" /> + <option name="screenY" value="2400" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="28" /> + <option name="brand" value="DOCOMO" /> + <option name="codename" value="SH-01L" /> + <option name="id" value="SH-01L" /> + <option name="manufacturer" value="SHARP" /> + <option name="name" value="AQUOS sense2 SH-01L" /> + <option name="screenDensity" value="480" /> + <option name="screenX" value="1080" /> + <option name="screenY" value="2160" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="34" /> + <option name="brand" value="Lenovo" /> + <option name="codename" value="TB370FU" /> + <option name="id" value="TB370FU" /> + <option name="manufacturer" value="Lenovo" /> + <option name="name" value="Tab P12" /> + <option name="screenDensity" value="340" /> + <option name="screenX" value="1840" /> + <option name="screenY" value="2944" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="31" /> + <option name="brand" value="samsung" /> + <option name="codename" value="a51" /> + <option name="id" value="a51" /> + <option name="manufacturer" value="Samsung" /> + <option name="name" value="Galaxy A51" /> + <option name="screenDensity" value="420" /> + <option name="screenX" value="1080" /> + <option name="screenY" value="2400" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="34" /> + <option name="brand" value="google" /> + <option name="codename" value="akita" /> + <option name="id" value="akita" /> + <option name="manufacturer" value="Google" /> + <option name="name" value="Pixel 8a" /> + <option name="screenDensity" value="420" /> + <option name="screenX" value="1080" /> + <option name="screenY" value="2400" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="33" /> + <option name="brand" value="samsung" /> + <option name="codename" value="b0q" /> + <option name="id" value="b0q" /> + <option name="manufacturer" value="Samsung" /> + <option name="name" value="Galaxy S22 Ultra" /> + <option name="screenDensity" value="600" /> + <option name="screenX" value="1440" /> + <option name="screenY" value="3088" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="32" /> + <option name="brand" value="google" /> + <option name="codename" value="bluejay" /> + <option name="id" value="bluejay" /> + <option name="manufacturer" value="Google" /> + <option name="name" value="Pixel 6a" /> + <option name="screenDensity" value="420" /> + <option name="screenX" value="1080" /> + <option name="screenY" value="2400" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="34" /> + <option name="brand" value="google" /> + <option name="codename" value="caiman" /> + <option name="id" value="caiman" /> + <option name="manufacturer" value="Google" /> + <option name="name" value="Pixel 9 Pro" /> + <option name="screenDensity" value="360" /> + <option name="screenX" value="960" /> + <option name="screenY" value="2142" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="34" /> + <option name="brand" value="google" /> + <option name="codename" value="comet" /> + <option name="id" value="comet" /> + <option name="manufacturer" value="Google" /> + <option name="name" value="Pixel 9 Pro Fold" /> + <option name="screenDensity" value="390" /> + <option name="screenX" value="2076" /> + <option name="screenY" value="2152" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="29" /> + <option name="brand" value="samsung" /> + <option name="codename" value="crownqlteue" /> + <option name="id" value="crownqlteue" /> + <option name="manufacturer" value="Samsung" /> + <option name="name" value="Galaxy Note9" /> + <option name="screenDensity" value="420" /> + <option name="screenX" value="2220" /> + <option name="screenY" value="1080" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="34" /> + <option name="brand" value="samsung" /> + <option name="codename" value="dm3q" /> + <option name="id" value="dm3q" /> + <option name="manufacturer" value="Samsung" /> + <option name="name" value="Galaxy S23 Ultra" /> + <option name="screenDensity" value="600" /> + <option name="screenX" value="1440" /> + <option name="screenY" value="3088" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="34" /> + <option name="brand" value="samsung" /> + <option name="codename" value="e1q" /> + <option name="id" value="e1q" /> + <option name="manufacturer" value="Samsung" /> + <option name="name" value="Galaxy S24" /> + <option name="screenDensity" value="480" /> + <option name="screenX" value="1080" /> + <option name="screenY" value="2340" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="34" /> + <option name="brand" value="samsung" /> + <option name="codename" value="e3q" /> + <option name="id" value="e3q" /> + <option name="manufacturer" value="Samsung" /> + <option name="name" value="Galaxy S24 Ultra" /> + <option name="screenDensity" value="450" /> + <option name="screenX" value="1440" /> + <option name="screenY" value="3120" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="33" /> + <option name="brand" value="google" /> + <option name="codename" value="eos" /> + <option name="id" value="eos" /> + <option name="manufacturer" value="Google" /> + <option name="name" value="Eos" /> + <option name="screenDensity" value="320" /> + <option name="screenX" value="384" /> + <option name="screenY" value="384" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="33" /> + <option name="brand" value="google" /> + <option name="codename" value="felix" /> + <option name="id" value="felix" /> + <option name="manufacturer" value="Google" /> + <option name="name" value="Pixel Fold" /> + <option name="screenDensity" value="420" /> + <option name="screenX" value="2208" /> + <option name="screenY" value="1840" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="34" /> + <option name="brand" value="google" /> + <option name="codename" value="felix" /> + <option name="id" value="felix" /> + <option name="manufacturer" value="Google" /> + <option name="name" value="Pixel Fold" /> + <option name="screenDensity" value="420" /> + <option name="screenX" value="2208" /> + <option name="screenY" value="1840" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="33" /> + <option name="brand" value="google" /> + <option name="codename" value="felix_camera" /> + <option name="id" value="felix_camera" /> + <option name="manufacturer" value="Google" /> + <option name="name" value="Pixel Fold (Camera-enabled)" /> + <option name="screenDensity" value="420" /> + <option name="screenX" value="2208" /> + <option name="screenY" value="1840" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="34" /> + <option name="brand" value="motorola" /> + <option name="codename" value="fogona" /> + <option name="id" value="fogona" /> + <option name="manufacturer" value="Motorola" /> + <option name="name" value="moto g play - 2024" /> + <option name="screenDensity" value="280" /> + <option name="screenX" value="720" /> + <option name="screenY" value="1600" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="33" /> + <option name="brand" value="samsung" /> + <option name="codename" value="gts8uwifi" /> + <option name="id" value="gts8uwifi" /> + <option name="manufacturer" value="Samsung" /> + <option name="name" value="Galaxy Tab S8 Ultra" /> + <option name="screenDensity" value="320" /> + <option name="screenX" value="1848" /> + <option name="screenY" value="2960" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="34" /> + <option name="brand" value="google" /> + <option name="codename" value="husky" /> + <option name="id" value="husky" /> + <option name="manufacturer" value="Google" /> + <option name="name" value="Pixel 8 Pro" /> + <option name="screenDensity" value="390" /> + <option name="screenX" value="1008" /> + <option name="screenY" value="2244" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="30" /> + <option name="brand" value="motorola" /> + <option name="codename" value="java" /> + <option name="id" value="java" /> + <option name="manufacturer" value="Motorola" /> + <option name="name" value="G20" /> + <option name="screenDensity" value="280" /> + <option name="screenX" value="720" /> + <option name="screenY" value="1600" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="34" /> + <option name="brand" value="google" /> + <option name="codename" value="komodo" /> + <option name="id" value="komodo" /> + <option name="manufacturer" value="Google" /> + <option name="name" value="Pixel 9 Pro XL" /> + <option name="screenDensity" value="360" /> + <option name="screenX" value="1008" /> + <option name="screenY" value="2244" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="33" /> + <option name="brand" value="google" /> + <option name="codename" value="lynx" /> + <option name="id" value="lynx" /> + <option name="manufacturer" value="Google" /> + <option name="name" value="Pixel 7a" /> + <option name="screenDensity" value="420" /> + <option name="screenX" value="1080" /> + <option name="screenY" value="2400" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="31" /> + <option name="brand" value="google" /> + <option name="codename" value="oriole" /> + <option name="id" value="oriole" /> + <option name="manufacturer" value="Google" /> + <option name="name" value="Pixel 6" /> + <option name="screenDensity" value="420" /> + <option name="screenX" value="1080" /> + <option name="screenY" value="2400" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="33" /> + <option name="brand" value="google" /> + <option name="codename" value="panther" /> + <option name="id" value="panther" /> + <option name="manufacturer" value="Google" /> + <option name="name" value="Pixel 7" /> + <option name="screenDensity" value="420" /> + <option name="screenX" value="1080" /> + <option name="screenY" value="2400" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="34" /> + <option name="brand" value="samsung" /> + <option name="codename" value="q5q" /> + <option name="id" value="q5q" /> + <option name="manufacturer" value="Samsung" /> + <option name="name" value="Galaxy Z Fold5" /> + <option name="screenDensity" value="420" /> + <option name="screenX" value="1812" /> + <option name="screenY" value="2176" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="34" /> + <option name="brand" value="samsung" /> + <option name="codename" value="q6q" /> + <option name="id" value="q6q" /> + <option name="manufacturer" value="Samsung" /> + <option name="name" value="Galaxy Z Fold6" /> + <option name="screenDensity" value="420" /> + <option name="screenX" value="1856" /> + <option name="screenY" value="2160" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="30" /> + <option name="brand" value="google" /> + <option name="codename" value="r11" /> + <option name="id" value="r11" /> + <option name="manufacturer" value="Google" /> + <option name="name" value="Pixel Watch" /> + <option name="screenDensity" value="320" /> + <option name="screenX" value="384" /> + <option name="screenY" value="384" /> + <option name="type" value="WEAR_OS" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="30" /> + <option name="brand" value="google" /> + <option name="codename" value="redfin" /> + <option name="id" value="redfin" /> + <option name="manufacturer" value="Google" /> + <option name="name" value="Pixel 5" /> + <option name="screenDensity" value="440" /> + <option name="screenX" value="1080" /> + <option name="screenY" value="2340" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="34" /> + <option name="brand" value="google" /> + <option name="codename" value="shiba" /> + <option name="id" value="shiba" /> + <option name="manufacturer" value="Google" /> + <option name="name" value="Pixel 8" /> + <option name="screenDensity" value="420" /> + <option name="screenX" value="1080" /> + <option name="screenY" value="2400" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="33" /> + <option name="brand" value="google" /> + <option name="codename" value="tangorpro" /> + <option name="id" value="tangorpro" /> + <option name="manufacturer" value="Google" /> + <option name="name" value="Pixel Tablet" /> + <option name="screenDensity" value="320" /> + <option name="screenX" value="1600" /> + <option name="screenY" value="2560" /> + </PersistentDeviceSelectionData> + <PersistentDeviceSelectionData> + <option name="api" value="34" /> + <option name="brand" value="google" /> + <option name="codename" value="tokay" /> + <option name="id" value="tokay" /> + <option name="manufacturer" value="Google" /> + <option name="name" value="Pixel 9" /> + <option name="screenDensity" value="420" /> + <option name="screenX" value="1080" /> + <option name="screenY" value="2424" /> + </PersistentDeviceSelectionData> + </list> + </option> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/.idea/misc.xml b/AndroidStudioProjects/.idea/misc.xml new file mode 100644 index 0000000..639900d --- /dev/null +++ b/AndroidStudioProjects/.idea/misc.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectRootManager"> + <output url="file://$PROJECT_DIR$/out" /> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/.idea/modules.xml b/AndroidStudioProjects/.idea/modules.xml new file mode 100644 index 0000000..00ee4ad --- /dev/null +++ b/AndroidStudioProjects/.idea/modules.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectModuleManager"> + <modules> + <module fileurl="file://$PROJECT_DIR$/.idea/AndroidStudioProjects.iml" filepath="$PROJECT_DIR$/.idea/AndroidStudioProjects.iml" /> + </modules> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/Reticule2/.gitignore b/AndroidStudioProjects/Reticule2/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/AndroidStudioProjects/Reticule2/.gitignore @@ -0,0 +1,15 @@ +*.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 +local.properties diff --git a/AndroidStudioProjects/Reticule2/.idea/.gitignore b/AndroidStudioProjects/Reticule2/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/AndroidStudioProjects/Reticule2/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/AndroidStudioProjects/Reticule2/.idea/compiler.xml b/AndroidStudioProjects/Reticule2/.idea/compiler.xml new file mode 100644 index 0000000..b589d56 --- /dev/null +++ b/AndroidStudioProjects/Reticule2/.idea/compiler.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="CompilerConfiguration"> + <bytecodeTargetLevel target="17" /> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/Reticule2/.idea/deploymentTargetSelector.xml b/AndroidStudioProjects/Reticule2/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000..b268ef3 --- /dev/null +++ b/AndroidStudioProjects/Reticule2/.idea/deploymentTargetSelector.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="deploymentTargetSelector"> + <selectionStates> + <SelectionState runConfigName="app"> + <option name="selectionMode" value="DROPDOWN" /> + </SelectionState> + </selectionStates> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/Reticule2/.idea/gradle.xml b/AndroidStudioProjects/Reticule2/.idea/gradle.xml new file mode 100644 index 0000000..0897082 --- /dev/null +++ b/AndroidStudioProjects/Reticule2/.idea/gradle.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="GradleMigrationSettings" migrationVersion="1" /> + <component name="GradleSettings"> + <option name="linkedExternalProjectsSettings"> + <GradleProjectSettings> + <option name="externalProjectPath" value="$PROJECT_DIR$" /> + <option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" /> + <option name="modules"> + <set> + <option value="$PROJECT_DIR$" /> + <option value="$PROJECT_DIR$/app" /> + </set> + </option> + <option name="resolveExternalAnnotations" value="false" /> + </GradleProjectSettings> + </option> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/Reticule2/.idea/migrations.xml b/AndroidStudioProjects/Reticule2/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/AndroidStudioProjects/Reticule2/.idea/migrations.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectMigrations"> + <option name="MigrateToGradleLocalJavaHome"> + <set> + <option value="$PROJECT_DIR$" /> + </set> + </option> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/Reticule2/.idea/misc.xml b/AndroidStudioProjects/Reticule2/.idea/misc.xml new file mode 100644 index 0000000..8978d23 --- /dev/null +++ b/AndroidStudioProjects/Reticule2/.idea/misc.xml @@ -0,0 +1,9 @@ +<project version="4"> + <component name="ExternalStorageConfigurationManager" enabled="true" /> + <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK"> + <output url="file://$PROJECT_DIR$/build/classes" /> + </component> + <component name="ProjectType"> + <option name="id" value="Android" /> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/Reticule2/app/.gitignore b/AndroidStudioProjects/Reticule2/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/AndroidStudioProjects/Reticule2/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/AndroidStudioProjects/Reticule2/app/build.gradle.kts b/AndroidStudioProjects/Reticule2/app/build.gradle.kts new file mode 100644 index 0000000..9a95624 --- /dev/null +++ b/AndroidStudioProjects/Reticule2/app/build.gradle.kts @@ -0,0 +1,41 @@ +plugins { + alias(libs.plugins.android.application) +} + +android { + namespace = "com.example.reticule2" + compileSdk = 34 + + defaultConfig { + applicationId = "com.example.reticule2" + minSdk = 19 + targetSdk = 34 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } +} + +dependencies { + + + implementation(libs.material) + testImplementation(libs.junit) + androidTestImplementation(libs.ext.junit) + androidTestImplementation(libs.espresso.core) +} \ No newline at end of file diff --git a/AndroidStudioProjects/Reticule2/app/proguard-rules.pro b/AndroidStudioProjects/Reticule2/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/AndroidStudioProjects/Reticule2/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/AndroidStudioProjects/Reticule2/app/src/androidTest/java/com/example/reticule2/ExampleInstrumentedTest.java b/AndroidStudioProjects/Reticule2/app/src/androidTest/java/com/example/reticule2/ExampleInstrumentedTest.java new file mode 100644 index 0000000..fee41de --- /dev/null +++ b/AndroidStudioProjects/Reticule2/app/src/androidTest/java/com/example/reticule2/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.reticule2; + +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.reticule2", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/Reticule2/app/src/main/AndroidManifest.xml b/AndroidStudioProjects/Reticule2/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..f4e7f88 --- /dev/null +++ b/AndroidStudioProjects/Reticule2/app/src/main/AndroidManifest.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools"> + + <application + android:allowBackup="true" + android:dataExtractionRules="@xml/data_extraction_rules" + android:fullBackupContent="@xml/backup_rules" + android:icon="@mipmap/ic_launcher" + android:label="@string/app_name" + android:roundIcon="@mipmap/ic_launcher_round" + android:supportsRtl="true" + android:theme="@style/Theme.Reticule2" + tools:targetApi="31"> + <activity + android:name=".MainActivity" + android:exported="true"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + </application> + +</manifest> \ No newline at end of file diff --git a/AndroidStudioProjects/Reticule2/app/src/main/java/com/example/reticule2/Fenetre.java b/AndroidStudioProjects/Reticule2/app/src/main/java/com/example/reticule2/Fenetre.java new file mode 100644 index 0000000..09ace1e --- /dev/null +++ b/AndroidStudioProjects/Reticule2/app/src/main/java/com/example/reticule2/Fenetre.java @@ -0,0 +1,38 @@ +package com.example.reticule2; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Paint; +import android.util.AttributeSet; +import android.view.View; + +public class Fenetre extends View { + + protected Reticule controleur; + Paint turpentineorange = new Paint(); + + @SuppressLint("ClickableViewAccessibility") + public Fenetre(Context context, AttributeSet attrs) { + super(context, attrs); + this.turpentineorange.setARGB(255,255,95,21); + this.turpentineorange.setStyle(Paint.Style.STROKE); + this.turpentineorange.setStrokeWidth(10); + this.controleur = new Reticule(); + this.controleur.setVue(this); + this.setOnTouchListener(this.controleur); + } + + @Override + protected void onDraw(Canvas canvas) { + super.onDraw(canvas); + if (this.controleur.getReticuleX()==-1 || this.controleur.getReticuleY()==-1){ + return; + } + canvas.drawCircle(this.controleur.getReticuleX(),this.controleur.getReticuleY(),50,turpentineorange); + canvas.drawLine(this.controleur.getReticuleX(),this.controleur.getReticuleY(),this.controleur.getReticuleX()-80,this.controleur.getReticuleY(),turpentineorange); + canvas.drawLine(this.controleur.getReticuleX(),this.controleur.getReticuleY(),this.controleur.getReticuleX()+80,this.controleur.getReticuleY(),turpentineorange); + canvas.drawLine(this.controleur.getReticuleX(),this.controleur.getReticuleY(),this.controleur.getReticuleX(),this.controleur.getReticuleY()-80,turpentineorange); + canvas.drawLine(this.controleur.getReticuleX(),this.controleur.getReticuleY(),this.controleur.getReticuleX(),this.controleur.getReticuleY()+80,turpentineorange); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/Reticule2/app/src/main/java/com/example/reticule2/MainActivity.java b/AndroidStudioProjects/Reticule2/app/src/main/java/com/example/reticule2/MainActivity.java new file mode 100644 index 0000000..5561b47 --- /dev/null +++ b/AndroidStudioProjects/Reticule2/app/src/main/java/com/example/reticule2/MainActivity.java @@ -0,0 +1,31 @@ +package com.example.reticule2; + +import android.app.Activity; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +public class MainActivity extends Activity { + private Fenetre vue; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + this.vue = (Fenetre) findViewById(R.id.vuee); + } + + @Override + public void onSaveInstanceState(@NonNull Bundle outState) { + super.onSaveInstanceState(outState); + outState.putFloat("x", this.vue.controleur.getReticuleX()); + outState.putFloat("y", this.vue.controleur.getReticuleY()); + } + + @Override + public void onRestoreInstanceState(@NonNull Bundle savedInstanceState){ + super.onRestoreInstanceState(savedInstanceState); + this.vue.controleur.setReticuleX(savedInstanceState.getFloat("x")); + this.vue.controleur.setReticuleY(savedInstanceState.getFloat("y")); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/Reticule2/app/src/main/java/com/example/reticule2/Reticule.java b/AndroidStudioProjects/Reticule2/app/src/main/java/com/example/reticule2/Reticule.java new file mode 100644 index 0000000..0cc8210 --- /dev/null +++ b/AndroidStudioProjects/Reticule2/app/src/main/java/com/example/reticule2/Reticule.java @@ -0,0 +1,57 @@ +package com.example.reticule2; + +import android.annotation.SuppressLint; +import android.view.MotionEvent; +import android.view.View; + +public class Reticule implements View.OnTouchListener { + + private Fenetre mavue; + private float x=-1; + private float y=-1; + + public Reticule() { + } + + public void setVue(Fenetre vue){ + this.mavue = vue; + } + + public float getReticuleX(){ + return this.x; + } + + public float getReticuleY(){ + return this.y; + } + + public void setReticuleX(float X){ + this.x = X; + } + + public void setReticuleY(float Y){ + this.y = Y; + } + + @SuppressLint("ClickableViewAccessibility") + @Override + public boolean onTouch(View v, MotionEvent e) { + int action = e.getActionMasked(); + if (action==MotionEvent.ACTION_DOWN){ + this.x=e.getX(0); + this.y=e.getY(0); + mavue.invalidate(); + } + if (action==MotionEvent.ACTION_UP){ + this.x=-1; + this.y=-1; + mavue.invalidate(); + } + if (action==MotionEvent.ACTION_MOVE){ + this.x=e.getX(0); + this.y=e.getY(0); + mavue.invalidate(); + } + return true; + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/Reticule2/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/AndroidStudioProjects/Reticule2/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/AndroidStudioProjects/Reticule2/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:aapt="http://schemas.android.com/aapt" + android:width="108dp" + android:height="108dp" + android:viewportWidth="108" + android:viewportHeight="108"> + <path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z"> + <aapt:attr name="android:fillColor"> + <gradient + android:endX="85.84757" + android:endY="92.4963" + android:startX="42.9492" + android:startY="49.59793" + android:type="linear"> + <item + android:color="#44000000" + android:offset="0.0" /> + <item + android:color="#00000000" + android:offset="1.0" /> + </gradient> + </aapt:attr> + </path> + <path + android:fillColor="#FFFFFF" + android:fillType="nonZero" + android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z" + android:strokeWidth="1" + android:strokeColor="#00000000" /> +</vector> \ No newline at end of file diff --git a/AndroidStudioProjects/Reticule2/app/src/main/res/drawable/ic_launcher_background.xml b/AndroidStudioProjects/Reticule2/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/AndroidStudioProjects/Reticule2/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="108dp" + android:height="108dp" + android:viewportWidth="108" + android:viewportHeight="108"> + <path + android:fillColor="#3DDC84" + android:pathData="M0,0h108v108h-108z" /> + <path + android:fillColor="#00000000" + android:pathData="M9,0L9,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,0L19,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M29,0L29,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M39,0L39,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M49,0L49,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M59,0L59,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M69,0L69,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M79,0L79,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M89,0L89,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M99,0L99,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,9L108,9" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,19L108,19" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,29L108,29" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,39L108,39" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,49L108,49" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,59L108,59" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,69L108,69" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,79L108,79" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,89L108,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,99L108,99" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,29L89,29" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,39L89,39" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,49L89,49" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,59L89,59" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,69L89,69" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,79L89,79" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M29,19L29,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M39,19L39,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M49,19L49,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M59,19L59,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M69,19L69,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M79,19L79,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> +</vector> diff --git a/AndroidStudioProjects/Reticule2/app/src/main/res/layout/activity_main.xml b/AndroidStudioProjects/Reticule2/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..251d61f --- /dev/null +++ b/AndroidStudioProjects/Reticule2/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout 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" + tools:context=".MainActivity"> + + <com.example.reticule2.Fenetre + android:layout_height="match_parent" + android:layout_width="match_parent" + android:id="@+id/vuee"> + </com.example.reticule2.Fenetre> + +</RelativeLayout> \ No newline at end of file diff --git a/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/ic_launcher_background" /> + <foreground android:drawable="@drawable/ic_launcher_foreground" /> + <monochrome android:drawable="@drawable/ic_launcher_foreground" /> +</adaptive-icon> \ No newline at end of file diff --git a/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/ic_launcher_background" /> + <foreground android:drawable="@drawable/ic_launcher_foreground" /> + <monochrome android:drawable="@drawable/ic_launcher_foreground" /> +</adaptive-icon> \ No newline at end of file diff --git a/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/AndroidStudioProjects/Reticule2/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/Reticule2/app/src/main/res/values-night/themes.xml b/AndroidStudioProjects/Reticule2/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..24fb115 --- /dev/null +++ b/AndroidStudioProjects/Reticule2/app/src/main/res/values-night/themes.xml @@ -0,0 +1,7 @@ +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Base application theme. --> + <style name="Base.Theme.Reticule2" parent="Theme.Material3.DayNight.NoActionBar"> + <!-- Customize your dark theme here. --> + <!-- <item name="colorPrimary">@color/my_dark_primary</item> --> + </style> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/Reticule2/app/src/main/res/values/colors.xml b/AndroidStudioProjects/Reticule2/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..c8524cd --- /dev/null +++ b/AndroidStudioProjects/Reticule2/app/src/main/res/values/colors.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <color name="black">#FF000000</color> + <color name="white">#FFFFFFFF</color> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/Reticule2/app/src/main/res/values/strings.xml b/AndroidStudioProjects/Reticule2/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..43f28f5 --- /dev/null +++ b/AndroidStudioProjects/Reticule2/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ +<resources> + <string name="app_name">Reticule2</string> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/Reticule2/app/src/main/res/values/themes.xml b/AndroidStudioProjects/Reticule2/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..f532c1b --- /dev/null +++ b/AndroidStudioProjects/Reticule2/app/src/main/res/values/themes.xml @@ -0,0 +1,9 @@ +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Base application theme. --> + <style name="Base.Theme.Reticule2" parent="Theme.Material3.DayNight.NoActionBar"> + <!-- Customize your light theme here. --> + <!-- <item name="colorPrimary">@color/my_light_primary</item> --> + </style> + + <style name="Theme.Reticule2" parent="Base.Theme.Reticule2" /> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/Reticule2/app/src/main/res/xml/backup_rules.xml b/AndroidStudioProjects/Reticule2/app/src/main/res/xml/backup_rules.xml new file mode 100644 index 0000000..fa0f996 --- /dev/null +++ b/AndroidStudioProjects/Reticule2/app/src/main/res/xml/backup_rules.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + Sample backup rules file; uncomment and customize as necessary. + See https://developer.android.com/guide/topics/data/autobackup + for details. + Note: This file is ignored for devices older that API 31 + See https://developer.android.com/about/versions/12/backup-restore +--> +<full-backup-content> + <!-- + <include domain="sharedpref" path="."/> + <exclude domain="sharedpref" path="device.xml"/> +--> +</full-backup-content> \ No newline at end of file diff --git a/AndroidStudioProjects/Reticule2/app/src/main/res/xml/data_extraction_rules.xml b/AndroidStudioProjects/Reticule2/app/src/main/res/xml/data_extraction_rules.xml new file mode 100644 index 0000000..9ee9997 --- /dev/null +++ b/AndroidStudioProjects/Reticule2/app/src/main/res/xml/data_extraction_rules.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + Sample data extraction rules file; uncomment and customize as necessary. + See https://developer.android.com/about/versions/12/backup-restore#xml-changes + for details. +--> +<data-extraction-rules> + <cloud-backup> + <!-- TODO: Use <include> and <exclude> to control what is backed up. + <include .../> + <exclude .../> + --> + </cloud-backup> + <!-- + <device-transfer> + <include .../> + <exclude .../> + </device-transfer> + --> +</data-extraction-rules> \ No newline at end of file diff --git a/AndroidStudioProjects/Reticule2/app/src/test/java/com/example/reticule2/ExampleUnitTest.java b/AndroidStudioProjects/Reticule2/app/src/test/java/com/example/reticule2/ExampleUnitTest.java new file mode 100644 index 0000000..e6fa67c --- /dev/null +++ b/AndroidStudioProjects/Reticule2/app/src/test/java/com/example/reticule2/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package com.example.reticule2; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/Reticule2/build.gradle.kts b/AndroidStudioProjects/Reticule2/build.gradle.kts new file mode 100644 index 0000000..3756278 --- /dev/null +++ b/AndroidStudioProjects/Reticule2/build.gradle.kts @@ -0,0 +1,4 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + alias(libs.plugins.android.application) apply false +} \ No newline at end of file diff --git a/AndroidStudioProjects/Reticule2/gradle.properties b/AndroidStudioProjects/Reticule2/gradle.properties new file mode 100644 index 0000000..4387edc --- /dev/null +++ b/AndroidStudioProjects/Reticule2/gradle.properties @@ -0,0 +1,21 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. For more details, visit +# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/AndroidStudioProjects/Reticule2/gradle/libs.versions.toml b/AndroidStudioProjects/Reticule2/gradle/libs.versions.toml new file mode 100644 index 0000000..8bc8938 --- /dev/null +++ b/AndroidStudioProjects/Reticule2/gradle/libs.versions.toml @@ -0,0 +1,22 @@ +[versions] +agp = "8.6.0" +junit = "4.13.2" +junitVersion = "1.2.1" +espressoCore = "3.6.1" +appcompat = "1.7.0" +material = "1.12.0" +activity = "1.10.0" +constraintlayout = "2.2.1" + +[libraries] +junit = { group = "junit", name = "junit", version.ref = "junit" } +ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" } +espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" } +appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } +material = { group = "com.google.android.material", name = "material", version.ref = "material" } +activity = { group = "androidx.activity", name = "activity", version.ref = "activity" } +constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" } + +[plugins] +android-application = { id = "com.android.application", version.ref = "agp" } + diff --git a/AndroidStudioProjects/Reticule2/gradle/wrapper/gradle-wrapper.jar b/AndroidStudioProjects/Reticule2/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/AndroidStudioProjects/Reticule2/gradle/wrapper/gradle-wrapper.jar differ diff --git a/AndroidStudioProjects/Reticule2/gradle/wrapper/gradle-wrapper.properties b/AndroidStudioProjects/Reticule2/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..5fe4c5b --- /dev/null +++ b/AndroidStudioProjects/Reticule2/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Tue Mar 11 11:02:09 CET 2025 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/AndroidStudioProjects/Reticule2/gradlew b/AndroidStudioProjects/Reticule2/gradlew new file mode 100755 index 0000000..4f906e0 --- /dev/null +++ b/AndroidStudioProjects/Reticule2/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/AndroidStudioProjects/Reticule2/gradlew.bat b/AndroidStudioProjects/Reticule2/gradlew.bat new file mode 100644 index 0000000..ac1b06f --- /dev/null +++ b/AndroidStudioProjects/Reticule2/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/AndroidStudioProjects/Reticule2/settings.gradle.kts b/AndroidStudioProjects/Reticule2/settings.gradle.kts new file mode 100644 index 0000000..801bc4e --- /dev/null +++ b/AndroidStudioProjects/Reticule2/settings.gradle.kts @@ -0,0 +1,24 @@ +pluginManagement { + repositories { + google { + content { + includeGroupByRegex("com\\.android.*") + includeGroupByRegex("com\\.google.*") + includeGroupByRegex("androidx.*") + } + } + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} + +rootProject.name = "Reticule2" +include(":app") + \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/.gitignore b/AndroidStudioProjects/TP1/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/AndroidStudioProjects/TP1/.gitignore @@ -0,0 +1,15 @@ +*.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 +local.properties diff --git a/AndroidStudioProjects/TP1/.idea/.gitignore b/AndroidStudioProjects/TP1/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/AndroidStudioProjects/TP1/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/AndroidStudioProjects/TP1/.idea/.name b/AndroidStudioProjects/TP1/.idea/.name new file mode 100644 index 0000000..736cfcc --- /dev/null +++ b/AndroidStudioProjects/TP1/.idea/.name @@ -0,0 +1 @@ +ex1RelativeLayout \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/.idea/compiler.xml b/AndroidStudioProjects/TP1/.idea/compiler.xml new file mode 100644 index 0000000..b589d56 --- /dev/null +++ b/AndroidStudioProjects/TP1/.idea/compiler.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="CompilerConfiguration"> + <bytecodeTargetLevel target="17" /> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/.idea/gradle.xml b/AndroidStudioProjects/TP1/.idea/gradle.xml new file mode 100644 index 0000000..a9f4e52 --- /dev/null +++ b/AndroidStudioProjects/TP1/.idea/gradle.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <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> + </GradleProjectSettings> + </option> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/.idea/misc.xml b/AndroidStudioProjects/TP1/.idea/misc.xml new file mode 100644 index 0000000..0ad17cb --- /dev/null +++ b/AndroidStudioProjects/TP1/.idea/misc.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ExternalStorageConfigurationManager" enabled="true" /> + <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK"> + <output url="file://$PROJECT_DIR$/build/classes" /> + </component> + <component name="ProjectType"> + <option name="id" value="Android" /> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/.gitignore b/AndroidStudioProjects/TP1/ex1LinearLayout/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/.gitignore @@ -0,0 +1,15 @@ +*.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 +local.properties diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/.idea/.gitignore b/AndroidStudioProjects/TP1/ex1LinearLayout/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/.idea/.name b/AndroidStudioProjects/TP1/ex1LinearLayout/.idea/.name new file mode 100644 index 0000000..98f8b6b --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/.idea/.name @@ -0,0 +1 @@ +ex1 \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/.idea/compiler.xml b/AndroidStudioProjects/TP1/ex1LinearLayout/.idea/compiler.xml new file mode 100644 index 0000000..b589d56 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/.idea/compiler.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="CompilerConfiguration"> + <bytecodeTargetLevel target="17" /> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/.idea/deploymentTargetSelector.xml b/AndroidStudioProjects/TP1/ex1LinearLayout/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000..b268ef3 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/.idea/deploymentTargetSelector.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="deploymentTargetSelector"> + <selectionStates> + <SelectionState runConfigName="app"> + <option name="selectionMode" value="DROPDOWN" /> + </SelectionState> + </selectionStates> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/.idea/gradle.xml b/AndroidStudioProjects/TP1/ex1LinearLayout/.idea/gradle.xml new file mode 100644 index 0000000..0897082 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/.idea/gradle.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="GradleMigrationSettings" migrationVersion="1" /> + <component name="GradleSettings"> + <option name="linkedExternalProjectsSettings"> + <GradleProjectSettings> + <option name="externalProjectPath" value="$PROJECT_DIR$" /> + <option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" /> + <option name="modules"> + <set> + <option value="$PROJECT_DIR$" /> + <option value="$PROJECT_DIR$/app" /> + </set> + </option> + <option name="resolveExternalAnnotations" value="false" /> + </GradleProjectSettings> + </option> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/.idea/migrations.xml b/AndroidStudioProjects/TP1/ex1LinearLayout/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/.idea/migrations.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectMigrations"> + <option name="MigrateToGradleLocalJavaHome"> + <set> + <option value="$PROJECT_DIR$" /> + </set> + </option> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/.idea/misc.xml b/AndroidStudioProjects/TP1/ex1LinearLayout/.idea/misc.xml new file mode 100644 index 0000000..0ad17cb --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/.idea/misc.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ExternalStorageConfigurationManager" enabled="true" /> + <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK"> + <output url="file://$PROJECT_DIR$/build/classes" /> + </component> + <component name="ProjectType"> + <option name="id" value="Android" /> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/app/.gitignore b/AndroidStudioProjects/TP1/ex1LinearLayout/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/app/build.gradle b/AndroidStudioProjects/TP1/ex1LinearLayout/app/build.gradle new file mode 100644 index 0000000..bb35d6a --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/app/build.gradle @@ -0,0 +1,39 @@ +plugins { + id 'com.android.application' +} + +android { + namespace 'com.example.ex1' + compileSdk 33 + + defaultConfig { + applicationId "com.example.ex1" + minSdk 19 + targetSdk 33 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.4.1' + implementation 'com.google.android.material:material:1.5.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.3' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.3' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/app/proguard-rules.pro b/AndroidStudioProjects/TP1/ex1LinearLayout/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/androidTest/java/com/example/ex1/ExampleInstrumentedTest.java b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/androidTest/java/com/example/ex1/ExampleInstrumentedTest.java new file mode 100644 index 0000000..a48b214 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/androidTest/java/com/example/ex1/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.ex1; + +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.ex1", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/AndroidManifest.xml b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..06c67da --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/AndroidManifest.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools"> + + <application + android:allowBackup="true" + android:dataExtractionRules="@xml/data_extraction_rules" + android:fullBackupContent="@xml/backup_rules" + android:icon="@mipmap/ic_launcher" + android:label="@string/app_name" + android:roundIcon="@mipmap/ic_launcher_round" + android:supportsRtl="true" + android:theme="@style/Theme.Ex1" + tools:targetApi="31"> + <activity + android:name=".MainActivity" + android:exported="true"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + </application> + +</manifest> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/java/com/example/ex1/MainActivity.java b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/java/com/example/ex1/MainActivity.java new file mode 100644 index 0000000..8de2c44 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/java/com/example/ex1/MainActivity.java @@ -0,0 +1,14 @@ +package com.example.ex1; + +import androidx.appcompat.app.AppCompatActivity; + +import android.os.Bundle; + +public class MainActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:aapt="http://schemas.android.com/aapt" + android:width="108dp" + android:height="108dp" + android:viewportWidth="108" + android:viewportHeight="108"> + <path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z"> + <aapt:attr name="android:fillColor"> + <gradient + android:endX="85.84757" + android:endY="92.4963" + android:startX="42.9492" + android:startY="49.59793" + android:type="linear"> + <item + android:color="#44000000" + android:offset="0.0" /> + <item + android:color="#00000000" + android:offset="1.0" /> + </gradient> + </aapt:attr> + </path> + <path + android:fillColor="#FFFFFF" + android:fillType="nonZero" + android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z" + android:strokeWidth="1" + android:strokeColor="#00000000" /> +</vector> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/drawable/ic_launcher_background.xml b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="108dp" + android:height="108dp" + android:viewportWidth="108" + android:viewportHeight="108"> + <path + android:fillColor="#3DDC84" + android:pathData="M0,0h108v108h-108z" /> + <path + android:fillColor="#00000000" + android:pathData="M9,0L9,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,0L19,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M29,0L29,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M39,0L39,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M49,0L49,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M59,0L59,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M69,0L69,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M79,0L79,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M89,0L89,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M99,0L99,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,9L108,9" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,19L108,19" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,29L108,29" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,39L108,39" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,49L108,49" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,59L108,59" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,69L108,69" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,79L108,79" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,89L108,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,99L108,99" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,29L89,29" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,39L89,39" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,49L89,49" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,59L89,59" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,69L89,69" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,79L89,79" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M29,19L29,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M39,19L39,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M49,19L49,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M59,19L59,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M69,19L69,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M79,19L79,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> +</vector> diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/layout/activity_main.xml b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..c21c6fc --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,42 @@ +<?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" + tools:context=".MainActivity" + android:orientation="vertical"> + + <EditText + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_weight="1" + android:gravity="top" + android:layout_gravity="top" + android:text="Hello World!" /> + + <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="60dp" + android:layout_gravity="bottom" + tools:context=".MainActivity" + android:orientation="horizontal"> + + <EditText + android:layout_width="0dp" + android:layout_weight="1" + android:layout_height="match_parent" + android:layout_gravity="center_vertical" + android:text="Hello World!" /> + + <Button + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:text="OK" /> + + </LinearLayout> + +</LinearLayout> diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/ic_launcher_background" /> + <foreground android:drawable="@drawable/ic_launcher_foreground" /> + <monochrome android:drawable="@drawable/ic_launcher_foreground" /> +</adaptive-icon> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/ic_launcher_background" /> + <foreground android:drawable="@drawable/ic_launcher_foreground" /> + <monochrome android:drawable="@drawable/ic_launcher_foreground" /> +</adaptive-icon> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/values-night/themes.xml b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..0318875 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/values-night/themes.xml @@ -0,0 +1,7 @@ +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Base application theme. --> + <style name="Base.Theme.Ex1" parent="Theme.Material3.DayNight.NoActionBar"> + <!-- Customize your dark theme here. --> + <!-- <item name="colorPrimary">@color/my_dark_primary</item> --> + </style> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/values/colors.xml b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..c8524cd --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/values/colors.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <color name="black">#FF000000</color> + <color name="white">#FFFFFFFF</color> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/values/strings.xml b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..0054a2b --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ +<resources> + <string name="app_name">ex1</string> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/values/themes.xml b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..1881977 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/values/themes.xml @@ -0,0 +1,9 @@ +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Base application theme. --> + <style name="Base.Theme.Ex1" parent="Theme.Material3.DayNight.NoActionBar"> + <!-- Customize your light theme here. --> + <!-- <item name="colorPrimary">@color/my_light_primary</item> --> + </style> + + <style name="Theme.Ex1" parent="Base.Theme.Ex1" /> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/xml/backup_rules.xml b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/xml/backup_rules.xml new file mode 100644 index 0000000..fa0f996 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/xml/backup_rules.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + Sample backup rules file; uncomment and customize as necessary. + See https://developer.android.com/guide/topics/data/autobackup + for details. + Note: This file is ignored for devices older that API 31 + See https://developer.android.com/about/versions/12/backup-restore +--> +<full-backup-content> + <!-- + <include domain="sharedpref" path="."/> + <exclude domain="sharedpref" path="device.xml"/> +--> +</full-backup-content> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/xml/data_extraction_rules.xml b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/xml/data_extraction_rules.xml new file mode 100644 index 0000000..9ee9997 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/main/res/xml/data_extraction_rules.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + Sample data extraction rules file; uncomment and customize as necessary. + See https://developer.android.com/about/versions/12/backup-restore#xml-changes + for details. +--> +<data-extraction-rules> + <cloud-backup> + <!-- TODO: Use <include> and <exclude> to control what is backed up. + <include .../> + <exclude .../> + --> + </cloud-backup> + <!-- + <device-transfer> + <include .../> + <exclude .../> + </device-transfer> + --> +</data-extraction-rules> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/test/java/com/example/ex1/ExampleUnitTest.java b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/test/java/com/example/ex1/ExampleUnitTest.java new file mode 100644 index 0000000..007c8c1 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/app/src/test/java/com/example/ex1/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package com.example.ex1; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/build.gradle b/AndroidStudioProjects/TP1/ex1LinearLayout/build.gradle new file mode 100644 index 0000000..a100ce0 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/build.gradle @@ -0,0 +1,5 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + id 'com.android.application' version '8.0.2' apply false + id 'com.android.library' version '8.0.2' apply false +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/gradle.properties b/AndroidStudioProjects/TP1/ex1LinearLayout/gradle.properties new file mode 100644 index 0000000..3e927b1 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/gradle.properties @@ -0,0 +1,21 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/gradle/wrapper/gradle-wrapper.jar b/AndroidStudioProjects/TP1/ex1LinearLayout/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1LinearLayout/gradle/wrapper/gradle-wrapper.jar differ diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/gradle/wrapper/gradle-wrapper.properties b/AndroidStudioProjects/TP1/ex1LinearLayout/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..aec6d88 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Thu Jan 25 10:19:11 CET 2024 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/gradlew b/AndroidStudioProjects/TP1/ex1LinearLayout/gradlew new file mode 100755 index 0000000..4f906e0 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/gradlew.bat b/AndroidStudioProjects/TP1/ex1LinearLayout/gradlew.bat new file mode 100644 index 0000000..ac1b06f --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/AndroidStudioProjects/TP1/ex1LinearLayout/settings.gradle b/AndroidStudioProjects/TP1/ex1LinearLayout/settings.gradle new file mode 100644 index 0000000..e326127 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1LinearLayout/settings.gradle @@ -0,0 +1,16 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} +rootProject.name = "ex1" +include ':app' diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/.gitignore b/AndroidStudioProjects/TP1/ex1RelativeLayout/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/.gitignore @@ -0,0 +1,15 @@ +*.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 +local.properties diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/.idea/.gitignore b/AndroidStudioProjects/TP1/ex1RelativeLayout/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/.idea/compiler.xml b/AndroidStudioProjects/TP1/ex1RelativeLayout/.idea/compiler.xml new file mode 100644 index 0000000..b589d56 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/.idea/compiler.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="CompilerConfiguration"> + <bytecodeTargetLevel target="17" /> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/.idea/deploymentTargetSelector.xml b/AndroidStudioProjects/TP1/ex1RelativeLayout/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000..b268ef3 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/.idea/deploymentTargetSelector.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="deploymentTargetSelector"> + <selectionStates> + <SelectionState runConfigName="app"> + <option name="selectionMode" value="DROPDOWN" /> + </SelectionState> + </selectionStates> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/.idea/gradle.xml b/AndroidStudioProjects/TP1/ex1RelativeLayout/.idea/gradle.xml new file mode 100644 index 0000000..0897082 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/.idea/gradle.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="GradleMigrationSettings" migrationVersion="1" /> + <component name="GradleSettings"> + <option name="linkedExternalProjectsSettings"> + <GradleProjectSettings> + <option name="externalProjectPath" value="$PROJECT_DIR$" /> + <option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" /> + <option name="modules"> + <set> + <option value="$PROJECT_DIR$" /> + <option value="$PROJECT_DIR$/app" /> + </set> + </option> + <option name="resolveExternalAnnotations" value="false" /> + </GradleProjectSettings> + </option> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/.idea/migrations.xml b/AndroidStudioProjects/TP1/ex1RelativeLayout/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/.idea/migrations.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectMigrations"> + <option name="MigrateToGradleLocalJavaHome"> + <set> + <option value="$PROJECT_DIR$" /> + </set> + </option> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/.idea/misc.xml b/AndroidStudioProjects/TP1/ex1RelativeLayout/.idea/misc.xml new file mode 100644 index 0000000..0ad17cb --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/.idea/misc.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ExternalStorageConfigurationManager" enabled="true" /> + <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK"> + <output url="file://$PROJECT_DIR$/build/classes" /> + </component> + <component name="ProjectType"> + <option name="id" value="Android" /> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/app/.gitignore b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/app/build.gradle b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/build.gradle new file mode 100644 index 0000000..ebb366d --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/build.gradle @@ -0,0 +1,40 @@ +plugins { + id 'com.android.application' +} + +android { + namespace 'com.example.ex1relativelayout' + compileSdk 19 + + defaultConfig { + applicationId "com.example.ex1relativelayout" + minSdk 19 + targetSdk 19 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + buildToolsVersion '19.0.0' +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.4.1' + implementation 'com.google.android.material:material:1.5.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.3' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.3' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/app/proguard-rules.pro b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/androidTest/java/com/example/ex1relativelayout/ExampleInstrumentedTest.java b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/androidTest/java/com/example/ex1relativelayout/ExampleInstrumentedTest.java new file mode 100644 index 0000000..a1556ef --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/androidTest/java/com/example/ex1relativelayout/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.ex1relativelayout; + +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.ex1relativelayout", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/AndroidManifest.xml b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..abf16f7 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/AndroidManifest.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools"> + + <application + android:allowBackup="true" + android:dataExtractionRules="@xml/data_extraction_rules" + android:fullBackupContent="@xml/backup_rules" + android:icon="@mipmap/ic_launcher" + android:label="@string/app_name" + android:roundIcon="@mipmap/ic_launcher_round" + android:supportsRtl="true" + android:theme="@style/Theme.Ex1RelativeLayout" + tools:targetApi="31"> + <activity + android:name=".MainActivity" + android:exported="true"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + </application> + +</manifest> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/java/com/example/ex1relativelayout/MainActivity.java b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/java/com/example/ex1relativelayout/MainActivity.java new file mode 100644 index 0000000..713b794 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/java/com/example/ex1relativelayout/MainActivity.java @@ -0,0 +1,14 @@ +package com.example.ex1relativelayout; + +import androidx.appcompat.app.AppCompatActivity; + +import android.os.Bundle; + +public class MainActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:aapt="http://schemas.android.com/aapt" + android:width="108dp" + android:height="108dp" + android:viewportWidth="108" + android:viewportHeight="108"> + <path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z"> + <aapt:attr name="android:fillColor"> + <gradient + android:endX="85.84757" + android:endY="92.4963" + android:startX="42.9492" + android:startY="49.59793" + android:type="linear"> + <item + android:color="#44000000" + android:offset="0.0" /> + <item + android:color="#00000000" + android:offset="1.0" /> + </gradient> + </aapt:attr> + </path> + <path + android:fillColor="#FFFFFF" + android:fillType="nonZero" + android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z" + android:strokeWidth="1" + android:strokeColor="#00000000" /> +</vector> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/drawable/ic_launcher_background.xml b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="108dp" + android:height="108dp" + android:viewportWidth="108" + android:viewportHeight="108"> + <path + android:fillColor="#3DDC84" + android:pathData="M0,0h108v108h-108z" /> + <path + android:fillColor="#00000000" + android:pathData="M9,0L9,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,0L19,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M29,0L29,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M39,0L39,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M49,0L49,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M59,0L59,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M69,0L69,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M79,0L79,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M89,0L89,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M99,0L99,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,9L108,9" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,19L108,19" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,29L108,29" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,39L108,39" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,49L108,49" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,59L108,59" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,69L108,69" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,79L108,79" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,89L108,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,99L108,99" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,29L89,29" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,39L89,39" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,49L89,49" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,59L89,59" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,69L89,69" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,79L89,79" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M29,19L29,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M39,19L39,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M49,19L49,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M59,19L59,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M69,19L69,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M79,19L79,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> +</vector> diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/layout/activity_main.xml b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..7cf7a82 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout 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" + android:orientation="vertical"> + + <EditText + android:id="@+id/toto" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentTop="true" + android:layout_alignParentLeft="true" + android:layout_alignParentRight="true" + android:layout_above="@id/toto2" + android:gravity="top" + android:text="Hello World!" /> + + <Button + android:id="@+id/toto2" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentRight="true" + android:layout_alignParentBottom="true" + android:text="OK" /> + + <EditText + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_toLeftOf="@id/toto2" + android:layout_alignParentLeft="true" + android:layout_alignParentBottom="true" + android:text="Hello World!" /> + +</RelativeLayout> diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/ic_launcher_background" /> + <foreground android:drawable="@drawable/ic_launcher_foreground" /> + <monochrome android:drawable="@drawable/ic_launcher_foreground" /> +</adaptive-icon> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/ic_launcher_background" /> + <foreground android:drawable="@drawable/ic_launcher_foreground" /> + <monochrome android:drawable="@drawable/ic_launcher_foreground" /> +</adaptive-icon> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/values-night/themes.xml b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..5b18b23 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/values-night/themes.xml @@ -0,0 +1,7 @@ +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Base application theme. --> + <style name="Base.Theme.Ex1RelativeLayout" parent="Theme.Material3.DayNight.NoActionBar"> + <!-- Customize your dark theme here. --> + <!-- <item name="colorPrimary">@color/my_dark_primary</item> --> + </style> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/values/colors.xml b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..c8524cd --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/values/colors.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <color name="black">#FF000000</color> + <color name="white">#FFFFFFFF</color> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/values/strings.xml b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..382f954 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ +<resources> + <string name="app_name">ex1RelativeLayout</string> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/values/themes.xml b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..8e83dfd --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/values/themes.xml @@ -0,0 +1,9 @@ +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Base application theme. --> + <style name="Base.Theme.Ex1RelativeLayout" parent="Theme.Material3.DayNight.NoActionBar"> + <!-- Customize your light theme here. --> + <!-- <item name="colorPrimary">@color/my_light_primary</item> --> + </style> + + <style name="Theme.Ex1RelativeLayout" parent="Base.Theme.Ex1RelativeLayout" /> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/xml/backup_rules.xml b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/xml/backup_rules.xml new file mode 100644 index 0000000..fa0f996 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/xml/backup_rules.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + Sample backup rules file; uncomment and customize as necessary. + See https://developer.android.com/guide/topics/data/autobackup + for details. + Note: This file is ignored for devices older that API 31 + See https://developer.android.com/about/versions/12/backup-restore +--> +<full-backup-content> + <!-- + <include domain="sharedpref" path="."/> + <exclude domain="sharedpref" path="device.xml"/> +--> +</full-backup-content> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/xml/data_extraction_rules.xml b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/xml/data_extraction_rules.xml new file mode 100644 index 0000000..9ee9997 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/main/res/xml/data_extraction_rules.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + Sample data extraction rules file; uncomment and customize as necessary. + See https://developer.android.com/about/versions/12/backup-restore#xml-changes + for details. +--> +<data-extraction-rules> + <cloud-backup> + <!-- TODO: Use <include> and <exclude> to control what is backed up. + <include .../> + <exclude .../> + --> + </cloud-backup> + <!-- + <device-transfer> + <include .../> + <exclude .../> + </device-transfer> + --> +</data-extraction-rules> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/test/java/com/example/ex1relativelayout/ExampleUnitTest.java b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/test/java/com/example/ex1relativelayout/ExampleUnitTest.java new file mode 100644 index 0000000..66e66d3 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/app/src/test/java/com/example/ex1relativelayout/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package com.example.ex1relativelayout; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/build.gradle b/AndroidStudioProjects/TP1/ex1RelativeLayout/build.gradle new file mode 100644 index 0000000..a100ce0 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/build.gradle @@ -0,0 +1,5 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + id 'com.android.application' version '8.0.2' apply false + id 'com.android.library' version '8.0.2' apply false +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/gradle.properties b/AndroidStudioProjects/TP1/ex1RelativeLayout/gradle.properties new file mode 100644 index 0000000..3e927b1 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/gradle.properties @@ -0,0 +1,21 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/gradle/wrapper/gradle-wrapper.jar b/AndroidStudioProjects/TP1/ex1RelativeLayout/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1RelativeLayout/gradle/wrapper/gradle-wrapper.jar differ diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/gradle/wrapper/gradle-wrapper.properties b/AndroidStudioProjects/TP1/ex1RelativeLayout/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..0d0428f --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Thu Jan 25 14:05:59 CET 2024 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/gradlew b/AndroidStudioProjects/TP1/ex1RelativeLayout/gradlew new file mode 100755 index 0000000..4f906e0 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/gradlew.bat b/AndroidStudioProjects/TP1/ex1RelativeLayout/gradlew.bat new file mode 100644 index 0000000..ac1b06f --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/AndroidStudioProjects/TP1/ex1RelativeLayout/settings.gradle b/AndroidStudioProjects/TP1/ex1RelativeLayout/settings.gradle new file mode 100644 index 0000000..2daa3fe --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1RelativeLayout/settings.gradle @@ -0,0 +1,16 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} +rootProject.name = "ex1RelativeLayout" +include ':app' diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/.gitignore b/AndroidStudioProjects/TP1/ex1TableLayout/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1TableLayout/.gitignore @@ -0,0 +1,15 @@ +*.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 +local.properties diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/.idea/.gitignore b/AndroidStudioProjects/TP1/ex1TableLayout/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1TableLayout/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/.idea/compiler.xml b/AndroidStudioProjects/TP1/ex1TableLayout/.idea/compiler.xml new file mode 100644 index 0000000..b589d56 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1TableLayout/.idea/compiler.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="CompilerConfiguration"> + <bytecodeTargetLevel target="17" /> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/.idea/gradle.xml b/AndroidStudioProjects/TP1/ex1TableLayout/.idea/gradle.xml new file mode 100644 index 0000000..a9f4e52 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1TableLayout/.idea/gradle.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <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> + </GradleProjectSettings> + </option> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/.idea/misc.xml b/AndroidStudioProjects/TP1/ex1TableLayout/.idea/misc.xml new file mode 100644 index 0000000..8978d23 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1TableLayout/.idea/misc.xml @@ -0,0 +1,9 @@ +<project version="4"> + <component name="ExternalStorageConfigurationManager" enabled="true" /> + <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK"> + <output url="file://$PROJECT_DIR$/build/classes" /> + </component> + <component name="ProjectType"> + <option name="id" value="Android" /> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/app/.gitignore b/AndroidStudioProjects/TP1/ex1TableLayout/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1TableLayout/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/app/build.gradle b/AndroidStudioProjects/TP1/ex1TableLayout/app/build.gradle new file mode 100644 index 0000000..ca6b181 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1TableLayout/app/build.gradle @@ -0,0 +1,39 @@ +plugins { + id 'com.android.application' +} + +android { + namespace 'com.example.ex1tablelayout' + compileSdk 33 + + defaultConfig { + applicationId "com.example.ex1tablelayout" + minSdk 19 + targetSdk 33 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.4.1' + implementation 'com.google.android.material:material:1.5.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.3' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.3' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/app/proguard-rules.pro b/AndroidStudioProjects/TP1/ex1TableLayout/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1TableLayout/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/app/src/androidTest/java/com/example/ex1tablelayout/ExampleInstrumentedTest.java b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/androidTest/java/com/example/ex1tablelayout/ExampleInstrumentedTest.java new file mode 100644 index 0000000..736b6b4 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/androidTest/java/com/example/ex1tablelayout/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.ex1tablelayout; + +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.ex1tablelayout", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/AndroidManifest.xml b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..c708da7 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/AndroidManifest.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools"> + + <application + android:allowBackup="true" + android:dataExtractionRules="@xml/data_extraction_rules" + android:fullBackupContent="@xml/backup_rules" + android:icon="@mipmap/ic_launcher" + android:label="@string/app_name" + android:roundIcon="@mipmap/ic_launcher_round" + android:supportsRtl="true" + android:theme="@style/Theme.Ex1TableLayout" + tools:targetApi="31"> + <activity + android:name=".MainActivity" + android:exported="true"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + </application> + +</manifest> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/java/com/example/ex1tablelayout/MainActivity.java b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/java/com/example/ex1tablelayout/MainActivity.java new file mode 100644 index 0000000..d6f624d --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/java/com/example/ex1tablelayout/MainActivity.java @@ -0,0 +1,14 @@ +package com.example.ex1tablelayout; + +import androidx.appcompat.app.AppCompatActivity; + +import android.os.Bundle; + +public class MainActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:aapt="http://schemas.android.com/aapt" + android:width="108dp" + android:height="108dp" + android:viewportWidth="108" + android:viewportHeight="108"> + <path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z"> + <aapt:attr name="android:fillColor"> + <gradient + android:endX="85.84757" + android:endY="92.4963" + android:startX="42.9492" + android:startY="49.59793" + android:type="linear"> + <item + android:color="#44000000" + android:offset="0.0" /> + <item + android:color="#00000000" + android:offset="1.0" /> + </gradient> + </aapt:attr> + </path> + <path + android:fillColor="#FFFFFF" + android:fillType="nonZero" + android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z" + android:strokeWidth="1" + android:strokeColor="#00000000" /> +</vector> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/drawable/ic_launcher_background.xml b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="108dp" + android:height="108dp" + android:viewportWidth="108" + android:viewportHeight="108"> + <path + android:fillColor="#3DDC84" + android:pathData="M0,0h108v108h-108z" /> + <path + android:fillColor="#00000000" + android:pathData="M9,0L9,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,0L19,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M29,0L29,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M39,0L39,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M49,0L49,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M59,0L59,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M69,0L69,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M79,0L79,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M89,0L89,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M99,0L99,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,9L108,9" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,19L108,19" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,29L108,29" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,39L108,39" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,49L108,49" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,59L108,59" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,69L108,69" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,79L108,79" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,89L108,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,99L108,99" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,29L89,29" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,39L89,39" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,49L89,49" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,59L89,59" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,69L89,69" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,79L89,79" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M29,19L29,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M39,19L39,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M49,19L49,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M59,19L59,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M69,19L69,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M79,19L79,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> +</vector> diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/layout/activity_main.xml b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..bce6458 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8"?> +<TableLayout 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" + android:orientation="vertical"> + + <EditText + android:id="@+id/toto" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:gravity="top" + android:text="Hello World!" /> + <TableRow> + <EditText + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Hello World!" /> + + <Button + android:id="@+id/toto2" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="OK" /> + </TableRow> + +</TableLayout> diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/ic_launcher_background" /> + <foreground android:drawable="@drawable/ic_launcher_foreground" /> + <monochrome android:drawable="@drawable/ic_launcher_foreground" /> +</adaptive-icon> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/ic_launcher_background" /> + <foreground android:drawable="@drawable/ic_launcher_foreground" /> + <monochrome android:drawable="@drawable/ic_launcher_foreground" /> +</adaptive-icon> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/values-night/themes.xml b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..9eb73ad --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/values-night/themes.xml @@ -0,0 +1,7 @@ +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Base application theme. --> + <style name="Base.Theme.Ex1TableLayout" parent="Theme.Material3.DayNight.NoActionBar"> + <!-- Customize your dark theme here. --> + <!-- <item name="colorPrimary">@color/my_dark_primary</item> --> + </style> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/values/colors.xml b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..c8524cd --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/values/colors.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <color name="black">#FF000000</color> + <color name="white">#FFFFFFFF</color> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/values/strings.xml b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..6d956bf --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ +<resources> + <string name="app_name">ex1TableLayout</string> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/values/themes.xml b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..cdda375 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/values/themes.xml @@ -0,0 +1,9 @@ +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Base application theme. --> + <style name="Base.Theme.Ex1TableLayout" parent="Theme.Material3.DayNight.NoActionBar"> + <!-- Customize your light theme here. --> + <!-- <item name="colorPrimary">@color/my_light_primary</item> --> + </style> + + <style name="Theme.Ex1TableLayout" parent="Base.Theme.Ex1TableLayout" /> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/xml/backup_rules.xml b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/xml/backup_rules.xml new file mode 100644 index 0000000..fa0f996 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/xml/backup_rules.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + Sample backup rules file; uncomment and customize as necessary. + See https://developer.android.com/guide/topics/data/autobackup + for details. + Note: This file is ignored for devices older that API 31 + See https://developer.android.com/about/versions/12/backup-restore +--> +<full-backup-content> + <!-- + <include domain="sharedpref" path="."/> + <exclude domain="sharedpref" path="device.xml"/> +--> +</full-backup-content> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/xml/data_extraction_rules.xml b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/xml/data_extraction_rules.xml new file mode 100644 index 0000000..9ee9997 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/main/res/xml/data_extraction_rules.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + Sample data extraction rules file; uncomment and customize as necessary. + See https://developer.android.com/about/versions/12/backup-restore#xml-changes + for details. +--> +<data-extraction-rules> + <cloud-backup> + <!-- TODO: Use <include> and <exclude> to control what is backed up. + <include .../> + <exclude .../> + --> + </cloud-backup> + <!-- + <device-transfer> + <include .../> + <exclude .../> + </device-transfer> + --> +</data-extraction-rules> \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/app/src/test/java/com/example/ex1tablelayout/ExampleUnitTest.java b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/test/java/com/example/ex1tablelayout/ExampleUnitTest.java new file mode 100644 index 0000000..e41e7e4 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1TableLayout/app/src/test/java/com/example/ex1tablelayout/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package com.example.ex1tablelayout; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/build.gradle b/AndroidStudioProjects/TP1/ex1TableLayout/build.gradle new file mode 100644 index 0000000..a100ce0 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1TableLayout/build.gradle @@ -0,0 +1,5 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + id 'com.android.application' version '8.0.2' apply false + id 'com.android.library' version '8.0.2' apply false +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/gradle.properties b/AndroidStudioProjects/TP1/ex1TableLayout/gradle.properties new file mode 100644 index 0000000..3e927b1 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1TableLayout/gradle.properties @@ -0,0 +1,21 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/gradle/wrapper/gradle-wrapper.jar b/AndroidStudioProjects/TP1/ex1TableLayout/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/AndroidStudioProjects/TP1/ex1TableLayout/gradle/wrapper/gradle-wrapper.jar differ diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/gradle/wrapper/gradle-wrapper.properties b/AndroidStudioProjects/TP1/ex1TableLayout/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..d0e751b --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1TableLayout/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Thu Jan 25 14:53:52 CET 2024 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/gradlew b/AndroidStudioProjects/TP1/ex1TableLayout/gradlew new file mode 100755 index 0000000..4f906e0 --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1TableLayout/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/gradlew.bat b/AndroidStudioProjects/TP1/ex1TableLayout/gradlew.bat new file mode 100644 index 0000000..ac1b06f --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1TableLayout/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/AndroidStudioProjects/TP1/ex1TableLayout/settings.gradle b/AndroidStudioProjects/TP1/ex1TableLayout/settings.gradle new file mode 100644 index 0000000..d9bfefc --- /dev/null +++ b/AndroidStudioProjects/TP1/ex1TableLayout/settings.gradle @@ -0,0 +1,16 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} +rootProject.name = "ex1TableLayout" +include ':app' diff --git a/AndroidStudioProjects/TP2/choix/.gitignore b/AndroidStudioProjects/TP2/choix/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/.gitignore @@ -0,0 +1,15 @@ +*.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 +local.properties diff --git a/AndroidStudioProjects/TP2/choix/.idea/.gitignore b/AndroidStudioProjects/TP2/choix/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/AndroidStudioProjects/TP2/choix/.idea/compiler.xml b/AndroidStudioProjects/TP2/choix/.idea/compiler.xml new file mode 100644 index 0000000..b589d56 --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/.idea/compiler.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="CompilerConfiguration"> + <bytecodeTargetLevel target="17" /> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/choix/.idea/deploymentTargetSelector.xml b/AndroidStudioProjects/TP2/choix/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000..b268ef3 --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/.idea/deploymentTargetSelector.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="deploymentTargetSelector"> + <selectionStates> + <SelectionState runConfigName="app"> + <option name="selectionMode" value="DROPDOWN" /> + </SelectionState> + </selectionStates> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/choix/.idea/gradle.xml b/AndroidStudioProjects/TP2/choix/.idea/gradle.xml new file mode 100644 index 0000000..0897082 --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/.idea/gradle.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="GradleMigrationSettings" migrationVersion="1" /> + <component name="GradleSettings"> + <option name="linkedExternalProjectsSettings"> + <GradleProjectSettings> + <option name="externalProjectPath" value="$PROJECT_DIR$" /> + <option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" /> + <option name="modules"> + <set> + <option value="$PROJECT_DIR$" /> + <option value="$PROJECT_DIR$/app" /> + </set> + </option> + <option name="resolveExternalAnnotations" value="false" /> + </GradleProjectSettings> + </option> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/choix/.idea/migrations.xml b/AndroidStudioProjects/TP2/choix/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/.idea/migrations.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectMigrations"> + <option name="MigrateToGradleLocalJavaHome"> + <set> + <option value="$PROJECT_DIR$" /> + </set> + </option> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/choix/.idea/misc.xml b/AndroidStudioProjects/TP2/choix/.idea/misc.xml new file mode 100644 index 0000000..8978d23 --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/.idea/misc.xml @@ -0,0 +1,9 @@ +<project version="4"> + <component name="ExternalStorageConfigurationManager" enabled="true" /> + <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK"> + <output url="file://$PROJECT_DIR$/build/classes" /> + </component> + <component name="ProjectType"> + <option name="id" value="Android" /> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/choix/app/.gitignore b/AndroidStudioProjects/TP2/choix/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/choix/app/build.gradle b/AndroidStudioProjects/TP2/choix/app/build.gradle new file mode 100644 index 0000000..faea196 --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/app/build.gradle @@ -0,0 +1,39 @@ +plugins { + id 'com.android.application' +} + +android { + namespace 'com.example.choix' + compileSdk 33 + + defaultConfig { + applicationId "com.example.choix" + minSdk 19 + targetSdk 33 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.6.1' + implementation 'com.google.android.material:material:1.5.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/choix/app/proguard-rules.pro b/AndroidStudioProjects/TP2/choix/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/choix/app/src/androidTest/java/com/example/choix/ExampleInstrumentedTest.java b/AndroidStudioProjects/TP2/choix/app/src/androidTest/java/com/example/choix/ExampleInstrumentedTest.java new file mode 100644 index 0000000..d36f2b3 --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/app/src/androidTest/java/com/example/choix/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.choix; + +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.choix", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/choix/app/src/main/AndroidManifest.xml b/AndroidStudioProjects/TP2/choix/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..9f886ff --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/app/src/main/AndroidManifest.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools"> + + <application + android:allowBackup="true" + android:dataExtractionRules="@xml/data_extraction_rules" + android:fullBackupContent="@xml/backup_rules" + android:icon="@mipmap/ic_launcher" + android:label="@string/app_name" + android:roundIcon="@mipmap/ic_launcher_round" + android:supportsRtl="true" + android:theme="@style/Theme.Choix" + tools:targetApi="31"> + <activity + android:name=".MainActivity" + android:exported="true"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + </application> + +</manifest> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/choix/app/src/main/java/com/example/choix/MainActivity.java b/AndroidStudioProjects/TP2/choix/app/src/main/java/com/example/choix/MainActivity.java new file mode 100644 index 0000000..954e4a8 --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/app/src/main/java/com/example/choix/MainActivity.java @@ -0,0 +1,14 @@ +package com.example.choix; + +import androidx.appcompat.app.AppCompatActivity; + +import android.os.Bundle; + +public class MainActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/choix/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/AndroidStudioProjects/TP2/choix/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:aapt="http://schemas.android.com/aapt" + android:width="108dp" + android:height="108dp" + android:viewportWidth="108" + android:viewportHeight="108"> + <path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z"> + <aapt:attr name="android:fillColor"> + <gradient + android:endX="85.84757" + android:endY="92.4963" + android:startX="42.9492" + android:startY="49.59793" + android:type="linear"> + <item + android:color="#44000000" + android:offset="0.0" /> + <item + android:color="#00000000" + android:offset="1.0" /> + </gradient> + </aapt:attr> + </path> + <path + android:fillColor="#FFFFFF" + android:fillType="nonZero" + android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z" + android:strokeWidth="1" + android:strokeColor="#00000000" /> +</vector> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/choix/app/src/main/res/drawable/ic_launcher_background.xml b/AndroidStudioProjects/TP2/choix/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="108dp" + android:height="108dp" + android:viewportWidth="108" + android:viewportHeight="108"> + <path + android:fillColor="#3DDC84" + android:pathData="M0,0h108v108h-108z" /> + <path + android:fillColor="#00000000" + android:pathData="M9,0L9,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,0L19,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M29,0L29,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M39,0L39,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M49,0L49,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M59,0L59,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M69,0L69,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M79,0L79,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M89,0L89,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M99,0L99,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,9L108,9" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,19L108,19" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,29L108,29" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,39L108,39" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,49L108,49" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,59L108,59" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,69L108,69" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,79L108,79" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,89L108,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,99L108,99" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,29L89,29" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,39L89,39" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,49L89,49" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,59L89,59" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,69L89,69" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,79L89,79" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M29,19L29,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M39,19L39,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M49,19L49,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M59,19L59,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M69,19L69,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M79,19L79,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> +</vector> diff --git a/AndroidStudioProjects/TP2/choix/app/src/main/res/layout/activity_main.xml b/AndroidStudioProjects/TP2/choix/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..17eab17 --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,18 @@ +<?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"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Hello World!" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + +</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/ic_launcher_background" /> + <foreground android:drawable="@drawable/ic_launcher_foreground" /> + <monochrome android:drawable="@drawable/ic_launcher_foreground" /> +</adaptive-icon> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/ic_launcher_background" /> + <foreground android:drawable="@drawable/ic_launcher_foreground" /> + <monochrome android:drawable="@drawable/ic_launcher_foreground" /> +</adaptive-icon> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/AndroidStudioProjects/TP2/choix/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP2/choix/app/src/main/res/values-night/themes.xml b/AndroidStudioProjects/TP2/choix/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..2572f68 --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/app/src/main/res/values-night/themes.xml @@ -0,0 +1,7 @@ +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Base application theme. --> + <style name="Base.Theme.Choix" parent="Theme.Material3.DayNight.NoActionBar"> + <!-- Customize your dark theme here. --> + <!-- <item name="colorPrimary">@color/my_dark_primary</item> --> + </style> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/choix/app/src/main/res/values/colors.xml b/AndroidStudioProjects/TP2/choix/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..c8524cd --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/app/src/main/res/values/colors.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <color name="black">#FF000000</color> + <color name="white">#FFFFFFFF</color> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/choix/app/src/main/res/values/strings.xml b/AndroidStudioProjects/TP2/choix/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..417c239 --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ +<resources> + <string name="app_name">choix</string> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/choix/app/src/main/res/values/themes.xml b/AndroidStudioProjects/TP2/choix/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..5fd1716 --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/app/src/main/res/values/themes.xml @@ -0,0 +1,9 @@ +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Base application theme. --> + <style name="Base.Theme.Choix" parent="Theme.Material3.DayNight.NoActionBar"> + <!-- Customize your light theme here. --> + <!-- <item name="colorPrimary">@color/my_light_primary</item> --> + </style> + + <style name="Theme.Choix" parent="Base.Theme.Choix" /> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/choix/app/src/main/res/xml/backup_rules.xml b/AndroidStudioProjects/TP2/choix/app/src/main/res/xml/backup_rules.xml new file mode 100644 index 0000000..fa0f996 --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/app/src/main/res/xml/backup_rules.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + Sample backup rules file; uncomment and customize as necessary. + See https://developer.android.com/guide/topics/data/autobackup + for details. + Note: This file is ignored for devices older that API 31 + See https://developer.android.com/about/versions/12/backup-restore +--> +<full-backup-content> + <!-- + <include domain="sharedpref" path="."/> + <exclude domain="sharedpref" path="device.xml"/> +--> +</full-backup-content> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/choix/app/src/main/res/xml/data_extraction_rules.xml b/AndroidStudioProjects/TP2/choix/app/src/main/res/xml/data_extraction_rules.xml new file mode 100644 index 0000000..9ee9997 --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/app/src/main/res/xml/data_extraction_rules.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + Sample data extraction rules file; uncomment and customize as necessary. + See https://developer.android.com/about/versions/12/backup-restore#xml-changes + for details. +--> +<data-extraction-rules> + <cloud-backup> + <!-- TODO: Use <include> and <exclude> to control what is backed up. + <include .../> + <exclude .../> + --> + </cloud-backup> + <!-- + <device-transfer> + <include .../> + <exclude .../> + </device-transfer> + --> +</data-extraction-rules> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/choix/app/src/test/java/com/example/choix/ExampleUnitTest.java b/AndroidStudioProjects/TP2/choix/app/src/test/java/com/example/choix/ExampleUnitTest.java new file mode 100644 index 0000000..31bb4ec --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/app/src/test/java/com/example/choix/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package com.example.choix; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/choix/build.gradle b/AndroidStudioProjects/TP2/choix/build.gradle new file mode 100644 index 0000000..a100ce0 --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/build.gradle @@ -0,0 +1,5 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + id 'com.android.application' version '8.0.2' apply false + id 'com.android.library' version '8.0.2' apply false +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/choix/gradle.properties b/AndroidStudioProjects/TP2/choix/gradle.properties new file mode 100644 index 0000000..3e927b1 --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/gradle.properties @@ -0,0 +1,21 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/choix/gradle/wrapper/gradle-wrapper.jar b/AndroidStudioProjects/TP2/choix/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/AndroidStudioProjects/TP2/choix/gradle/wrapper/gradle-wrapper.jar differ diff --git a/AndroidStudioProjects/TP2/choix/gradle/wrapper/gradle-wrapper.properties b/AndroidStudioProjects/TP2/choix/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..848381f --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Thu Feb 01 14:43:41 CET 2024 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/AndroidStudioProjects/TP2/choix/gradlew b/AndroidStudioProjects/TP2/choix/gradlew new file mode 100755 index 0000000..4f906e0 --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/AndroidStudioProjects/TP2/choix/gradlew.bat b/AndroidStudioProjects/TP2/choix/gradlew.bat new file mode 100644 index 0000000..ac1b06f --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/AndroidStudioProjects/TP2/choix/settings.gradle b/AndroidStudioProjects/TP2/choix/settings.gradle new file mode 100644 index 0000000..bc4511e --- /dev/null +++ b/AndroidStudioProjects/TP2/choix/settings.gradle @@ -0,0 +1,16 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} +rootProject.name = "choix" +include ':app' diff --git a/AndroidStudioProjects/TP2/gribouillage/.gitignore b/AndroidStudioProjects/TP2/gribouillage/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/.gitignore @@ -0,0 +1,15 @@ +*.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 +local.properties diff --git a/AndroidStudioProjects/TP2/gribouillage/.idea/.gitignore b/AndroidStudioProjects/TP2/gribouillage/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/AndroidStudioProjects/TP2/gribouillage/.idea/compiler.xml b/AndroidStudioProjects/TP2/gribouillage/.idea/compiler.xml new file mode 100644 index 0000000..b589d56 --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/.idea/compiler.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="CompilerConfiguration"> + <bytecodeTargetLevel target="17" /> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/gribouillage/.idea/deploymentTargetSelector.xml b/AndroidStudioProjects/TP2/gribouillage/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000..b268ef3 --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/.idea/deploymentTargetSelector.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="deploymentTargetSelector"> + <selectionStates> + <SelectionState runConfigName="app"> + <option name="selectionMode" value="DROPDOWN" /> + </SelectionState> + </selectionStates> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/gribouillage/.idea/gradle.xml b/AndroidStudioProjects/TP2/gribouillage/.idea/gradle.xml new file mode 100644 index 0000000..0897082 --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/.idea/gradle.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="GradleMigrationSettings" migrationVersion="1" /> + <component name="GradleSettings"> + <option name="linkedExternalProjectsSettings"> + <GradleProjectSettings> + <option name="externalProjectPath" value="$PROJECT_DIR$" /> + <option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" /> + <option name="modules"> + <set> + <option value="$PROJECT_DIR$" /> + <option value="$PROJECT_DIR$/app" /> + </set> + </option> + <option name="resolveExternalAnnotations" value="false" /> + </GradleProjectSettings> + </option> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/gribouillage/.idea/migrations.xml b/AndroidStudioProjects/TP2/gribouillage/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/.idea/migrations.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectMigrations"> + <option name="MigrateToGradleLocalJavaHome"> + <set> + <option value="$PROJECT_DIR$" /> + </set> + </option> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/gribouillage/.idea/misc.xml b/AndroidStudioProjects/TP2/gribouillage/.idea/misc.xml new file mode 100644 index 0000000..0ad17cb --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/.idea/misc.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ExternalStorageConfigurationManager" enabled="true" /> + <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK"> + <output url="file://$PROJECT_DIR$/build/classes" /> + </component> + <component name="ProjectType"> + <option name="id" value="Android" /> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/gribouillage/app/.gitignore b/AndroidStudioProjects/TP2/gribouillage/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/gribouillage/app/build.gradle b/AndroidStudioProjects/TP2/gribouillage/app/build.gradle new file mode 100644 index 0000000..229ab45 --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/app/build.gradle @@ -0,0 +1,39 @@ +plugins { + id 'com.android.application' +} + +android { + namespace 'com.example.gribouillage' + compileSdk 34 + + defaultConfig { + applicationId "com.example.gribouillage" + minSdk 19 + targetSdk 33 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + buildToolsVersion '34.0.0' +} + +dependencies { + + + implementation 'com.google.android.material:material:1.5.0' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/gribouillage/app/proguard-rules.pro b/AndroidStudioProjects/TP2/gribouillage/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/gribouillage/app/src/androidTest/java/com/example/gribouillage/ExampleInstrumentedTest.java b/AndroidStudioProjects/TP2/gribouillage/app/src/androidTest/java/com/example/gribouillage/ExampleInstrumentedTest.java new file mode 100644 index 0000000..87e233a --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/app/src/androidTest/java/com/example/gribouillage/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.gribouillage; + +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.gribouillage", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/gribouillage/app/src/main/AndroidManifest.xml b/AndroidStudioProjects/TP2/gribouillage/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..2da831b --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/app/src/main/AndroidManifest.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools"> + + <application + android:allowBackup="true" + android:dataExtractionRules="@xml/data_extraction_rules" + android:fullBackupContent="@xml/backup_rules" + android:icon="@mipmap/ic_launcher" + android:label="@string/app_name" + android:roundIcon="@mipmap/ic_launcher_round" + android:supportsRtl="true" + android:theme="@style/Theme.Gribouillage" + tools:targetApi="31"> + <activity + android:name=".MainActivity" + android:exported="true"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + </application> + +</manifest> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/gribouillage/app/src/main/java/com/example/gribouillage/Gribouillis.java b/AndroidStudioProjects/TP2/gribouillage/app/src/main/java/com/example/gribouillage/Gribouillis.java new file mode 100644 index 0000000..a0dd048 --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/app/src/main/java/com/example/gribouillage/Gribouillis.java @@ -0,0 +1,44 @@ +package com.example.gribouillage; +import android.content.Context; +import android.content.res.Resources; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.graphics.Canvas; +import android.graphics.Paint; +import android.graphics.Rect; +import android.view.View; + +import org.w3c.dom.Text; + +public class Gribouillis extends View { + + Bitmap image; + Paint turpentinebleu = new Paint(); + Paint turpentineviolet = new Paint(); + Paint turpentinejaune = new Paint(); + Rect rectangle; + + public Gribouillis(Context context) { + super(context); + Resources res = this.getResources(); + this.image = BitmapFactory.decodeResource(res, R.drawable.cercles); + this.turpentinebleu.setARGB(255,0,0,255); + this.turpentineviolet.setARGB(255,127,0,255); + this.turpentinejaune.setARGB(255,255,255,0); + turpentineviolet.setStyle(Paint.Style.STROKE); + turpentineviolet.setStrokeWidth(5); + this.rectangle = new Rect(0,0,500,1000); + } + + @Override + protected void onDraw(Canvas canvas) { + super.onDraw(canvas); + canvas.drawRect(rectangle, turpentinebleu); + canvas.drawCircle(800,600,200,turpentineviolet); + turpentinejaune.setFakeBoldText(true); + turpentinejaune.setTextSize(40); + turpentinejaune.setTextAlign(Paint.Align.CENTER); + canvas.drawText("Ceci est un test",rectangle.centerX(),rectangle.centerY(),turpentinejaune); + canvas.drawBitmap(image,500,1500,turpentinebleu); + } +} diff --git a/AndroidStudioProjects/TP2/gribouillage/app/src/main/java/com/example/gribouillage/MainActivity.java b/AndroidStudioProjects/TP2/gribouillage/app/src/main/java/com/example/gribouillage/MainActivity.java new file mode 100644 index 0000000..3febc99 --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/app/src/main/java/com/example/gribouillage/MainActivity.java @@ -0,0 +1,16 @@ +package com.example.gribouillage; + +import androidx.appcompat.app.AppCompatActivity; + +import android.app.Activity; +import android.os.Bundle; + +public class MainActivity extends Activity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:aapt="http://schemas.android.com/aapt" + android:width="108dp" + android:height="108dp" + android:viewportWidth="108" + android:viewportHeight="108"> + <path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z"> + <aapt:attr name="android:fillColor"> + <gradient + android:endX="85.84757" + android:endY="92.4963" + android:startX="42.9492" + android:startY="49.59793" + android:type="linear"> + <item + android:color="#44000000" + android:offset="0.0" /> + <item + android:color="#00000000" + android:offset="1.0" /> + </gradient> + </aapt:attr> + </path> + <path + android:fillColor="#FFFFFF" + android:fillType="nonZero" + android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z" + android:strokeWidth="1" + android:strokeColor="#00000000" /> +</vector> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/drawable/cercles.png b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/drawable/cercles.png new file mode 100644 index 0000000..4713bcc Binary files /dev/null and b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/drawable/cercles.png differ diff --git a/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/drawable/ic_launcher_background.xml b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="108dp" + android:height="108dp" + android:viewportWidth="108" + android:viewportHeight="108"> + <path + android:fillColor="#3DDC84" + android:pathData="M0,0h108v108h-108z" /> + <path + android:fillColor="#00000000" + android:pathData="M9,0L9,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,0L19,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M29,0L29,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M39,0L39,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M49,0L49,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M59,0L59,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M69,0L69,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M79,0L79,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M89,0L89,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M99,0L99,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,9L108,9" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,19L108,19" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,29L108,29" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,39L108,39" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,49L108,49" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,59L108,59" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,69L108,69" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,79L108,79" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,89L108,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,99L108,99" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,29L89,29" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,39L89,39" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,49L89,49" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,59L89,59" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,69L89,69" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,79L89,79" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M29,19L29,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M39,19L39,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M49,19L49,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M59,19L59,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M69,19L69,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M79,19L79,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> +</vector> diff --git a/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/layout/activity_main.xml b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..c09f379 --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,15 @@ +<?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"> + + <com.example.gribouillage.Gribouillis + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:layout_editor_absoluteX="0dp" + tools:layout_editor_absoluteY="0dp" /> + +</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/ic_launcher_background" /> + <foreground android:drawable="@drawable/ic_launcher_foreground" /> + <monochrome android:drawable="@drawable/ic_launcher_foreground" /> +</adaptive-icon> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/ic_launcher_background" /> + <foreground android:drawable="@drawable/ic_launcher_foreground" /> + <monochrome android:drawable="@drawable/ic_launcher_foreground" /> +</adaptive-icon> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/values-night/themes.xml b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..0391f2b --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/values-night/themes.xml @@ -0,0 +1,7 @@ +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Base application theme. --> + <style name="Base.Theme.Gribouillage" parent="Theme.Material3.DayNight.NoActionBar"> + <!-- Customize your dark theme here. --> + <!-- <item name="colorPrimary">@color/my_dark_primary</item> --> + </style> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/values/colors.xml b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..c8524cd --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/values/colors.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <color name="black">#FF000000</color> + <color name="white">#FFFFFFFF</color> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/values/strings.xml b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..7ef55db --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ +<resources> + <string name="app_name">gribouillage</string> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/values/themes.xml b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..6064fc7 --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/values/themes.xml @@ -0,0 +1,9 @@ +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Base application theme. --> + <style name="Base.Theme.Gribouillage" parent="Theme.Material3.DayNight.NoActionBar"> + <!-- Customize your light theme here. --> + <!-- <item name="colorPrimary">@color/my_light_primary</item> --> + </style> + + <style name="Theme.Gribouillage" parent="Base.Theme.Gribouillage" /> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/xml/backup_rules.xml b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/xml/backup_rules.xml new file mode 100644 index 0000000..fa0f996 --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/xml/backup_rules.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + Sample backup rules file; uncomment and customize as necessary. + See https://developer.android.com/guide/topics/data/autobackup + for details. + Note: This file is ignored for devices older that API 31 + See https://developer.android.com/about/versions/12/backup-restore +--> +<full-backup-content> + <!-- + <include domain="sharedpref" path="."/> + <exclude domain="sharedpref" path="device.xml"/> +--> +</full-backup-content> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/xml/data_extraction_rules.xml b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/xml/data_extraction_rules.xml new file mode 100644 index 0000000..9ee9997 --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/app/src/main/res/xml/data_extraction_rules.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + Sample data extraction rules file; uncomment and customize as necessary. + See https://developer.android.com/about/versions/12/backup-restore#xml-changes + for details. +--> +<data-extraction-rules> + <cloud-backup> + <!-- TODO: Use <include> and <exclude> to control what is backed up. + <include .../> + <exclude .../> + --> + </cloud-backup> + <!-- + <device-transfer> + <include .../> + <exclude .../> + </device-transfer> + --> +</data-extraction-rules> \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/gribouillage/app/src/test/java/com/example/gribouillage/ExampleUnitTest.java b/AndroidStudioProjects/TP2/gribouillage/app/src/test/java/com/example/gribouillage/ExampleUnitTest.java new file mode 100644 index 0000000..ba34d20 --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/app/src/test/java/com/example/gribouillage/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package com.example.gribouillage; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/gribouillage/build.gradle b/AndroidStudioProjects/TP2/gribouillage/build.gradle new file mode 100644 index 0000000..e2ebcef --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/build.gradle @@ -0,0 +1,5 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + id 'com.android.application' version '8.6.0' apply false + id 'com.android.library' version '8.6.0' apply false +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/gribouillage/gradle.properties b/AndroidStudioProjects/TP2/gribouillage/gradle.properties new file mode 100644 index 0000000..3e927b1 --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/gradle.properties @@ -0,0 +1,21 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/AndroidStudioProjects/TP2/gribouillage/gradle/wrapper/gradle-wrapper.jar b/AndroidStudioProjects/TP2/gribouillage/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/AndroidStudioProjects/TP2/gribouillage/gradle/wrapper/gradle-wrapper.jar differ diff --git a/AndroidStudioProjects/TP2/gribouillage/gradle/wrapper/gradle-wrapper.properties b/AndroidStudioProjects/TP2/gribouillage/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..1bb626d --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Thu Feb 01 10:01:08 CET 2024 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/AndroidStudioProjects/TP2/gribouillage/gradlew b/AndroidStudioProjects/TP2/gribouillage/gradlew new file mode 100755 index 0000000..4f906e0 --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/AndroidStudioProjects/TP2/gribouillage/gradlew.bat b/AndroidStudioProjects/TP2/gribouillage/gradlew.bat new file mode 100644 index 0000000..ac1b06f --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/AndroidStudioProjects/TP2/gribouillage/settings.gradle b/AndroidStudioProjects/TP2/gribouillage/settings.gradle new file mode 100644 index 0000000..46b7a73 --- /dev/null +++ b/AndroidStudioProjects/TP2/gribouillage/settings.gradle @@ -0,0 +1,16 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} +rootProject.name = "gribouillage" +include ':app' diff --git a/AndroidStudioProjects/TP3/Fleche/.gitignore b/AndroidStudioProjects/TP3/Fleche/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/.gitignore @@ -0,0 +1,15 @@ +*.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 +local.properties diff --git a/AndroidStudioProjects/TP3/Fleche/.idea/.gitignore b/AndroidStudioProjects/TP3/Fleche/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/AndroidStudioProjects/TP3/Fleche/.idea/compiler.xml b/AndroidStudioProjects/TP3/Fleche/.idea/compiler.xml new file mode 100644 index 0000000..b589d56 --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/.idea/compiler.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="CompilerConfiguration"> + <bytecodeTargetLevel target="17" /> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP3/Fleche/.idea/deploymentTargetSelector.xml b/AndroidStudioProjects/TP3/Fleche/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000..b268ef3 --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/.idea/deploymentTargetSelector.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="deploymentTargetSelector"> + <selectionStates> + <SelectionState runConfigName="app"> + <option name="selectionMode" value="DROPDOWN" /> + </SelectionState> + </selectionStates> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP3/Fleche/.idea/gradle.xml b/AndroidStudioProjects/TP3/Fleche/.idea/gradle.xml new file mode 100644 index 0000000..0897082 --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/.idea/gradle.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="GradleMigrationSettings" migrationVersion="1" /> + <component name="GradleSettings"> + <option name="linkedExternalProjectsSettings"> + <GradleProjectSettings> + <option name="externalProjectPath" value="$PROJECT_DIR$" /> + <option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" /> + <option name="modules"> + <set> + <option value="$PROJECT_DIR$" /> + <option value="$PROJECT_DIR$/app" /> + </set> + </option> + <option name="resolveExternalAnnotations" value="false" /> + </GradleProjectSettings> + </option> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP3/Fleche/.idea/migrations.xml b/AndroidStudioProjects/TP3/Fleche/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/.idea/migrations.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectMigrations"> + <option name="MigrateToGradleLocalJavaHome"> + <set> + <option value="$PROJECT_DIR$" /> + </set> + </option> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP3/Fleche/.idea/misc.xml b/AndroidStudioProjects/TP3/Fleche/.idea/misc.xml new file mode 100644 index 0000000..0ad17cb --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/.idea/misc.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ExternalStorageConfigurationManager" enabled="true" /> + <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK"> + <output url="file://$PROJECT_DIR$/build/classes" /> + </component> + <component name="ProjectType"> + <option name="id" value="Android" /> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP3/Fleche/app/.gitignore b/AndroidStudioProjects/TP3/Fleche/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/AndroidStudioProjects/TP3/Fleche/app/build.gradle b/AndroidStudioProjects/TP3/Fleche/app/build.gradle new file mode 100644 index 0000000..56f352b --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/app/build.gradle @@ -0,0 +1,38 @@ +plugins { + id 'com.android.application' +} + +android { + namespace 'com.example.fleche' + compileSdk 33 + + defaultConfig { + applicationId "com.example.fleche" + minSdk 19 + targetSdk 33 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + buildToolsVersion '34.0.0' +} + +dependencies { + + implementation 'com.google.android.material:material:1.5.0' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP3/Fleche/app/proguard-rules.pro b/AndroidStudioProjects/TP3/Fleche/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/AndroidStudioProjects/TP3/Fleche/app/src/androidTest/java/com/example/fleche/ExampleInstrumentedTest.java b/AndroidStudioProjects/TP3/Fleche/app/src/androidTest/java/com/example/fleche/ExampleInstrumentedTest.java new file mode 100644 index 0000000..f8f953a --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/app/src/androidTest/java/com/example/fleche/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.fleche; + +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.fleche", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP3/Fleche/app/src/main/AndroidManifest.xml b/AndroidStudioProjects/TP3/Fleche/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..a56f59f --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/app/src/main/AndroidManifest.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools"> + + <application + android:allowBackup="true" + android:dataExtractionRules="@xml/data_extraction_rules" + android:fullBackupContent="@xml/backup_rules" + android:icon="@mipmap/ic_launcher" + android:label="@string/app_name" + android:roundIcon="@mipmap/ic_launcher_round" + android:supportsRtl="true" + android:theme="@style/Theme.Fleche" + tools:targetApi="31"> + <activity + android:name=".MainActivity" + android:exported="true"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + </application> + +</manifest> \ No newline at end of file diff --git a/AndroidStudioProjects/TP3/Fleche/app/src/main/java/com/example/fleche/MainActivity.java b/AndroidStudioProjects/TP3/Fleche/app/src/main/java/com/example/fleche/MainActivity.java new file mode 100644 index 0000000..0857e11 --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/app/src/main/java/com/example/fleche/MainActivity.java @@ -0,0 +1,22 @@ +package com.example.fleche; + +import android.app.Activity; +import android.os.Bundle; +import android.widget.Button; + +public class MainActivity extends Activity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); // Assurez-vous que le layout est bien attaché + + // Récupération des boutons et de la vue personnalisée + Button boutongauche = findViewById(R.id.boutongauche); + Button boutondroit = findViewById(R.id.boutondroit); + VueImage vueImage = findViewById(R.id.image); + + // Lier les boutons à la vue personnalisée + vueImage.setButtons(boutongauche, boutondroit); + } +} diff --git a/AndroidStudioProjects/TP3/Fleche/app/src/main/java/com/example/fleche/VueImage.java b/AndroidStudioProjects/TP3/Fleche/app/src/main/java/com/example/fleche/VueImage.java new file mode 100644 index 0000000..79fc125 --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/app/src/main/java/com/example/fleche/VueImage.java @@ -0,0 +1,57 @@ +package com.example.fleche; + +import android.content.Context; +import android.content.res.Resources; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.graphics.Canvas; +import android.graphics.Paint; +import android.view.View; +import android.widget.Button; +import android.widget.ImageView; + +public class VueImage extends androidx.appcompat.widget.AppCompatImageView implements View.OnClickListener { + + Bitmap imagegauche; + Bitmap imagedroite; + int imageactuel = 0; + Paint turpentine = new Paint(); + private Button boutongauche; + private Button boutondroit; + + public VueImage(Context context) { + super(context); + // Initialisation des ressources + Resources res = this.getResources(); + this.imagegauche = BitmapFactory.decodeResource(res, R.drawable.fleche_gauche); + this.imagedroite = BitmapFactory.decodeResource(res, R.drawable.fleche_droite); + } + + // Méthode pour lier les boutons + public void setButtons(Button boutongauche, Button boutondroit) { + this.boutongauche = boutongauche; + this.boutondroit = boutondroit; + this.boutongauche.setOnClickListener(this); + this.boutondroit.setOnClickListener(this); + } + + @Override + protected void onDraw(Canvas canvas) { + super.onDraw(canvas); + if (imageactuel == 0) { + canvas.drawBitmap(imagegauche, this.getWidth() / 2 - imagegauche.getWidth() / 2, this.getHeight() / 2, turpentine); + } else { + canvas.drawBitmap(imagedroite, this.getWidth() / 2 - imagedroite.getWidth() / 2, this.getHeight() / 2, turpentine); + } + } + + @Override + public void onClick(View view) { + if (imageactuel == 0) { + imageactuel = 1; + } else { + imageactuel = 0; + } + this.invalidate(); // Invalider la vue pour forcer un redraw + } +} diff --git a/AndroidStudioProjects/TP3/Fleche/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:aapt="http://schemas.android.com/aapt" + android:width="108dp" + android:height="108dp" + android:viewportWidth="108" + android:viewportHeight="108"> + <path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z"> + <aapt:attr name="android:fillColor"> + <gradient + android:endX="85.84757" + android:endY="92.4963" + android:startX="42.9492" + android:startY="49.59793" + android:type="linear"> + <item + android:color="#44000000" + android:offset="0.0" /> + <item + android:color="#00000000" + android:offset="1.0" /> + </gradient> + </aapt:attr> + </path> + <path + android:fillColor="#FFFFFF" + android:fillType="nonZero" + android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z" + android:strokeWidth="1" + android:strokeColor="#00000000" /> +</vector> \ No newline at end of file diff --git a/AndroidStudioProjects/TP3/Fleche/app/src/main/res/drawable/fleche_droite.png b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/drawable/fleche_droite.png new file mode 100644 index 0000000..561d4b7 Binary files /dev/null and b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/drawable/fleche_droite.png differ diff --git a/AndroidStudioProjects/TP3/Fleche/app/src/main/res/drawable/fleche_gauche.png b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/drawable/fleche_gauche.png new file mode 100644 index 0000000..ad7ad39 Binary files /dev/null and b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/drawable/fleche_gauche.png differ diff --git a/AndroidStudioProjects/TP3/Fleche/app/src/main/res/drawable/ic_launcher_background.xml b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="108dp" + android:height="108dp" + android:viewportWidth="108" + android:viewportHeight="108"> + <path + android:fillColor="#3DDC84" + android:pathData="M0,0h108v108h-108z" /> + <path + android:fillColor="#00000000" + android:pathData="M9,0L9,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,0L19,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M29,0L29,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M39,0L39,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M49,0L49,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M59,0L59,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M69,0L69,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M79,0L79,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M89,0L89,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M99,0L99,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,9L108,9" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,19L108,19" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,29L108,29" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,39L108,39" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,49L108,49" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,59L108,59" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,69L108,69" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,79L108,79" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,89L108,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,99L108,99" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,29L89,29" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,39L89,39" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,49L89,49" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,59L89,59" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,69L89,69" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,79L89,79" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M29,19L29,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M39,19L39,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M49,19L49,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M59,19L59,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M69,19L69,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M79,19L79,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> +</vector> diff --git a/AndroidStudioProjects/TP3/Fleche/app/src/main/res/layout/activity_main.xml b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..dd50245 --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout 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"> + + <com.example.fleche.VueImage + android:id="@+id/image" + android:layout_height="1dp" + android:layout_width="match_parent" + android:layout_alignParentEnd="true" + android:layout_alignParentTop="true" + android:layout_alignParentStart="true" + android:layout_above="@+id/boutongauche" /> + + + + <Button + android:id="@+id/boutongauche" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="←" + android:textSize="50sp" + android:textAlignment="center" + android:layout_alignParentBottom="true" + /> + + + <Button + android:id="@+id/boutondroit" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:text="→" + android:textSize="50sp" + android:textAlignment="center" + android:layout_alignParentEnd="true" + android:layout_alignParentBottom="true" + /> + +</RelativeLayout> \ No newline at end of file diff --git a/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/ic_launcher_background" /> + <foreground android:drawable="@drawable/ic_launcher_foreground" /> + <monochrome android:drawable="@drawable/ic_launcher_foreground" /> +</adaptive-icon> \ No newline at end of file diff --git a/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/ic_launcher_background" /> + <foreground android:drawable="@drawable/ic_launcher_foreground" /> + <monochrome android:drawable="@drawable/ic_launcher_foreground" /> +</adaptive-icon> \ No newline at end of file diff --git a/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP3/Fleche/app/src/main/res/values-night/themes.xml b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..6946489 --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/values-night/themes.xml @@ -0,0 +1,7 @@ +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Base application theme. --> + <style name="Base.Theme.Fleche" parent="Theme.Material3.DayNight.NoActionBar"> + <!-- Customize your dark theme here. --> + <!-- <item name="colorPrimary">@color/my_dark_primary</item> --> + </style> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP3/Fleche/app/src/main/res/values/colors.xml b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..c8524cd --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/values/colors.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <color name="black">#FF000000</color> + <color name="white">#FFFFFFFF</color> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP3/Fleche/app/src/main/res/values/strings.xml b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..4e83a59 --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ +<resources> + <string name="app_name">Fleche</string> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP3/Fleche/app/src/main/res/values/themes.xml b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..fa78d7f --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/values/themes.xml @@ -0,0 +1,9 @@ +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Base application theme. --> + <style name="Base.Theme.Fleche" parent="Theme.Material3.DayNight.NoActionBar"> + <!-- Customize your light theme here. --> + <!-- <item name="colorPrimary">@color/my_light_primary</item> --> + </style> + + <style name="Theme.Fleche" parent="Base.Theme.Fleche" /> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP3/Fleche/app/src/main/res/xml/backup_rules.xml b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/xml/backup_rules.xml new file mode 100644 index 0000000..fa0f996 --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/xml/backup_rules.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + Sample backup rules file; uncomment and customize as necessary. + See https://developer.android.com/guide/topics/data/autobackup + for details. + Note: This file is ignored for devices older that API 31 + See https://developer.android.com/about/versions/12/backup-restore +--> +<full-backup-content> + <!-- + <include domain="sharedpref" path="."/> + <exclude domain="sharedpref" path="device.xml"/> +--> +</full-backup-content> \ No newline at end of file diff --git a/AndroidStudioProjects/TP3/Fleche/app/src/main/res/xml/data_extraction_rules.xml b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/xml/data_extraction_rules.xml new file mode 100644 index 0000000..9ee9997 --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/app/src/main/res/xml/data_extraction_rules.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + Sample data extraction rules file; uncomment and customize as necessary. + See https://developer.android.com/about/versions/12/backup-restore#xml-changes + for details. +--> +<data-extraction-rules> + <cloud-backup> + <!-- TODO: Use <include> and <exclude> to control what is backed up. + <include .../> + <exclude .../> + --> + </cloud-backup> + <!-- + <device-transfer> + <include .../> + <exclude .../> + </device-transfer> + --> +</data-extraction-rules> \ No newline at end of file diff --git a/AndroidStudioProjects/TP3/Fleche/app/src/test/java/com/example/fleche/ExampleUnitTest.java b/AndroidStudioProjects/TP3/Fleche/app/src/test/java/com/example/fleche/ExampleUnitTest.java new file mode 100644 index 0000000..d0194c5 --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/app/src/test/java/com/example/fleche/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package com.example.fleche; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP3/Fleche/build.gradle b/AndroidStudioProjects/TP3/Fleche/build.gradle new file mode 100644 index 0000000..a100ce0 --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/build.gradle @@ -0,0 +1,5 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + id 'com.android.application' version '8.0.2' apply false + id 'com.android.library' version '8.0.2' apply false +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP3/Fleche/gradle.properties b/AndroidStudioProjects/TP3/Fleche/gradle.properties new file mode 100644 index 0000000..3e927b1 --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/gradle.properties @@ -0,0 +1,21 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/AndroidStudioProjects/TP3/Fleche/gradle/wrapper/gradle-wrapper.jar b/AndroidStudioProjects/TP3/Fleche/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/AndroidStudioProjects/TP3/Fleche/gradle/wrapper/gradle-wrapper.jar differ diff --git a/AndroidStudioProjects/TP3/Fleche/gradle/wrapper/gradle-wrapper.properties b/AndroidStudioProjects/TP3/Fleche/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..7fb6724 --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Thu Feb 08 10:14:12 CET 2024 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/AndroidStudioProjects/TP3/Fleche/gradlew b/AndroidStudioProjects/TP3/Fleche/gradlew new file mode 100755 index 0000000..4f906e0 --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/AndroidStudioProjects/TP3/Fleche/gradlew.bat b/AndroidStudioProjects/TP3/Fleche/gradlew.bat new file mode 100644 index 0000000..ac1b06f --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/AndroidStudioProjects/TP3/Fleche/settings.gradle b/AndroidStudioProjects/TP3/Fleche/settings.gradle new file mode 100644 index 0000000..80419e9 --- /dev/null +++ b/AndroidStudioProjects/TP3/Fleche/settings.gradle @@ -0,0 +1,16 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} +rootProject.name = "Fleche" +include ':app' diff --git a/AndroidStudioProjects/TP4/Pois/.gitignore b/AndroidStudioProjects/TP4/Pois/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/.gitignore @@ -0,0 +1,15 @@ +*.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 +local.properties diff --git a/AndroidStudioProjects/TP4/Pois/.idea/.gitignore b/AndroidStudioProjects/TP4/Pois/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/AndroidStudioProjects/TP4/Pois/.idea/.name b/AndroidStudioProjects/TP4/Pois/.idea/.name new file mode 100644 index 0000000..b3405b3 --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/.idea/.name @@ -0,0 +1 @@ +My Application \ No newline at end of file diff --git a/AndroidStudioProjects/TP4/Pois/.idea/compiler.xml b/AndroidStudioProjects/TP4/Pois/.idea/compiler.xml new file mode 100644 index 0000000..b589d56 --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/.idea/compiler.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="CompilerConfiguration"> + <bytecodeTargetLevel target="17" /> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP4/Pois/.idea/deploymentTargetSelector.xml b/AndroidStudioProjects/TP4/Pois/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000..f6200d6 --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/.idea/deploymentTargetSelector.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="deploymentTargetSelector"> + <selectionStates> + <SelectionState runConfigName="app"> + <option name="selectionMode" value="DROPDOWN" /> + <DropdownSelection timestamp="2025-02-13T10:31:00.799698843Z"> + <Target type="DEFAULT_BOOT"> + <handle> + <DeviceId pluginId="PhysicalDevice" identifier="serial=310051aa57449200" /> + </handle> + </Target> + </DropdownSelection> + <DialogSelection /> + </SelectionState> + </selectionStates> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP4/Pois/.idea/gradle.xml b/AndroidStudioProjects/TP4/Pois/.idea/gradle.xml new file mode 100644 index 0000000..0897082 --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/.idea/gradle.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="GradleMigrationSettings" migrationVersion="1" /> + <component name="GradleSettings"> + <option name="linkedExternalProjectsSettings"> + <GradleProjectSettings> + <option name="externalProjectPath" value="$PROJECT_DIR$" /> + <option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" /> + <option name="modules"> + <set> + <option value="$PROJECT_DIR$" /> + <option value="$PROJECT_DIR$/app" /> + </set> + </option> + <option name="resolveExternalAnnotations" value="false" /> + </GradleProjectSettings> + </option> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP4/Pois/.idea/migrations.xml b/AndroidStudioProjects/TP4/Pois/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/.idea/migrations.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectMigrations"> + <option name="MigrateToGradleLocalJavaHome"> + <set> + <option value="$PROJECT_DIR$" /> + </set> + </option> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP4/Pois/.idea/misc.xml b/AndroidStudioProjects/TP4/Pois/.idea/misc.xml new file mode 100644 index 0000000..0ad17cb --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/.idea/misc.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ExternalStorageConfigurationManager" enabled="true" /> + <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK"> + <output url="file://$PROJECT_DIR$/build/classes" /> + </component> + <component name="ProjectType"> + <option name="id" value="Android" /> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP4/Pois/app/.gitignore b/AndroidStudioProjects/TP4/Pois/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/AndroidStudioProjects/TP4/Pois/app/build.gradle b/AndroidStudioProjects/TP4/Pois/app/build.gradle new file mode 100644 index 0000000..11e14ab --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/app/build.gradle @@ -0,0 +1,38 @@ +plugins { + id 'com.android.application' +} + +android { + namespace 'com.example.myapplication' + compileSdk 33 + + defaultConfig { + applicationId "com.example.myapplication" + minSdk 19 + targetSdk 33 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + buildToolsVersion '34.0.0' +} + +dependencies { + + implementation 'com.google.android.material:material:1.5.0' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP4/Pois/app/proguard-rules.pro b/AndroidStudioProjects/TP4/Pois/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/AndroidStudioProjects/TP4/Pois/app/src/androidTest/java/com/example/myapplication/ExampleInstrumentedTest.java b/AndroidStudioProjects/TP4/Pois/app/src/androidTest/java/com/example/myapplication/ExampleInstrumentedTest.java new file mode 100644 index 0000000..982ba51 --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/app/src/androidTest/java/com/example/myapplication/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.myapplication; + +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.myapplication", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP4/Pois/app/src/main/AndroidManifest.xml b/AndroidStudioProjects/TP4/Pois/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..eb47d4a --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/app/src/main/AndroidManifest.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools"> + + <application + android:allowBackup="true" + android:dataExtractionRules="@xml/data_extraction_rules" + android:fullBackupContent="@xml/backup_rules" + android:icon="@mipmap/ic_launcher" + android:label="@string/app_name" + android:roundIcon="@mipmap/ic_launcher_round" + android:supportsRtl="true" + android:theme="@style/Theme.MyApplication" + tools:targetApi="31"> + <activity + android:name=".MainActivity" + android:exported="true"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + </application> + +</manifest> \ No newline at end of file diff --git a/AndroidStudioProjects/TP4/Pois/app/src/main/java/com/example/myapplication/Fenetre.java b/AndroidStudioProjects/TP4/Pois/app/src/main/java/com/example/myapplication/Fenetre.java new file mode 100644 index 0000000..434c312 --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/app/src/main/java/com/example/myapplication/Fenetre.java @@ -0,0 +1,30 @@ +package com.example.myapplication; + +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Paint; +import android.view.View; + +public class Fenetre extends View { + + private Pois controleur; + Paint turpentinebleu = new Paint(); + + public Fenetre(Context context) { + super(context); + this.turpentinebleu.setARGB(255,0,0,255); + } + + public void setControleur(Pois control){ + this.controleur=control; + } + + @Override + protected void onDraw(Canvas canvas) { + super.onDraw(canvas); + if (this.controleur.getPoisX()==-1 || this.controleur.getPoisY()==-1){ + return; + } + canvas.drawCircle(this.controleur.getPoisX(),this.controleur.getPoisY(),20,turpentinebleu); + } +} diff --git a/AndroidStudioProjects/TP4/Pois/app/src/main/java/com/example/myapplication/MainActivity.java b/AndroidStudioProjects/TP4/Pois/app/src/main/java/com/example/myapplication/MainActivity.java new file mode 100644 index 0000000..afef805 --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/app/src/main/java/com/example/myapplication/MainActivity.java @@ -0,0 +1,20 @@ +package com.example.myapplication; + +import androidx.appcompat.app.AppCompatActivity; + +import android.app.Activity; +import android.os.Bundle; + +public class MainActivity extends Activity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + Fenetre vue = findViewById(R.id.vue); + Pois controleur = new Pois(); + controleur.setVue(vue); + vue.setControleur(controleur); + vue.setOnTouchListener(controleur); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP4/Pois/app/src/main/java/com/example/myapplication/Pois.java b/AndroidStudioProjects/TP4/Pois/app/src/main/java/com/example/myapplication/Pois.java new file mode 100644 index 0000000..054ef1c --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/app/src/main/java/com/example/myapplication/Pois.java @@ -0,0 +1,48 @@ +package com.example.myapplication; + +import android.content.Context; +import android.view.MotionEvent; +import android.view.View; + +public class Pois implements View.OnTouchListener { + + private Fenetre mavue; + private float x=-1; + private float y=-1; + + public Pois() { + } + + public void setVue(Fenetre vue){ + this.mavue=vue; + } + + public float getPoisX(){ + return this.x; + } + + public float getPoisY(){ + return this.y; + } + + @Override + public boolean onTouch(View v, MotionEvent e) { + int action = e.getActionMasked(); + if (action==MotionEvent.ACTION_DOWN){ + this.x=e.getX(0); + this.y=e.getY(0); + mavue.invalidate(); + } + if (action==MotionEvent.ACTION_UP){ + this.x=-1; + this.y=-1; + mavue.invalidate(); + } + if (action==MotionEvent.ACTION_MOVE){ + this.x=e.getX(0); + this.y=e.getY(0); + mavue.invalidate(); + } + return true; + } +} diff --git a/AndroidStudioProjects/TP4/Pois/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/AndroidStudioProjects/TP4/Pois/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:aapt="http://schemas.android.com/aapt" + android:width="108dp" + android:height="108dp" + android:viewportWidth="108" + android:viewportHeight="108"> + <path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z"> + <aapt:attr name="android:fillColor"> + <gradient + android:endX="85.84757" + android:endY="92.4963" + android:startX="42.9492" + android:startY="49.59793" + android:type="linear"> + <item + android:color="#44000000" + android:offset="0.0" /> + <item + android:color="#00000000" + android:offset="1.0" /> + </gradient> + </aapt:attr> + </path> + <path + android:fillColor="#FFFFFF" + android:fillType="nonZero" + android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z" + android:strokeWidth="1" + android:strokeColor="#00000000" /> +</vector> \ No newline at end of file diff --git a/AndroidStudioProjects/TP4/Pois/app/src/main/res/drawable/ic_launcher_background.xml b/AndroidStudioProjects/TP4/Pois/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="108dp" + android:height="108dp" + android:viewportWidth="108" + android:viewportHeight="108"> + <path + android:fillColor="#3DDC84" + android:pathData="M0,0h108v108h-108z" /> + <path + android:fillColor="#00000000" + android:pathData="M9,0L9,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,0L19,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M29,0L29,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M39,0L39,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M49,0L49,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M59,0L59,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M69,0L69,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M79,0L79,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M89,0L89,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M99,0L99,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,9L108,9" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,19L108,19" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,29L108,29" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,39L108,39" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,49L108,49" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,59L108,59" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,69L108,69" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,79L108,79" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,89L108,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,99L108,99" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,29L89,29" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,39L89,39" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,49L89,49" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,59L89,59" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,69L89,69" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,79L89,79" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M29,19L29,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M39,19L39,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M49,19L49,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M59,19L59,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M69,19L69,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M79,19L79,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> +</vector> diff --git a/AndroidStudioProjects/TP4/Pois/app/src/main/res/layout/activity_main.xml b/AndroidStudioProjects/TP4/Pois/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..ef3919c --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8"?> + +<RelativeLayout 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"> + + <com.example.myapplication.Fenetre + android:id="@+id/vue" + android:layout_width="match_parent" + android:layout_height="match_parent" /> + +</RelativeLayout> \ No newline at end of file diff --git a/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/ic_launcher_background" /> + <foreground android:drawable="@drawable/ic_launcher_foreground" /> + <monochrome android:drawable="@drawable/ic_launcher_foreground" /> +</adaptive-icon> \ No newline at end of file diff --git a/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/ic_launcher_background" /> + <foreground android:drawable="@drawable/ic_launcher_foreground" /> + <monochrome android:drawable="@drawable/ic_launcher_foreground" /> +</adaptive-icon> \ No newline at end of file diff --git a/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/AndroidStudioProjects/TP4/Pois/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP4/Pois/app/src/main/res/values-night/themes.xml b/AndroidStudioProjects/TP4/Pois/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..d25b0f2 --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/app/src/main/res/values-night/themes.xml @@ -0,0 +1,7 @@ +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Base application theme. --> + <style name="Base.Theme.MyApplication" parent="Theme.Material3.DayNight.NoActionBar"> + <!-- Customize your dark theme here. --> + <!-- <item name="colorPrimary">@color/my_dark_primary</item> --> + </style> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP4/Pois/app/src/main/res/values/colors.xml b/AndroidStudioProjects/TP4/Pois/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..c8524cd --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/app/src/main/res/values/colors.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <color name="black">#FF000000</color> + <color name="white">#FFFFFFFF</color> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP4/Pois/app/src/main/res/values/strings.xml b/AndroidStudioProjects/TP4/Pois/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..3de1a39 --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ +<resources> + <string name="app_name">My Application</string> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP4/Pois/app/src/main/res/values/themes.xml b/AndroidStudioProjects/TP4/Pois/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..d66ac09 --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/app/src/main/res/values/themes.xml @@ -0,0 +1,9 @@ +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Base application theme. --> + <style name="Base.Theme.MyApplication" parent="Theme.Material3.DayNight.NoActionBar"> + <!-- Customize your light theme here. --> + <!-- <item name="colorPrimary">@color/my_light_primary</item> --> + </style> + + <style name="Theme.MyApplication" parent="Base.Theme.MyApplication" /> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP4/Pois/app/src/main/res/xml/backup_rules.xml b/AndroidStudioProjects/TP4/Pois/app/src/main/res/xml/backup_rules.xml new file mode 100644 index 0000000..fa0f996 --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/app/src/main/res/xml/backup_rules.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + Sample backup rules file; uncomment and customize as necessary. + See https://developer.android.com/guide/topics/data/autobackup + for details. + Note: This file is ignored for devices older that API 31 + See https://developer.android.com/about/versions/12/backup-restore +--> +<full-backup-content> + <!-- + <include domain="sharedpref" path="."/> + <exclude domain="sharedpref" path="device.xml"/> +--> +</full-backup-content> \ No newline at end of file diff --git a/AndroidStudioProjects/TP4/Pois/app/src/main/res/xml/data_extraction_rules.xml b/AndroidStudioProjects/TP4/Pois/app/src/main/res/xml/data_extraction_rules.xml new file mode 100644 index 0000000..9ee9997 --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/app/src/main/res/xml/data_extraction_rules.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + Sample data extraction rules file; uncomment and customize as necessary. + See https://developer.android.com/about/versions/12/backup-restore#xml-changes + for details. +--> +<data-extraction-rules> + <cloud-backup> + <!-- TODO: Use <include> and <exclude> to control what is backed up. + <include .../> + <exclude .../> + --> + </cloud-backup> + <!-- + <device-transfer> + <include .../> + <exclude .../> + </device-transfer> + --> +</data-extraction-rules> \ No newline at end of file diff --git a/AndroidStudioProjects/TP4/Pois/app/src/test/java/com/example/myapplication/ExampleUnitTest.java b/AndroidStudioProjects/TP4/Pois/app/src/test/java/com/example/myapplication/ExampleUnitTest.java new file mode 100644 index 0000000..bf43ee5 --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/app/src/test/java/com/example/myapplication/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package com.example.myapplication; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP4/Pois/build.gradle b/AndroidStudioProjects/TP4/Pois/build.gradle new file mode 100644 index 0000000..a100ce0 --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/build.gradle @@ -0,0 +1,5 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + id 'com.android.application' version '8.0.2' apply false + id 'com.android.library' version '8.0.2' apply false +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP4/Pois/gradle.properties b/AndroidStudioProjects/TP4/Pois/gradle.properties new file mode 100644 index 0000000..3e927b1 --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/gradle.properties @@ -0,0 +1,21 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/AndroidStudioProjects/TP4/Pois/gradle/wrapper/gradle-wrapper.jar b/AndroidStudioProjects/TP4/Pois/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/AndroidStudioProjects/TP4/Pois/gradle/wrapper/gradle-wrapper.jar differ diff --git a/AndroidStudioProjects/TP4/Pois/gradle/wrapper/gradle-wrapper.properties b/AndroidStudioProjects/TP4/Pois/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..5658a5f --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Thu Feb 29 10:21:11 CET 2024 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/AndroidStudioProjects/TP4/Pois/gradlew b/AndroidStudioProjects/TP4/Pois/gradlew new file mode 100755 index 0000000..4f906e0 --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/AndroidStudioProjects/TP4/Pois/gradlew.bat b/AndroidStudioProjects/TP4/Pois/gradlew.bat new file mode 100644 index 0000000..ac1b06f --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/AndroidStudioProjects/TP4/Pois/settings.gradle b/AndroidStudioProjects/TP4/Pois/settings.gradle new file mode 100644 index 0000000..76a7c06 --- /dev/null +++ b/AndroidStudioProjects/TP4/Pois/settings.gradle @@ -0,0 +1,16 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} +rootProject.name = "My Application" +include ':app' diff --git a/AndroidStudioProjects/TP5/Reticule/.gitignore b/AndroidStudioProjects/TP5/Reticule/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/.gitignore @@ -0,0 +1,15 @@ +*.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 +local.properties diff --git a/AndroidStudioProjects/TP5/Reticule/.idea/.gitignore b/AndroidStudioProjects/TP5/Reticule/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/AndroidStudioProjects/TP5/Reticule/.idea/.name b/AndroidStudioProjects/TP5/Reticule/.idea/.name new file mode 100644 index 0000000..b3405b3 --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/.idea/.name @@ -0,0 +1 @@ +My Application \ No newline at end of file diff --git a/AndroidStudioProjects/TP5/Reticule/.idea/compiler.xml b/AndroidStudioProjects/TP5/Reticule/.idea/compiler.xml new file mode 100644 index 0000000..b589d56 --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/.idea/compiler.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="CompilerConfiguration"> + <bytecodeTargetLevel target="17" /> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP5/Reticule/.idea/deploymentTargetSelector.xml b/AndroidStudioProjects/TP5/Reticule/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000..b268ef3 --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/.idea/deploymentTargetSelector.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="deploymentTargetSelector"> + <selectionStates> + <SelectionState runConfigName="app"> + <option name="selectionMode" value="DROPDOWN" /> + </SelectionState> + </selectionStates> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP5/Reticule/.idea/gradle.xml b/AndroidStudioProjects/TP5/Reticule/.idea/gradle.xml new file mode 100644 index 0000000..0897082 --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/.idea/gradle.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="GradleMigrationSettings" migrationVersion="1" /> + <component name="GradleSettings"> + <option name="linkedExternalProjectsSettings"> + <GradleProjectSettings> + <option name="externalProjectPath" value="$PROJECT_DIR$" /> + <option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" /> + <option name="modules"> + <set> + <option value="$PROJECT_DIR$" /> + <option value="$PROJECT_DIR$/app" /> + </set> + </option> + <option name="resolveExternalAnnotations" value="false" /> + </GradleProjectSettings> + </option> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP5/Reticule/.idea/migrations.xml b/AndroidStudioProjects/TP5/Reticule/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/.idea/migrations.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectMigrations"> + <option name="MigrateToGradleLocalJavaHome"> + <set> + <option value="$PROJECT_DIR$" /> + </set> + </option> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP5/Reticule/.idea/misc.xml b/AndroidStudioProjects/TP5/Reticule/.idea/misc.xml new file mode 100644 index 0000000..0ad17cb --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/.idea/misc.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ExternalStorageConfigurationManager" enabled="true" /> + <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK"> + <output url="file://$PROJECT_DIR$/build/classes" /> + </component> + <component name="ProjectType"> + <option name="id" value="Android" /> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP5/Reticule/app/.gitignore b/AndroidStudioProjects/TP5/Reticule/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/AndroidStudioProjects/TP5/Reticule/app/build.gradle b/AndroidStudioProjects/TP5/Reticule/app/build.gradle new file mode 100644 index 0000000..b9283e2 --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/app/build.gradle @@ -0,0 +1,38 @@ +plugins { + id 'com.android.application' +} + +android { + namespace 'com.example.Reticule' + compileSdk 19 + + defaultConfig { + applicationId "com.example.Reticule" + minSdk 14 + targetSdk 31 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + buildToolsVersion '34.0.0' +} + +dependencies { + + implementation 'com.google.android.material:material:1.5.0' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP5/Reticule/app/proguard-rules.pro b/AndroidStudioProjects/TP5/Reticule/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/AndroidStudioProjects/TP5/Reticule/app/src/androidTest/java/com/example/Reticule/ExampleInstrumentedTest.java b/AndroidStudioProjects/TP5/Reticule/app/src/androidTest/java/com/example/Reticule/ExampleInstrumentedTest.java new file mode 100644 index 0000000..fa7c101 --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/app/src/androidTest/java/com/example/Reticule/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.Reticule; + +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.Reticule", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP5/Reticule/app/src/main/AndroidManifest.xml b/AndroidStudioProjects/TP5/Reticule/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..0eabba2 --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/app/src/main/AndroidManifest.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools"> + <uses-sdk tools:overrideLibrary="androidx.constraintlayout.widget" + ></uses-sdk> + + <application + android:allowBackup="true" + android:dataExtractionRules="@xml/data_extraction_rules" + android:fullBackupContent="@xml/backup_rules" + android:icon="@mipmap/ic_launcher" + android:label="@string/app_name" + android:roundIcon="@mipmap/ic_launcher_round" + android:supportsRtl="true" + android:theme="@style/Theme.MyApplication" + tools:targetApi="31"> + <activity + android:name=".MainActivity" + android:exported="true"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + </application> + +</manifest> \ No newline at end of file diff --git a/AndroidStudioProjects/TP5/Reticule/app/src/main/java/com/example/Reticule/Fenetre.java b/AndroidStudioProjects/TP5/Reticule/app/src/main/java/com/example/Reticule/Fenetre.java new file mode 100644 index 0000000..d9e7720 --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/app/src/main/java/com/example/Reticule/Fenetre.java @@ -0,0 +1,38 @@ +package com.example.Reticule; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Paint; +import android.util.AttributeSet; +import android.view.View; + +public class Fenetre extends View { + + protected Reticule controleur; + Paint turpentineorange = new Paint(); + + @SuppressLint("ClickableViewAccessibility") + public Fenetre(Context context, AttributeSet attrs) { + super(context, attrs); + this.turpentineorange.setARGB(255,255,95,21); + this.turpentineorange.setStyle(Paint.Style.STROKE); + this.turpentineorange.setStrokeWidth(10); + this.controleur = new Reticule(); + this.controleur.setVue(this); + this.setOnTouchListener(this.controleur); + } + + @Override + protected void onDraw(Canvas canvas) { + super.onDraw(canvas); + if (this.controleur.getReticuleX()==-1 || this.controleur.getReticuleY()==-1){ + return; + } + canvas.drawCircle(this.controleur.getReticuleX(),this.controleur.getReticuleY(),50,turpentineorange); + canvas.drawLine(this.controleur.getReticuleX(),this.controleur.getReticuleY(),this.controleur.getReticuleX()-80,this.controleur.getReticuleY(),turpentineorange); + canvas.drawLine(this.controleur.getReticuleX(),this.controleur.getReticuleY(),this.controleur.getReticuleX()+80,this.controleur.getReticuleY(),turpentineorange); + canvas.drawLine(this.controleur.getReticuleX(),this.controleur.getReticuleY(),this.controleur.getReticuleX(),this.controleur.getReticuleY()-80,turpentineorange); + canvas.drawLine(this.controleur.getReticuleX(),this.controleur.getReticuleY(),this.controleur.getReticuleX(),this.controleur.getReticuleY()+80,turpentineorange); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP5/Reticule/app/src/main/java/com/example/Reticule/MainActivity.java b/AndroidStudioProjects/TP5/Reticule/app/src/main/java/com/example/Reticule/MainActivity.java new file mode 100644 index 0000000..097bb38 --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/app/src/main/java/com/example/Reticule/MainActivity.java @@ -0,0 +1,31 @@ +package com.example.Reticule; + +import android.app.Activity; +import android.os.Bundle; + +import androidx.annotation.NonNull; + +public class MainActivity extends Activity { + private Fenetre vue; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + this.vue = (Fenetre) findViewById(R.id.vuee); + } + + @Override + public void onSaveInstanceState(@NonNull Bundle outState) { + super.onSaveInstanceState(outState); + outState.putFloat("x", this.vue.controleur.getReticuleX()); + outState.putFloat("x", this.vue.controleur.getReticuleY()); + } + + @Override + public void onRestoreInstanceState(@NonNull Bundle savedInstanceState){ + super.onRestoreInstanceState(savedInstanceState); + this.vue.controleur.setReticuleX(savedInstanceState.getFloat("x")); + this.vue.controleur.setReticuleY(savedInstanceState.getFloat("y")); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP5/Reticule/app/src/main/java/com/example/Reticule/Reticule.java b/AndroidStudioProjects/TP5/Reticule/app/src/main/java/com/example/Reticule/Reticule.java new file mode 100644 index 0000000..092d030 --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/app/src/main/java/com/example/Reticule/Reticule.java @@ -0,0 +1,57 @@ +package com.example.Reticule; + +import android.annotation.SuppressLint; +import android.view.MotionEvent; +import android.view.View; + +public class Reticule implements View.OnTouchListener { + + private Fenetre mavue; + private float x=-1; + private float y=-1; + + public Reticule() { + } + + public void setVue(Fenetre vue){ + this.mavue = vue; + } + + public float getReticuleX(){ + return this.x; + } + + public float getReticuleY(){ + return this.y; + } + + public void setReticuleX(float X){ + this.x = X; + } + + public void setReticuleY(float Y){ + this.y = Y; + } + + @SuppressLint("ClickableViewAccessibility") + @Override + public boolean onTouch(View v, MotionEvent e) { + int action = e.getActionMasked(); + if (action==MotionEvent.ACTION_DOWN){ + this.x=e.getX(0); + this.y=e.getY(0); + mavue.invalidate(); + } + if (action==MotionEvent.ACTION_UP){ + this.x=-1; + this.y=-1; + mavue.invalidate(); + } + if (action==MotionEvent.ACTION_MOVE){ + this.x=e.getX(0); + this.y=e.getY(0); + mavue.invalidate(); + } + return true; + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP5/Reticule/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:aapt="http://schemas.android.com/aapt" + android:width="108dp" + android:height="108dp" + android:viewportWidth="108" + android:viewportHeight="108"> + <path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z"> + <aapt:attr name="android:fillColor"> + <gradient + android:endX="85.84757" + android:endY="92.4963" + android:startX="42.9492" + android:startY="49.59793" + android:type="linear"> + <item + android:color="#44000000" + android:offset="0.0" /> + <item + android:color="#00000000" + android:offset="1.0" /> + </gradient> + </aapt:attr> + </path> + <path + android:fillColor="#FFFFFF" + android:fillType="nonZero" + android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z" + android:strokeWidth="1" + android:strokeColor="#00000000" /> +</vector> \ No newline at end of file diff --git a/AndroidStudioProjects/TP5/Reticule/app/src/main/res/drawable/ic_launcher_background.xml b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="108dp" + android:height="108dp" + android:viewportWidth="108" + android:viewportHeight="108"> + <path + android:fillColor="#3DDC84" + android:pathData="M0,0h108v108h-108z" /> + <path + android:fillColor="#00000000" + android:pathData="M9,0L9,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,0L19,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M29,0L29,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M39,0L39,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M49,0L49,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M59,0L59,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M69,0L69,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M79,0L79,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M89,0L89,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M99,0L99,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,9L108,9" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,19L108,19" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,29L108,29" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,39L108,39" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,49L108,49" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,59L108,59" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,69L108,69" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,79L108,79" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,89L108,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,99L108,99" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,29L89,29" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,39L89,39" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,49L89,49" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,59L89,59" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,69L89,69" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,79L89,79" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M29,19L29,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M39,19L39,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M49,19L49,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M59,19L59,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M69,19L69,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M79,19L79,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> +</vector> diff --git a/AndroidStudioProjects/TP5/Reticule/app/src/main/res/layout/activity_main.xml b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..ed1862f --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout 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" + tools:context=".MainActivity"> + + <com.example.Reticule.Fenetre + android:layout_height="match_parent" + android:layout_width="match_parent" + android:id="@+id/vuee"> + </com.example.Reticule.Fenetre> + +</RelativeLayout> \ No newline at end of file diff --git a/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/ic_launcher_background" /> + <foreground android:drawable="@drawable/ic_launcher_foreground" /> + <monochrome android:drawable="@drawable/ic_launcher_foreground" /> +</adaptive-icon> \ No newline at end of file diff --git a/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/ic_launcher_background" /> + <foreground android:drawable="@drawable/ic_launcher_foreground" /> + <monochrome android:drawable="@drawable/ic_launcher_foreground" /> +</adaptive-icon> \ No newline at end of file diff --git a/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP5/Reticule/app/src/main/res/values-night/themes.xml b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..d25b0f2 --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/values-night/themes.xml @@ -0,0 +1,7 @@ +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Base application theme. --> + <style name="Base.Theme.MyApplication" parent="Theme.Material3.DayNight.NoActionBar"> + <!-- Customize your dark theme here. --> + <!-- <item name="colorPrimary">@color/my_dark_primary</item> --> + </style> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP5/Reticule/app/src/main/res/values/colors.xml b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..c8524cd --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/values/colors.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <color name="black">#FF000000</color> + <color name="white">#FFFFFFFF</color> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP5/Reticule/app/src/main/res/values/strings.xml b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..3de1a39 --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ +<resources> + <string name="app_name">My Application</string> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP5/Reticule/app/src/main/res/values/themes.xml b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..d66ac09 --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/values/themes.xml @@ -0,0 +1,9 @@ +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Base application theme. --> + <style name="Base.Theme.MyApplication" parent="Theme.Material3.DayNight.NoActionBar"> + <!-- Customize your light theme here. --> + <!-- <item name="colorPrimary">@color/my_light_primary</item> --> + </style> + + <style name="Theme.MyApplication" parent="Base.Theme.MyApplication" /> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP5/Reticule/app/src/main/res/xml/backup_rules.xml b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/xml/backup_rules.xml new file mode 100644 index 0000000..fa0f996 --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/xml/backup_rules.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + Sample backup rules file; uncomment and customize as necessary. + See https://developer.android.com/guide/topics/data/autobackup + for details. + Note: This file is ignored for devices older that API 31 + See https://developer.android.com/about/versions/12/backup-restore +--> +<full-backup-content> + <!-- + <include domain="sharedpref" path="."/> + <exclude domain="sharedpref" path="device.xml"/> +--> +</full-backup-content> \ No newline at end of file diff --git a/AndroidStudioProjects/TP5/Reticule/app/src/main/res/xml/data_extraction_rules.xml b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/xml/data_extraction_rules.xml new file mode 100644 index 0000000..9ee9997 --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/app/src/main/res/xml/data_extraction_rules.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + Sample data extraction rules file; uncomment and customize as necessary. + See https://developer.android.com/about/versions/12/backup-restore#xml-changes + for details. +--> +<data-extraction-rules> + <cloud-backup> + <!-- TODO: Use <include> and <exclude> to control what is backed up. + <include .../> + <exclude .../> + --> + </cloud-backup> + <!-- + <device-transfer> + <include .../> + <exclude .../> + </device-transfer> + --> +</data-extraction-rules> \ No newline at end of file diff --git a/AndroidStudioProjects/TP5/Reticule/app/src/test/java/com/example/Reticule/ExampleUnitTest.java b/AndroidStudioProjects/TP5/Reticule/app/src/test/java/com/example/Reticule/ExampleUnitTest.java new file mode 100644 index 0000000..4b8ca6f --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/app/src/test/java/com/example/Reticule/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package com.example.Reticule; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP5/Reticule/build.gradle b/AndroidStudioProjects/TP5/Reticule/build.gradle new file mode 100644 index 0000000..a100ce0 --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/build.gradle @@ -0,0 +1,5 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + id 'com.android.application' version '8.0.2' apply false + id 'com.android.library' version '8.0.2' apply false +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP5/Reticule/gradle.properties b/AndroidStudioProjects/TP5/Reticule/gradle.properties new file mode 100644 index 0000000..3e927b1 --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/gradle.properties @@ -0,0 +1,21 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/AndroidStudioProjects/TP5/Reticule/gradle/wrapper/gradle-wrapper.jar b/AndroidStudioProjects/TP5/Reticule/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/AndroidStudioProjects/TP5/Reticule/gradle/wrapper/gradle-wrapper.jar differ diff --git a/AndroidStudioProjects/TP5/Reticule/gradle/wrapper/gradle-wrapper.properties b/AndroidStudioProjects/TP5/Reticule/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..7fc3169 --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Thu Mar 07 10:15:58 CET 2024 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/AndroidStudioProjects/TP5/Reticule/gradlew b/AndroidStudioProjects/TP5/Reticule/gradlew new file mode 100755 index 0000000..4f906e0 --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/AndroidStudioProjects/TP5/Reticule/gradlew.bat b/AndroidStudioProjects/TP5/Reticule/gradlew.bat new file mode 100644 index 0000000..ac1b06f --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/AndroidStudioProjects/TP5/Reticule/settings.gradle b/AndroidStudioProjects/TP5/Reticule/settings.gradle new file mode 100644 index 0000000..76a7c06 --- /dev/null +++ b/AndroidStudioProjects/TP5/Reticule/settings.gradle @@ -0,0 +1,16 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} +rootProject.name = "My Application" +include ':app' diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/.gitignore b/AndroidStudioProjects/TP6/Desoxyribonucleique/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/.gitignore @@ -0,0 +1,15 @@ +*.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 +local.properties diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/.idea/.gitignore b/AndroidStudioProjects/TP6/Desoxyribonucleique/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/.idea/compiler.xml b/AndroidStudioProjects/TP6/Desoxyribonucleique/.idea/compiler.xml new file mode 100644 index 0000000..b589d56 --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/.idea/compiler.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="CompilerConfiguration"> + <bytecodeTargetLevel target="17" /> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/.idea/gradle.xml b/AndroidStudioProjects/TP6/Desoxyribonucleique/.idea/gradle.xml new file mode 100644 index 0000000..a2d7c21 --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/.idea/gradle.xml @@ -0,0 +1,19 @@ +<?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> + </GradleProjectSettings> + </option> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/.idea/misc.xml b/AndroidStudioProjects/TP6/Desoxyribonucleique/.idea/misc.xml new file mode 100644 index 0000000..8978d23 --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/.idea/misc.xml @@ -0,0 +1,9 @@ +<project version="4"> + <component name="ExternalStorageConfigurationManager" enabled="true" /> + <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK"> + <output url="file://$PROJECT_DIR$/build/classes" /> + </component> + <component name="ProjectType"> + <option name="id" value="Android" /> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/.gitignore b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/build.gradle b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/build.gradle new file mode 100644 index 0000000..90e5e76 --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/build.gradle @@ -0,0 +1,40 @@ +plugins { + id 'com.android.application' +} + +android { + namespace 'com.example.Desoxyribonucleique' + compileSdk 33 + + defaultConfig { + applicationId "com.example.Desoxyribonucleique" + minSdk 19 + targetSdk 33 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + buildToolsVersion '34.0.0' +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.6.1' + implementation 'com.google.android.material:material:1.5.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/proguard-rules.pro b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/androidTest/java/com/example/Desoxyribonucleique/ExampleInstrumentedTest.java b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/androidTest/java/com/example/Desoxyribonucleique/ExampleInstrumentedTest.java new file mode 100644 index 0000000..a968a26 --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/androidTest/java/com/example/Desoxyribonucleique/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.Desoxyribonucleique; + +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.Desoxyribonucleique", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/AndroidManifest.xml b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..0da42e0 --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/AndroidManifest.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools"> + + <application + android:allowBackup="true" + android:dataExtractionRules="@xml/data_extraction_rules" + android:fullBackupContent="@xml/backup_rules" + android:icon="@mipmap/ic_launcher" + android:label="@string/app_name" + android:roundIcon="@mipmap/ic_launcher_round" + android:supportsRtl="true" + android:theme="@style/Theme.Desoxyribonucleique" + tools:targetApi="31"> + <activity + android:name=".MainActivity" + android:exported="true"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + </application> + +</manifest> \ No newline at end of file diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/java/com/example/Desoxyribonucleique/MainActivity.java b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/java/com/example/Desoxyribonucleique/MainActivity.java new file mode 100644 index 0000000..f27acbc --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/java/com/example/Desoxyribonucleique/MainActivity.java @@ -0,0 +1,35 @@ +package com.example.Desoxyribonucleique; + +import androidx.appcompat.app.AppCompatActivity; + +import android.content.Intent; +import android.os.Bundle; +import android.view.Menu; +import android.view.MenuItem; + +public class MainActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + this.getMenuInflater().inflate(R.menu.menu_liste, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int id = item.getItemId(); + + if (id==R.id.option){ + this.startActivity(new Intent(this, SettingsActivity.class)); + return true; + } + + return super .onOptionsItemSelected(item); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/java/com/example/Desoxyribonucleique/SettingsActivity.java b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/java/com/example/Desoxyribonucleique/SettingsActivity.java new file mode 100644 index 0000000..554edb9 --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/java/com/example/Desoxyribonucleique/SettingsActivity.java @@ -0,0 +1,12 @@ +package com.example.Desoxyribonucleique; + +import android.os.Bundle; +import android.preference.PreferenceActivity; + +public class SettingsActivity extends PreferenceActivity { + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + this.addPreferencesFromResource(R.xml.preference); + } +} diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:aapt="http://schemas.android.com/aapt" + android:width="108dp" + android:height="108dp" + android:viewportWidth="108" + android:viewportHeight="108"> + <path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z"> + <aapt:attr name="android:fillColor"> + <gradient + android:endX="85.84757" + android:endY="92.4963" + android:startX="42.9492" + android:startY="49.59793" + android:type="linear"> + <item + android:color="#44000000" + android:offset="0.0" /> + <item + android:color="#00000000" + android:offset="1.0" /> + </gradient> + </aapt:attr> + </path> + <path + android:fillColor="#FFFFFF" + android:fillType="nonZero" + android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z" + android:strokeWidth="1" + android:strokeColor="#00000000" /> +</vector> \ No newline at end of file diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/drawable/ic_launcher_background.xml b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="108dp" + android:height="108dp" + android:viewportWidth="108" + android:viewportHeight="108"> + <path + android:fillColor="#3DDC84" + android:pathData="M0,0h108v108h-108z" /> + <path + android:fillColor="#00000000" + android:pathData="M9,0L9,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,0L19,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M29,0L29,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M39,0L39,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M49,0L49,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M59,0L59,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M69,0L69,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M79,0L79,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M89,0L89,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M99,0L99,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,9L108,9" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,19L108,19" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,29L108,29" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,39L108,39" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,49L108,49" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,59L108,59" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,69L108,69" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,79L108,79" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,89L108,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,99L108,99" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,29L89,29" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,39L89,39" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,49L89,49" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,59L89,59" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,69L89,69" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,79L89,79" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M29,19L29,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M39,19L39,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M49,19L49,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M59,19L59,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M69,19L69,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M79,19L79,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> +</vector> diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/layout/activity_main.xml b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..5398484 --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,80 @@ +<?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"> + + <RelativeLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:paddingLeft="40dp" + android:paddingRight="40dp" + android:paddingBottom="40dp" + android:paddingTop="200dp"> + + <RelativeLayout + android:layout_width="1dp" + android:layout_height="1dp" + android:padding="40dp" + android:layout_above="@id/text" + android:layout_alignParentLeft="true" + android:layout_alignParentRight="true" + android:layout_alignParentTop="true"> + + <Button + android:id="@+id/A" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentTop="true" + android:layout_alignParentLeft="true" + android:layout_toRightOf="@id/T" + android:text="A" + android:textSize="50dp"> + </Button> + + <Button + android:id="@+id/T" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentTop="true" + android:layout_alignParentRight="true" + android:text="T" + android:textSize="50dp"> + </Button> + + <Button + android:id="@+id/C" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentLeft="true" + android:layout_alignParentBottom="true" + android:layout_toRightOf="@id/G" + android:text="C" + android:textSize="50dp"> + </Button> + + <Button + android:id="@+id/G" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentRight="true" + android:layout_alignParentBottom="true" + android:text="G" + android:textSize="50dp"> + </Button> + </RelativeLayout> + + <TextView + android:id="@+id/text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentRight="true" + android:layout_alignParentLeft="true" + android:layout_alignParentBottom="true" + android:textSize="30dp"> + </TextView> + </RelativeLayout> + +</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/menu/menu_liste.xml b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/menu/menu_liste.xml new file mode 100644 index 0000000..f181501 --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/menu/menu_liste.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu 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"> + <item + android:id="@+id/option" + android:title="@string/option" + android:orderInCategory="100" + app:showAsAction="never"/> +</menu> \ No newline at end of file diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/ic_launcher_background" /> + <foreground android:drawable="@drawable/ic_launcher_foreground" /> + <monochrome android:drawable="@drawable/ic_launcher_foreground" /> +</adaptive-icon> \ No newline at end of file diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/ic_launcher_background" /> + <foreground android:drawable="@drawable/ic_launcher_foreground" /> + <monochrome android:drawable="@drawable/ic_launcher_foreground" /> +</adaptive-icon> \ No newline at end of file diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/values-night/themes.xml b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..a15a299 --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/values-night/themes.xml @@ -0,0 +1,7 @@ +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Base application theme. --> + <style name="Base.Theme.Desoxyribonucleique" parent="Theme.Material3.DayNight.NoActionBar"> + <!-- Customize your dark theme here. --> + <!-- <item name="colorPrimary">@color/my_dark_primary</item> --> + </style> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/values/arrays.xml b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/values/arrays.xml new file mode 100644 index 0000000..7b64574 --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/values/arrays.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <string-array name="Couleurs"> + <item>@string/bleu</item> + <item>@string/jaune</item> + <item>@string/rouge</item> + </string-array> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/values/colors.xml b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..f49cff0 --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/values/colors.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <color name="black">#FF000000</color> + <color name="white">#FFFFFFFF</color> + <color name="bleu">#FF0000FF</color> + <color name="rouge">#FFFF0000</color> + <color name="jaune">#FFFFFF00</color> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/values/strings.xml b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..8c6bf29 --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/values/strings.xml @@ -0,0 +1,13 @@ +<resources> + <string name="app_name">Desoxyribonucleique</string> + <string name="option">Options :</string> + <string name="A">Activer bouton A</string> + <string name="T">Activer bouton T</string> + <string name="C">Activer bouton C</string> + <string name="G">Activer bouton G</string> + <string name="fond">Choisir la couleur de fond</string> + <string name="bleu">Mettre le fond en bleu</string> + <string name="jaune">Mettre le fond en jaune</string> + <string name="rouge">Mettre le fond en rouge</string> + +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/values/themes.xml b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..987c8a6 --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/values/themes.xml @@ -0,0 +1,9 @@ +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Base application theme. --> + <style name="Base.Theme.Desoxyribonucleique" parent="Theme.Material3.DayNight.NoActionBar"> + <!-- Customize your light theme here. --> + <!-- <item name="colorPrimary">@color/my_light_primary</item> --> + </style> + + <style name="Theme.Desoxyribonucleique" parent="Base.Theme.Desoxyribonucleique" /> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/xml/backup_rules.xml b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/xml/backup_rules.xml new file mode 100644 index 0000000..fa0f996 --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/xml/backup_rules.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + Sample backup rules file; uncomment and customize as necessary. + See https://developer.android.com/guide/topics/data/autobackup + for details. + Note: This file is ignored for devices older that API 31 + See https://developer.android.com/about/versions/12/backup-restore +--> +<full-backup-content> + <!-- + <include domain="sharedpref" path="."/> + <exclude domain="sharedpref" path="device.xml"/> +--> +</full-backup-content> \ No newline at end of file diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/xml/data_extraction_rules.xml b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/xml/data_extraction_rules.xml new file mode 100644 index 0000000..9ee9997 --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/xml/data_extraction_rules.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + Sample data extraction rules file; uncomment and customize as necessary. + See https://developer.android.com/about/versions/12/backup-restore#xml-changes + for details. +--> +<data-extraction-rules> + <cloud-backup> + <!-- TODO: Use <include> and <exclude> to control what is backed up. + <include .../> + <exclude .../> + --> + </cloud-backup> + <!-- + <device-transfer> + <include .../> + <exclude .../> + </device-transfer> + --> +</data-extraction-rules> \ No newline at end of file diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/xml/preference.xml b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/xml/preference.xml new file mode 100644 index 0000000..762e7e3 --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/main/res/xml/preference.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="utf-8"?> +<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> + <PreferenceCategory + android:title="@string/option" + android:key="pref_desoxy_groupe"> + <CheckBoxPreference + android:title="@string/A" + android:key="boutonA" + android:defaultValue="true"/> + <CheckBoxPreference + android:title="@string/T" + android:key="boutonA" + android:defaultValue="true"/> + <CheckBoxPreference + android:title="@string/C" + android:key="boutonA" + android:defaultValue="true"/> + <CheckBoxPreference + android:title="@string/G" + android:key="boutonA" + android:defaultValue="true"/> + <ListPreference + android:title="@string/fond" + android:key="fond" + android:dialogTitle="@string/app_name" + android:entries="@array/Couleurs" + android:entryValues="@array/Couleurs" + android:defaultValue="@string/bleu"/> + </PreferenceCategory> +</PreferenceScreen> \ No newline at end of file diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/test/java/com/example/Desoxyribonucleique/ExampleUnitTest.java b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/test/java/com/example/Desoxyribonucleique/ExampleUnitTest.java new file mode 100644 index 0000000..9724ca7 --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/app/src/test/java/com/example/Desoxyribonucleique/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package com.example.Desoxyribonucleique; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/build.gradle b/AndroidStudioProjects/TP6/Desoxyribonucleique/build.gradle new file mode 100644 index 0000000..a100ce0 --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/build.gradle @@ -0,0 +1,5 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + id 'com.android.application' version '8.0.2' apply false + id 'com.android.library' version '8.0.2' apply false +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/gradle.properties b/AndroidStudioProjects/TP6/Desoxyribonucleique/gradle.properties new file mode 100644 index 0000000..3e927b1 --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/gradle.properties @@ -0,0 +1,21 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/gradle/wrapper/gradle-wrapper.jar b/AndroidStudioProjects/TP6/Desoxyribonucleique/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/AndroidStudioProjects/TP6/Desoxyribonucleique/gradle/wrapper/gradle-wrapper.jar differ diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/gradle/wrapper/gradle-wrapper.properties b/AndroidStudioProjects/TP6/Desoxyribonucleique/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..bf5c6b5 --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Thu Mar 14 10:07:17 CET 2024 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/gradlew b/AndroidStudioProjects/TP6/Desoxyribonucleique/gradlew new file mode 100755 index 0000000..4f906e0 --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/gradlew.bat b/AndroidStudioProjects/TP6/Desoxyribonucleique/gradlew.bat new file mode 100644 index 0000000..ac1b06f --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/AndroidStudioProjects/TP6/Desoxyribonucleique/settings.gradle b/AndroidStudioProjects/TP6/Desoxyribonucleique/settings.gradle new file mode 100644 index 0000000..d33664f --- /dev/null +++ b/AndroidStudioProjects/TP6/Desoxyribonucleique/settings.gradle @@ -0,0 +1,16 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} +rootProject.name = "Desoxyribonucleique" +include ':app' diff --git a/AndroidStudioProjects/TP7/Couleurs/.gitignore b/AndroidStudioProjects/TP7/Couleurs/.gitignore new file mode 100755 index 0000000..c6cbe56 --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/.gitignore @@ -0,0 +1,8 @@ +*.iml +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures diff --git a/AndroidStudioProjects/TP7/Couleurs/.idea/.gitignore b/AndroidStudioProjects/TP7/Couleurs/.idea/.gitignore new file mode 100755 index 0000000..26d3352 --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/AndroidStudioProjects/TP7/Couleurs/.idea/caches/build_file_checksums.ser b/AndroidStudioProjects/TP7/Couleurs/.idea/caches/build_file_checksums.ser new file mode 100755 index 0000000..49bc20a Binary files /dev/null and b/AndroidStudioProjects/TP7/Couleurs/.idea/caches/build_file_checksums.ser differ diff --git a/AndroidStudioProjects/TP7/Couleurs/.idea/codeStyles/Project.xml b/AndroidStudioProjects/TP7/Couleurs/.idea/codeStyles/Project.xml new file mode 100755 index 0000000..30aa626 --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/.idea/codeStyles/Project.xml @@ -0,0 +1,29 @@ +<component name="ProjectCodeStyleConfiguration"> + <code_scheme name="Project" version="173"> + <Objective-C-extensions> + <file> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" /> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" /> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" /> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" /> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" /> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" /> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" /> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" /> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" /> + </file> + <class> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" /> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" /> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" /> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" /> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" /> + <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" /> + </class> + <extensions> + <pair source="cpp" header="h" fileNamingConvention="NONE" /> + <pair source="c" header="h" fileNamingConvention="NONE" /> + </extensions> + </Objective-C-extensions> + </code_scheme> +</component> \ No newline at end of file diff --git a/AndroidStudioProjects/TP7/Couleurs/.idea/compiler.xml b/AndroidStudioProjects/TP7/Couleurs/.idea/compiler.xml new file mode 100644 index 0000000..3cd2840 --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/.idea/compiler.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="CompilerConfiguration"> + <wildcardResourcePatterns> + <entry name="!?*.java" /> + <entry name="!?*.form" /> + <entry name="!?*.class" /> + <entry name="!?*.groovy" /> + <entry name="!?*.scala" /> + <entry name="!?*.flex" /> + <entry name="!?*.kt" /> + <entry name="!?*.clj" /> + </wildcardResourcePatterns> + <bytecodeTargetLevel target="17" /> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP7/Couleurs/.idea/encodings.xml b/AndroidStudioProjects/TP7/Couleurs/.idea/encodings.xml new file mode 100755 index 0000000..97626ba --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/.idea/encodings.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="Encoding"> + <file url="PROJECT" charset="UTF-8" /> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP7/Couleurs/.idea/gradle.xml b/AndroidStudioProjects/TP7/Couleurs/.idea/gradle.xml new file mode 100644 index 0000000..4b1e25c --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/.idea/gradle.xml @@ -0,0 +1,21 @@ +<?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="gradleHome" value="/usr/share/java/gradle" /> + <option name="gradleJvm" value="Embedded JDK" /> + <option name="modules"> + <set> + <option value="$PROJECT_DIR$" /> + <option value="$PROJECT_DIR$/app" /> + </set> + </option> + </GradleProjectSettings> + </option> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP7/Couleurs/.idea/jarRepositories.xml b/AndroidStudioProjects/TP7/Couleurs/.idea/jarRepositories.xml new file mode 100755 index 0000000..6d3ee29 --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/.idea/jarRepositories.xml @@ -0,0 +1,40 @@ +<?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> + <remote-repository> + <option name="id" value="/opt/sdk/extras/m2repository" /> + <option name="name" value="/opt/sdk/extras/m2repository" /> + <option name="url" value="file:/opt/sdk/extras/m2repository" /> + </remote-repository> + <remote-repository> + <option name="id" value="/opt/sdk/extras/android/m2repository" /> + <option name="name" value="/opt/sdk/extras/android/m2repository" /> + <option name="url" value="file:/opt/sdk/extras/android/m2repository" /> + </remote-repository> + <remote-repository> + <option name="id" value="/opt/sdk/extras/google/m2repository" /> + <option name="name" value="/opt/sdk/extras/google/m2repository" /> + <option name="url" value="file:/opt/sdk/extras/google/m2repository" /> + </remote-repository> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP7/Couleurs/.idea/misc.xml b/AndroidStudioProjects/TP7/Couleurs/.idea/misc.xml new file mode 100644 index 0000000..b911fac --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/.idea/misc.xml @@ -0,0 +1,18 @@ +<project version="4"> + <component name="BuildAttributionWarningsFilter"> + <option name="noGCSettingWarning" value="true" /> + </component> + <component name="DesignSurface"> + <option name="filePathToZoomLevelMap"> + <map> + <entry key="app/src/main/res/menu/menu_liste.xml" value="0.3625" /> + </map> + </option> + </component> + <component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="jbr-17" project-jdk-type="JavaSDK"> + <output url="file://$PROJECT_DIR$/build/classes" /> + </component> + <component name="ProjectType"> + <option name="id" value="Android" /> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP7/Couleurs/.idea/modules.xml b/AndroidStudioProjects/TP7/Couleurs/.idea/modules.xml new file mode 100644 index 0000000..33f8fea --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/.idea/modules.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectModuleManager"> + <modules> + <module fileurl="file://$PROJECT_DIR$/Couleurs.iml" filepath="$PROJECT_DIR$/Couleurs.iml" /> + <module fileurl="file://$PROJECT_DIR$/.idea/modules/app/Couleurs.app.iml" filepath="$PROJECT_DIR$/.idea/modules/app/Couleurs.app.iml" /> + <module fileurl="file://$PROJECT_DIR$/.idea/modules/app/Couleurs.app.androidTest.iml" filepath="$PROJECT_DIR$/.idea/modules/app/Couleurs.app.androidTest.iml" /> + <module fileurl="file://$PROJECT_DIR$/.idea/modules/app/Couleurs.app.main.iml" filepath="$PROJECT_DIR$/.idea/modules/app/Couleurs.app.main.iml" /> + <module fileurl="file://$PROJECT_DIR$/.idea/modules/app/Couleurs.app.unitTest.iml" filepath="$PROJECT_DIR$/.idea/modules/app/Couleurs.app.unitTest.iml" /> + </modules> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/TP7/Couleurs/app/.gitignore b/AndroidStudioProjects/TP7/Couleurs/app/.gitignore new file mode 100755 index 0000000..796b96d --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/AndroidStudioProjects/TP7/Couleurs/app/build.gradle b/AndroidStudioProjects/TP7/Couleurs/app/build.gradle new file mode 100755 index 0000000..3337758 --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/app/build.gradle @@ -0,0 +1,32 @@ +apply plugin: 'com.android.application' + +android { + compileSdk 33 + buildToolsVersion '34.0.0' + + defaultConfig { + applicationId "fr.iut_fbleau.apl41.couleurs" + minSdkVersion 19 + targetSdk 33 + versionCode 1 + versionName "1.0" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } + buildFeatures { + viewBinding true + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation 'com.android.support:appcompat-v7:28.0.0' + implementation 'com.android.support.constraint:constraint-layout:2.0.4' + implementation 'android.arch.lifecycle:livedata:1.1.1' + implementation 'android.arch.lifecycle:viewmodel:1.1.1' + testImplementation 'junit:junit:4.12' +} diff --git a/AndroidStudioProjects/TP7/Couleurs/app/proguard-rules.pro b/AndroidStudioProjects/TP7/Couleurs/app/proguard-rules.pro new file mode 100755 index 0000000..45dc58a --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/app/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /opt/android-sdk/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/AndroidStudioProjects/TP7/Couleurs/app/src/androidTest/java/fr/iut_fbleau/apl41/couleurs/ApplicationTest.java b/AndroidStudioProjects/TP7/Couleurs/app/src/androidTest/java/fr/iut_fbleau/apl41/couleurs/ApplicationTest.java new file mode 100755 index 0000000..d1165c3 --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/app/src/androidTest/java/fr/iut_fbleau/apl41/couleurs/ApplicationTest.java @@ -0,0 +1,13 @@ +package fr.iut_fbleau.apl41.couleurs; + +import android.app.Application; +import android.test.ApplicationTestCase; + +/** + * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> + */ +public class ApplicationTest extends ApplicationTestCase<Application> { + public ApplicationTest() { + super(Application.class); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP7/Couleurs/app/src/main/AndroidManifest.xml b/AndroidStudioProjects/TP7/Couleurs/app/src/main/AndroidManifest.xml new file mode 100755 index 0000000..d8994b5 --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/app/src/main/AndroidManifest.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="fr.iut_fbleau.apl41.couleurs"> + + <application android:label="@string/app_name"> + <activity + android:theme="@style/Theme.AppCompat" + android:name=".Button_activity" + android:exported="false" /> + <activity + android:name=".Liste" + android:exported="true"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + </application> + +</manifest> \ No newline at end of file diff --git a/AndroidStudioProjects/TP7/Couleurs/app/src/main/java/fr/iut_fbleau/apl41/couleurs/AccesBaseDeDonnees.java b/AndroidStudioProjects/TP7/Couleurs/app/src/main/java/fr/iut_fbleau/apl41/couleurs/AccesBaseDeDonnees.java new file mode 100755 index 0000000..d2a2df7 --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/app/src/main/java/fr/iut_fbleau/apl41/couleurs/AccesBaseDeDonnees.java @@ -0,0 +1,45 @@ +package fr.iut_fbleau.apl41.couleurs; + +import android.content.ContentValues; +import android.content.Context; +import android.database.sqlite.SQLiteDatabase; +import android.database.sqlite.SQLiteOpenHelper; +import android.provider.BaseColumns; + +public class AccesBaseDeDonnees extends SQLiteOpenHelper { + public final static String NOM_BASE = "base_couleurs"; + public final static int VERSION_BASE = 3; + public final static String NOM_TABLE = "couleurs"; + public final static String CHAMP_NOM = "couleurs_nom"; + public final static String CHAMP_VALEUR = "couleurs_valeur"; + + public AccesBaseDeDonnees(Context context) { + super(context, AccesBaseDeDonnees.NOM_BASE, null, AccesBaseDeDonnees.VERSION_BASE); + } + + @Override + public void onCreate(SQLiteDatabase baseDeDonnees) { + baseDeDonnees.execSQL("create table " + AccesBaseDeDonnees.NOM_TABLE + "(" + + BaseColumns._ID + " integer primary key autoincrement, " + + AccesBaseDeDonnees.CHAMP_NOM + " text not null, " + + AccesBaseDeDonnees.CHAMP_VALEUR + " integer);"); + + ContentValues tuple = new ContentValues(); + + tuple.put(AccesBaseDeDonnees.CHAMP_NOM, "bleu Denim"); + tuple.put(AccesBaseDeDonnees.CHAMP_VALEUR, 0xFF4B0082); + baseDeDonnees.insert(AccesBaseDeDonnees.NOM_TABLE, null, tuple); + tuple.put(AccesBaseDeDonnees.CHAMP_NOM, "bleu électrique"); + tuple.put(AccesBaseDeDonnees.CHAMP_VALEUR, 0xFF1163E3); + baseDeDonnees.insert(AccesBaseDeDonnees.NOM_TABLE, null, tuple); + tuple.put(AccesBaseDeDonnees.CHAMP_NOM, "bleu vert"); + tuple.put(AccesBaseDeDonnees.CHAMP_VALEUR, 0xFF40E0D0); + baseDeDonnees.insert(AccesBaseDeDonnees.NOM_TABLE, null, tuple); + } + + @Override + public void onUpgrade(SQLiteDatabase baseDeDonnees, int vieux, int nouveau) { + baseDeDonnees.execSQL("drop table if exists " + AccesBaseDeDonnees.NOM_TABLE); + this.onCreate(baseDeDonnees); + } +} diff --git a/AndroidStudioProjects/TP7/Couleurs/app/src/main/java/fr/iut_fbleau/apl41/couleurs/Button_activity.java b/AndroidStudioProjects/TP7/Couleurs/app/src/main/java/fr/iut_fbleau/apl41/couleurs/Button_activity.java new file mode 100644 index 0000000..2903c09 --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/app/src/main/java/fr/iut_fbleau/apl41/couleurs/Button_activity.java @@ -0,0 +1,17 @@ +package fr.iut_fbleau.apl41.couleurs; + +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.widget.Button; + +public class Button_activity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.button_activity); + + Button supprimer = (Button) this.findViewById(R.id.supprimer); + Button annuler = (Button) this.findViewById(R.id.annuler); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP7/Couleurs/app/src/main/java/fr/iut_fbleau/apl41/couleurs/ControleAnnuler.java b/AndroidStudioProjects/TP7/Couleurs/app/src/main/java/fr/iut_fbleau/apl41/couleurs/ControleAnnuler.java new file mode 100644 index 0000000..c92afef --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/app/src/main/java/fr/iut_fbleau/apl41/couleurs/ControleAnnuler.java @@ -0,0 +1,25 @@ +package fr.iut_fbleau.apl41.couleurs; + +import android.app.Activity; +import android.content.Intent; +import android.view.View; +import android.widget.AdapterView; +import android.widget.Toast; + +/** + * Created by hernand on 3/28/17. + */ +public class ControleAnnuler implements View.OnClickListener { + private Activity parent; + public ControleAnnuler(Activity a) { + this.parent = a; + } + + @Override + public void onClick(View view) { + Intent intent = new Intent(parent, Liste.class); + parent.startActivity(intent); + parent.finishAffinity(); + } + +} diff --git a/AndroidStudioProjects/TP7/Couleurs/app/src/main/java/fr/iut_fbleau/apl41/couleurs/ControleClic.java b/AndroidStudioProjects/TP7/Couleurs/app/src/main/java/fr/iut_fbleau/apl41/couleurs/ControleClic.java new file mode 100755 index 0000000..e3e688b --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/app/src/main/java/fr/iut_fbleau/apl41/couleurs/ControleClic.java @@ -0,0 +1,24 @@ +package fr.iut_fbleau.apl41.couleurs; + +import android.app.Activity; +import android.content.Intent; +import android.view.View; +import android.widget.AdapterView; +import android.widget.Toast; + +/** + * Created by hernand on 3/28/17. + */ +public class ControleClic implements AdapterView.OnItemClickListener { + private Activity parent; + public ControleClic(Activity a) { + this.parent = a; + } + @Override + public void onItemClick(AdapterView<?> liste, View vue, int positionListe, long idBase) { + Toast.makeText(this.parent, "Clic sur ligne "+(positionListe+1), Toast.LENGTH_SHORT).show(); + Intent intent = new Intent(parent, Button_activity.class); + parent.startActivity(intent); + parent.finishAffinity(); + } +} diff --git a/AndroidStudioProjects/TP7/Couleurs/app/src/main/java/fr/iut_fbleau/apl41/couleurs/ControleSupprimer.java b/AndroidStudioProjects/TP7/Couleurs/app/src/main/java/fr/iut_fbleau/apl41/couleurs/ControleSupprimer.java new file mode 100644 index 0000000..06a6483 --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/app/src/main/java/fr/iut_fbleau/apl41/couleurs/ControleSupprimer.java @@ -0,0 +1,23 @@ +package fr.iut_fbleau.apl41.couleurs; + +import android.app.Activity; +import android.content.Intent; +import android.view.View; +import android.widget.AdapterView; +import android.widget.Button; +import android.widget.Toast; + +/** + * Created by hernand on 3/28/17. + */ +public class ControleSupprimer implements View.OnClickListener { + private Activity parent; + public ControleSupprimer(Activity a) { + this.parent = a; + } + + @Override + public void onClick(View view) { + + } +} diff --git a/AndroidStudioProjects/TP7/Couleurs/app/src/main/java/fr/iut_fbleau/apl41/couleurs/Lieur.java b/AndroidStudioProjects/TP7/Couleurs/app/src/main/java/fr/iut_fbleau/apl41/couleurs/Lieur.java new file mode 100644 index 0000000..07c7057 --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/app/src/main/java/fr/iut_fbleau/apl41/couleurs/Lieur.java @@ -0,0 +1,16 @@ +package fr.iut_fbleau.apl41.couleurs; + +import android.database.Cursor; +import android.view.View; +import android.widget.SimpleCursorAdapter; + +public class Lieur implements SimpleCursorAdapter.ViewBinder { + @Override + public boolean setViewValue(View view, Cursor cursor, int columnIndex) { + if(view.getId() == R.id.couleur) { + view.setBackgroundColor(cursor.getInt(columnIndex)); + return true; + } + return false; + } +} diff --git a/AndroidStudioProjects/TP7/Couleurs/app/src/main/java/fr/iut_fbleau/apl41/couleurs/Liste.java b/AndroidStudioProjects/TP7/Couleurs/app/src/main/java/fr/iut_fbleau/apl41/couleurs/Liste.java new file mode 100755 index 0000000..7bc30fd --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/app/src/main/java/fr/iut_fbleau/apl41/couleurs/Liste.java @@ -0,0 +1,59 @@ +package fr.iut_fbleau.apl41.couleurs; + +import android.app.Activity; +import android.database.Cursor; +import android.database.sqlite.SQLiteDatabase; +import android.os.Bundle; +import android.view.Menu; +import android.view.MenuItem; +import android.widget.ListView; +import android.widget.SimpleCursorAdapter; +import android.widget.Toast; + +public class Liste extends Activity { + private final static String[] CHAMPS = {AccesBaseDeDonnees.CHAMP_NOM, AccesBaseDeDonnees.CHAMP_VALEUR}; + private final static int[] VUES = {R.id.nom, R.id.couleur}; + private SimpleCursorAdapter adaptateur; + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + this.setContentView(R.layout.activity_liste); + + this.adaptateur = new SimpleCursorAdapter(this, R.layout.row_element, null, Liste.CHAMPS, Liste.VUES, 0); + this.adaptateur.setViewBinder(new Lieur()); + ListView elements = (ListView) this.findViewById(R.id.elements); + elements.setOnItemClickListener(new ControleClic(this)); + elements.setAdapter(this.adaptateur); + this.remplirListe(); + } + + public void remplirListe() { + AccesBaseDeDonnees acces = new AccesBaseDeDonnees(this); + SQLiteDatabase baseDeDonnees = acces.getReadableDatabase(); + + Cursor curseur = baseDeDonnees.query(AccesBaseDeDonnees.NOM_TABLE, null, null, null, null, null, null); + if (curseur != null) { + this.adaptateur.swapCursor(curseur); + } else { + Toast.makeText(this, "Erreur d'accès à la base de données", Toast.LENGTH_SHORT).show(); + } + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + this.getMenuInflater().inflate(R.menu.menu_liste, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int id = item.getItemId(); + + if (id == R.id.action_ajouter) { + // TODO + return true; + } + + return super.onOptionsItemSelected(item); + } +} diff --git a/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/layout/activity_liste.xml b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/layout/activity_liste.xml new file mode 100755 index 0000000..793dfa4 --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/layout/activity_liste.xml @@ -0,0 +1,18 @@ +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + tools:context=".Liste" + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_marginLeft="@dimen/activity_horizontal_margin" + android:layout_marginRight="@dimen/activity_horizontal_margin" + android:layout_marginTop="@dimen/activity_vertical_margin" + android:layout_marginBottom="@dimen/activity_vertical_margin" +> + <ListView + android:id="@+id/elements" + android:layout_width="match_parent" + android:layout_height="wrap_content" + /> +</LinearLayout> diff --git a/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/layout/button_activity.xml b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/layout/button_activity.xml new file mode 100644 index 0000000..b05efa0 --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/layout/button_activity.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center"> + + <RelativeLayout + android:layout_width="200dp" + android:layout_height="200dp"> + + <Button + android:id="@+id/supprimer" + android:layout_width="wrap_content" + android:layout_height="92dp" + android:layout_alignParentLeft="true" + android:layout_alignParentRight="true" + android:layout_alignParentTop="true" + android:text="Supprimer" + android:textSize="20dp"> + + </Button> + + <Button + android:id="@+id/annuler" + android:layout_width="wrap_content" + android:layout_height="92dp" + android:layout_alignParentLeft="true" + android:layout_alignParentRight="true" + android:layout_alignParentBottom="true" + android:text="Annuler" + android:textSize="20dp"> + + </Button> + + </RelativeLayout> + +</LinearLayout> \ No newline at end of file diff --git a/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/layout/row_element.xml b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/layout/row_element.xml new file mode 100755 index 0000000..a8da3dd --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/layout/row_element.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="horizontal" + android:layout_width="match_parent" + android:layout_height="wrap_content" +> + + <View + android:layout_width="@dimen/color_size" + android:layout_height="@dimen/color_size" + android:id="@+id/couleur" + android:layout_margin="@dimen/color_margin" + android:background="#ff20a080" + android:gravity="center" /> + + <TextView + android:layout_width="0dp" + android:layout_height="match_parent" + android:textAppearance="?android:attr/textAppearanceMedium" + android:text="Vert" + android:id="@+id/nom" + android:layout_weight="1.0" + android:gravity="center_vertical|start" /> +</LinearLayout> \ No newline at end of file diff --git a/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/menu/menu_liste.xml b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/menu/menu_liste.xml new file mode 100755 index 0000000..79bbcef --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/menu/menu_liste.xml @@ -0,0 +1,13 @@ +<menu + 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" + tools:context=".Liste" +> + <item + android:id="@+id/action_ajouter" + android:title="@string/action_ajouter" + android:orderInCategory="100" + android:showAsAction="never" + /> +</menu> diff --git a/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/mipmap-hdpi/ic_launcher.png b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100755 index 0000000..cde69bc Binary files /dev/null and b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/mipmap-mdpi/ic_launcher.png b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100755 index 0000000..c133a0c Binary files /dev/null and b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100755 index 0000000..bfa42f0 Binary files /dev/null and b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100755 index 0000000..324e72c Binary files /dev/null and b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100755 index 0000000..aee44e1 Binary files /dev/null and b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/values-night/themes.xml b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..7c95872 --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/values-night/themes.xml @@ -0,0 +1,7 @@ +<resources> + + <style name="ThemeOverlay.Couleurs.FullscreenContainer" parent=""> + <item name="fullscreenBackgroundColor">@color/light_blue_900</item> + <item name="fullscreenTextColor">@color/light_blue_A400</item> + </style> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/values-w820dp/dimens.xml b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/values-w820dp/dimens.xml new file mode 100755 index 0000000..43758b3 --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/values-w820dp/dimens.xml @@ -0,0 +1,5 @@ +<resources> + <dimen name="activity_horizontal_margin"> + 64dp + </dimen> +</resources> diff --git a/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/values/attrs.xml b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/values/attrs.xml new file mode 100644 index 0000000..e52391d --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/values/attrs.xml @@ -0,0 +1,6 @@ +<resources> + <declare-styleable name="FullscreenAttrs"> + <attr name="fullscreenBackgroundColor" format="color" /> + <attr name="fullscreenTextColor" format="color" /> + </declare-styleable> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/values/colors.xml b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..89cad66 --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/values/colors.xml @@ -0,0 +1,7 @@ +<resources> + <color name="light_blue_600">#FF039BE5</color> + <color name="light_blue_900">#FF01579B</color> + <color name="light_blue_A200">#FF40C4FF</color> + <color name="light_blue_A400">#FF00B0FF</color> + <color name="black_overlay">#66000000</color> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/values/dimens.xml b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/values/dimens.xml new file mode 100755 index 0000000..dc9b49d --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/values/dimens.xml @@ -0,0 +1,14 @@ +<resources> + <dimen name="activity_horizontal_margin"> + 16dp + </dimen> + <dimen name="activity_vertical_margin"> + 16dp + </dimen> + <dimen name="color_size"> + 32dp + </dimen> + <dimen name="color_margin"> + 12dp + </dimen> +</resources> diff --git a/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/values/strings.xml b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/values/strings.xml new file mode 100755 index 0000000..ef7a542 --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/values/strings.xml @@ -0,0 +1,11 @@ +<resources> + <string name="app_name"> + Couleurs + </string> + <string name="action_ajouter"> + Ajouter + </string> + <string name="title_activity_button">button_activity</string> + <string name="dummy_button">Dummy Button</string> + <string name="dummy_content">DUMMY\nCONTENT</string> +</resources> diff --git a/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/values/styles.xml b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..f946733 --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/values/styles.xml @@ -0,0 +1,11 @@ +<resources> + + <style name="Widget.Theme.Couleurs.ActionBar.Fullscreen" parent="Widget.AppCompat.ActionBar"> + <item name="android:background">@color/black_overlay</item> + </style> + + <style name="Widget.Theme.Couleurs.ButtonBar.Fullscreen" parent=""> + <item name="android:background">@color/black_overlay</item> + <item name="android:buttonBarStyle">?android:attr/buttonBarStyle</item> + </style> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/values/themes.xml b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..69616f0 --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/app/src/main/res/values/themes.xml @@ -0,0 +1,15 @@ +<resources> + + <style name="Theme.Couleurs" parent="Theme.AppCompat.Light" /> + + <style name="Theme.Couleurs.Fullscreen" parent="Theme.Couleurs"> + <item name="android:actionBarStyle">@style/Widget.Theme.Couleurs.ActionBar.Fullscreen</item> + <item name="android:windowActionBarOverlay">true</item> + <item name="android:windowBackground">@null</item> + </style> + + <style name="ThemeOverlay.Couleurs.FullscreenContainer" parent=""> + <item name="fullscreenBackgroundColor">@color/light_blue_600</item> + <item name="fullscreenTextColor">@color/light_blue_A200</item> + </style> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/TP7/Couleurs/app/src/test/java/fr/iut_fbleau/apl41/couleurs/ExampleUnitTest.java b/AndroidStudioProjects/TP7/Couleurs/app/src/test/java/fr/iut_fbleau/apl41/couleurs/ExampleUnitTest.java new file mode 100755 index 0000000..89bf27e --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/app/src/test/java/fr/iut_fbleau/apl41/couleurs/ExampleUnitTest.java @@ -0,0 +1,15 @@ +package fr.iut_fbleau.apl41.couleurs; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * To work on unit tests, switch the Test Artifact in the Build Variants view. + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() throws Exception { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/TP7/Couleurs/build.gradle b/AndroidStudioProjects/TP7/Couleurs/build.gradle new file mode 100755 index 0000000..d54ad67 --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/build.gradle @@ -0,0 +1,25 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + google() + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:7.2.2' + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + google() + jcenter() + } +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/AndroidStudioProjects/TP7/Couleurs/gradle.properties b/AndroidStudioProjects/TP7/Couleurs/gradle.properties new file mode 100755 index 0000000..1d3591c --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/gradle.properties @@ -0,0 +1,18 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx10248m -XX:MaxPermSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true \ No newline at end of file diff --git a/AndroidStudioProjects/TP7/Couleurs/gradle/wrapper/gradle-wrapper.jar b/AndroidStudioProjects/TP7/Couleurs/gradle/wrapper/gradle-wrapper.jar new file mode 100755 index 0000000..13372ae Binary files /dev/null and b/AndroidStudioProjects/TP7/Couleurs/gradle/wrapper/gradle-wrapper.jar differ diff --git a/AndroidStudioProjects/TP7/Couleurs/gradle/wrapper/gradle-wrapper.properties b/AndroidStudioProjects/TP7/Couleurs/gradle/wrapper/gradle-wrapper.properties new file mode 100755 index 0000000..8a9a5ad --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Mar 23 13:29:16 CET 2022 +distributionBase=GRADLE_USER_HOME +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +distributionPath=wrapper/dists +zipStorePath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME diff --git a/AndroidStudioProjects/TP7/Couleurs/gradlew b/AndroidStudioProjects/TP7/Couleurs/gradlew new file mode 100755 index 0000000..9d82f78 --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/gradlew @@ -0,0 +1,160 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/AndroidStudioProjects/TP7/Couleurs/gradlew.bat b/AndroidStudioProjects/TP7/Couleurs/gradlew.bat new file mode 100755 index 0000000..aec9973 --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/AndroidStudioProjects/TP7/Couleurs/settings.gradle b/AndroidStudioProjects/TP7/Couleurs/settings.gradle new file mode 100755 index 0000000..e7b4def --- /dev/null +++ b/AndroidStudioProjects/TP7/Couleurs/settings.gradle @@ -0,0 +1 @@ +include ':app' diff --git a/AndroidStudioProjects/TP7/couleurs.tar.gz b/AndroidStudioProjects/TP7/couleurs.tar.gz new file mode 100644 index 0000000..c4dcf98 Binary files /dev/null and b/AndroidStudioProjects/TP7/couleurs.tar.gz differ diff --git a/AndroidStudioProjects/pourchot_dev45.tar.gz b/AndroidStudioProjects/pourchot_dev45.tar.gz new file mode 100644 index 0000000..e20d1f7 Binary files /dev/null and b/AndroidStudioProjects/pourchot_dev45.tar.gz differ diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/.gitignore b/AndroidStudioProjects/pourchot_dev45/Composition/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/.gitignore @@ -0,0 +1,15 @@ +*.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 +local.properties diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/.idea/.gitignore b/AndroidStudioProjects/pourchot_dev45/Composition/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/.idea/compiler.xml b/AndroidStudioProjects/pourchot_dev45/Composition/.idea/compiler.xml new file mode 100644 index 0000000..b589d56 --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/.idea/compiler.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="CompilerConfiguration"> + <bytecodeTargetLevel target="17" /> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/.idea/gradle.xml b/AndroidStudioProjects/pourchot_dev45/Composition/.idea/gradle.xml new file mode 100644 index 0000000..a9f4e52 --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/.idea/gradle.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <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> + </GradleProjectSettings> + </option> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/.idea/misc.xml b/AndroidStudioProjects/pourchot_dev45/Composition/.idea/misc.xml new file mode 100644 index 0000000..9f71c83 --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/.idea/misc.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ExternalStorageConfigurationManager" enabled="true" /> + <component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="jbr-17" project-jdk-type="JavaSDK"> + <output url="file://$PROJECT_DIR$/build/classes" /> + </component> + <component name="ProjectType"> + <option name="id" value="Android" /> + </component> +</project> \ No newline at end of file diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/app/.gitignore b/AndroidStudioProjects/pourchot_dev45/Composition/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/app/build.gradle b/AndroidStudioProjects/pourchot_dev45/Composition/app/build.gradle new file mode 100644 index 0000000..e860bc0 --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/app/build.gradle @@ -0,0 +1,40 @@ +plugins { + id 'com.android.application' +} + +android { + namespace 'com.example.composition' + compileSdk 33 + + defaultConfig { + applicationId "com.example.composition" + minSdk 19 + targetSdk 33 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + buildToolsVersion '34.0.0' +} + +dependencies { + + implementation 'androidx.appcompat:appcompat:1.6.1' + implementation 'com.google.android.material:material:1.5.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' +} \ No newline at end of file diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/app/proguard-rules.pro b/AndroidStudioProjects/pourchot_dev45/Composition/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/app/src/androidTest/java/com/example/composition/ExampleInstrumentedTest.java b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/androidTest/java/com/example/composition/ExampleInstrumentedTest.java new file mode 100644 index 0000000..ffc070e --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/androidTest/java/com/example/composition/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.example.composition; + +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.composition", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/AndroidManifest.xml b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..2629ebc --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/AndroidManifest.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools"> + + <application + android:allowBackup="true" + android:dataExtractionRules="@xml/data_extraction_rules" + android:fullBackupContent="@xml/backup_rules" + android:icon="@mipmap/ic_launcher" + android:label="@string/app_name" + android:roundIcon="@mipmap/ic_launcher_round" + android:supportsRtl="true" + android:theme="@style/Theme.Composition" + tools:targetApi="31"> + <activity + android:name=".MainActivity" + android:exported="true"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + </application> + +</manifest> \ No newline at end of file diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/java/com/example/composition/MainActivity.java b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/java/com/example/composition/MainActivity.java new file mode 100644 index 0000000..5e584f7 --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/java/com/example/composition/MainActivity.java @@ -0,0 +1,14 @@ +package com.example.composition; + +import androidx.appcompat.app.AppCompatActivity; + +import android.os.Bundle; + +public class MainActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:aapt="http://schemas.android.com/aapt" + android:width="108dp" + android:height="108dp" + android:viewportWidth="108" + android:viewportHeight="108"> + <path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z"> + <aapt:attr name="android:fillColor"> + <gradient + android:endX="85.84757" + android:endY="92.4963" + android:startX="42.9492" + android:startY="49.59793" + android:type="linear"> + <item + android:color="#44000000" + android:offset="0.0" /> + <item + android:color="#00000000" + android:offset="1.0" /> + </gradient> + </aapt:attr> + </path> + <path + android:fillColor="#FFFFFF" + android:fillType="nonZero" + android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z" + android:strokeWidth="1" + android:strokeColor="#00000000" /> +</vector> \ No newline at end of file diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/drawable/ic_launcher_background.xml b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="108dp" + android:height="108dp" + android:viewportWidth="108" + android:viewportHeight="108"> + <path + android:fillColor="#3DDC84" + android:pathData="M0,0h108v108h-108z" /> + <path + android:fillColor="#00000000" + android:pathData="M9,0L9,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,0L19,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M29,0L29,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M39,0L39,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M49,0L49,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M59,0L59,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M69,0L69,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M79,0L79,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M89,0L89,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M99,0L99,108" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,9L108,9" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,19L108,19" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,29L108,29" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,39L108,39" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,49L108,49" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,59L108,59" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,69L108,69" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,79L108,79" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,89L108,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M0,99L108,99" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,29L89,29" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,39L89,39" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,49L89,49" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,59L89,59" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,69L89,69" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M19,79L89,79" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M29,19L29,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M39,19L39,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M49,19L49,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M59,19L59,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M69,19L69,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> + <path + android:fillColor="#00000000" + android:pathData="M79,19L79,89" + android:strokeWidth="0.8" + android:strokeColor="#33FFFFFF" /> +</vector> diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/layout/activity_main.xml b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..236aead --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="utf-8"?> +<RelativeLayout 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" + tools:context=".MainActivity" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@color/black"> + + <View + android:layout_width="10dp" + android:layout_height="@dimen/hauteur_rectangle" + android:background="@color/sky_blue" + android:layout_alignParentLeft="true" + android:paddingRight="@dimen/padding_rectangle" + android:id="@+id/rectangle1" + android:layout_margin="@dimen/padding_rectangle"> + + </View> + + <View + android:layout_width="0dp" + android:layout_height="@dimen/hauteur_rectangle" + android:background="@color/sky_blue" + android:layout_toLeftOf="@id/rectangle3" + android:layout_toRightOf="@id/rectangle1" + android:id="@+id/rectangle2" + android:layout_marginTop="@dimen/padding_rectangle"> + + </View> + + <View + android:layout_width="10dp" + android:layout_height="@dimen/hauteur_rectangle" + android:background="@color/sky_blue" + android:layout_alignParentRight="true" + android:id="@+id/rectangle3" + android:layout_margin="@dimen/padding_rectangle"> + + </View> + + <View + android:layout_width="10dp" + android:layout_height="@dimen/hauteur_rectangle" + android:background="@color/sky_blue" + android:id="@+id/rectangle4" + android:layout_alignParentLeft="true" + android:layout_below="@id/rectangle1" + android:layout_marginLeft="@dimen/padding_rectangle" + android:layout_marginRight="@dimen/padding_rectangle"> + + </View> + + <View + android:layout_width="0dp" + android:layout_height="@dimen/hauteur_rectangle" + android:background="@color/sky_blue" + android:id="@+id/rectangle5" + android:layout_below="@id/rectangle2" + android:layout_toLeftOf="@id/rectangle6" + android:layout_toRightOf="@id/rectangle4" + android:layout_marginTop="@dimen/padding_rectangle" + android:layout_marginRight="@dimen/padding_rectangle"> + + </View> + + <View + android:layout_width="10dp" + android:layout_height="@dimen/hauteur_rectangle" + android:background="@color/sky_blue" + android:layout_alignParentRight="true" + android:id="@+id/rectangle6" + android:layout_below="@id/rectangle3" + android:layout_marginRight="@dimen/padding_rectangle"> + + </View> +</RelativeLayout> \ No newline at end of file diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/ic_launcher_background" /> + <foreground android:drawable="@drawable/ic_launcher_foreground" /> + <monochrome android:drawable="@drawable/ic_launcher_foreground" /> +</adaptive-icon> \ No newline at end of file diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/ic_launcher_background" /> + <foreground android:drawable="@drawable/ic_launcher_foreground" /> + <monochrome android:drawable="@drawable/ic_launcher_foreground" /> +</adaptive-icon> \ No newline at end of file diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/values-night/themes.xml b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..db08552 --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/values-night/themes.xml @@ -0,0 +1,7 @@ +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Base application theme. --> + <style name="Base.Theme.Composition" parent="Theme.Material3.DayNight.NoActionBar"> + <!-- Customize your dark theme here. --> + <!-- <item name="colorPrimary">@color/my_dark_primary</item> --> + </style> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/values/colors.xml b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..c914d53 --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/values/colors.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <color name="black">#FF000000</color> + <color name="white">#FFFFFFFF</color> + <color name="sky_blue">#33B5E5</color> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/values/dimens.xml b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/values/dimens.xml new file mode 100644 index 0000000..b4a0dde --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/values/dimens.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <dimen name="hauteur_rectangle"> + 100dp + </dimen> + <dimen name="padding_rectangle"> + 40dp + </dimen> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/values/strings.xml b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..48595dc --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ +<resources> + <string name="app_name">Composition</string> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/values/themes.xml b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..0451ad9 --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/values/themes.xml @@ -0,0 +1,9 @@ +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Base application theme. --> + <style name="Base.Theme.Composition" parent="Theme.Material3.DayNight.NoActionBar"> + <!-- Customize your light theme here. --> + <!-- <item name="colorPrimary">@color/my_light_primary</item> --> + </style> + + <style name="Theme.Composition" parent="Base.Theme.Composition" /> +</resources> \ No newline at end of file diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/xml/backup_rules.xml b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/xml/backup_rules.xml new file mode 100644 index 0000000..fa0f996 --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/xml/backup_rules.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + Sample backup rules file; uncomment and customize as necessary. + See https://developer.android.com/guide/topics/data/autobackup + for details. + Note: This file is ignored for devices older that API 31 + See https://developer.android.com/about/versions/12/backup-restore +--> +<full-backup-content> + <!-- + <include domain="sharedpref" path="."/> + <exclude domain="sharedpref" path="device.xml"/> +--> +</full-backup-content> \ No newline at end of file diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/xml/data_extraction_rules.xml b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/xml/data_extraction_rules.xml new file mode 100644 index 0000000..9ee9997 --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/main/res/xml/data_extraction_rules.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + Sample data extraction rules file; uncomment and customize as necessary. + See https://developer.android.com/about/versions/12/backup-restore#xml-changes + for details. +--> +<data-extraction-rules> + <cloud-backup> + <!-- TODO: Use <include> and <exclude> to control what is backed up. + <include .../> + <exclude .../> + --> + </cloud-backup> + <!-- + <device-transfer> + <include .../> + <exclude .../> + </device-transfer> + --> +</data-extraction-rules> \ No newline at end of file diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/app/src/test/java/com/example/composition/ExampleUnitTest.java b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/test/java/com/example/composition/ExampleUnitTest.java new file mode 100644 index 0000000..dec97e7 --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/app/src/test/java/com/example/composition/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package com.example.composition; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/build.gradle b/AndroidStudioProjects/pourchot_dev45/Composition/build.gradle new file mode 100644 index 0000000..a100ce0 --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/build.gradle @@ -0,0 +1,5 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + id 'com.android.application' version '8.0.2' apply false + id 'com.android.library' version '8.0.2' apply false +} \ No newline at end of file diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/gradle.properties b/AndroidStudioProjects/pourchot_dev45/Composition/gradle.properties new file mode 100644 index 0000000..3e927b1 --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/gradle.properties @@ -0,0 +1,21 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/gradle/wrapper/gradle-wrapper.jar b/AndroidStudioProjects/pourchot_dev45/Composition/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/AndroidStudioProjects/pourchot_dev45/Composition/gradle/wrapper/gradle-wrapper.jar differ diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/gradle/wrapper/gradle-wrapper.properties b/AndroidStudioProjects/pourchot_dev45/Composition/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..3198ba6 --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Tue Mar 26 08:50:31 CET 2024 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/gradlew b/AndroidStudioProjects/pourchot_dev45/Composition/gradlew new file mode 100755 index 0000000..4f906e0 --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/gradlew.bat b/AndroidStudioProjects/pourchot_dev45/Composition/gradlew.bat new file mode 100644 index 0000000..ac1b06f --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/AndroidStudioProjects/pourchot_dev45/Composition/settings.gradle b/AndroidStudioProjects/pourchot_dev45/Composition/settings.gradle new file mode 100644 index 0000000..e71bef0 --- /dev/null +++ b/AndroidStudioProjects/pourchot_dev45/Composition/settings.gradle @@ -0,0 +1,16 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} +rootProject.name = "Composition" +include ':app' diff --git a/Automate/TP0/Ex1.jff b/Automate/TP0/Ex1.jff index bc4bd92..f56f0da 100644 --- a/Automate/TP0/Ex1.jff +++ b/Automate/TP0/Ex1.jff @@ -88,6 +88,7 @@ <state id="19" name="7"> <x>572.0</x> <y>92.0</y> + <initial/> </state> <state id="20" name="q20"> <x>704.0</x> @@ -130,7 +131,6 @@ <state id="29" name="10"> <x>1083.0</x> <y>190.0</y> - <initial/> </state> <state id="30" name="q30"> <x>1246.0</x> @@ -161,55 +161,135 @@ </state> <!--The list of transitions.--> <transition> - <from>21</from> - <to>19</to> - <read>c</read> - </transition> - <transition> - <from>8</from> - <to>9</to> - <read>b</read> - </transition> - <transition> - <from>17</from> - <to>18</to> + <from>20</from> + <to>21</to> <read>a</read> </transition> + <transition> + <from>12</from> + <to>13</to> + <read>a</read> + </transition> + <transition> + <from>13</from> + <to>14</to> + <read>b</read> + </transition> <transition> <from>29</from> <to>31</to> <read>b</read> </transition> <transition> - <from>17</from> - <to>18</to> - <read>b</read> - </transition> - <transition> - <from>17</from> - <to>18</to> - <read>c</read> - </transition> - <transition> - <from>35</from> - <to>32</to> + <from>27</from> + <to>28</to> <read>a</read> </transition> <transition> - <from>32</from> - <to>35</to> + <from>25</from> + <to>28</to> + <read>a</read> + </transition> + <transition> + <from>8</from> + <to>9</to> + <read>b</read> + </transition> + <transition> + <from>26</from> + <to>27</to> <read>c</read> </transition> <transition> - <from>35</from> - <to>32</to> + <from>13</from> + <to>11</to> + <read>a</read> + </transition> + <transition> + <from>21</from> + <to>22</to> <read>b</read> </transition> + <transition> + <from>6</from> + <to>5</to> + <read>b</read> + </transition> + <transition> + <from>5</from> + <to>6</to> + <read>a</read> + </transition> + <transition> + <from>23</from> + <to>24</to> + <read>c</read> + </transition> + <transition> + <from>21</from> + <to>19</to> + <read>c</read> + </transition> + <transition> + <from>29</from> + <to>32</to> + <read>c</read> + </transition> + <transition> + <from>3</from> + <to>4</to> + <read>a</read> + </transition> <transition> <from>2</from> <to>3</to> <read>a</read> </transition> + <transition> + <from>11</from> + <to>12</to> + <read>b</read> + </transition> + <transition> + <from>14</from> + <to>11</to> + <read>a</read> + </transition> + <transition> + <from>0</from> + <to>1</to> + <read>b</read> + </transition> + <transition> + <from>0</from> + <to>1</to> + <read>a</read> + </transition> + <transition> + <from>20</from> + <to>19</to> + <read>b</read> + </transition> + <transition> + <from>20</from> + <to>19</to> + <read>c</read> + </transition> + <transition> + <from>19</from> + <to>20</to> + <read>a</read> + </transition> + <transition> + <from>29</from> + <to>30</to> + <read>a</read> + </transition> + <transition> + <from>34</from> + <to>31</to> + <read>a</read> + </transition> <transition> <from>31</from> <to>34</to> @@ -220,174 +300,19 @@ <to>31</to> <read>c</read> </transition> - <transition> - <from>34</from> - <to>31</to> - <read>a</read> - </transition> - <transition> - <from>5</from> - <to>6</to> - <read>a</read> - </transition> - <transition> - <from>6</from> - <to>5</to> - <read>b</read> - </transition> - <transition> - <from>0</from> - <to>1</to> - <read>a</read> - </transition> - <transition> - <from>29</from> - <to>32</to> - <read>c</read> - </transition> - <transition> - <from>0</from> - <to>1</to> - <read>b</read> - </transition> - <transition> - <from>20</from> - <to>21</to> - <read>a</read> - </transition> - <transition> - <from>18</from> - <to>16</to> - <read>c</read> - </transition> - <transition> - <from>18</from> - <to>16</to> - <read>b</read> - </transition> - <transition> - <from>18</from> - <to>16</to> - <read>a</read> - </transition> - <transition> - <from>33</from> - <to>30</to> - <read>b</read> - </transition> - <transition> - <from>33</from> - <to>30</to> - <read>c</read> - </transition> - <transition> - <from>30</from> - <to>33</to> - <read>a</read> - </transition> - <transition> - <from>21</from> - <to>22</to> - <read>b</read> - </transition> - <transition> - <from>6</from> - <to>7</to> - <read>a</read> - </transition> - <transition> - <from>27</from> - <to>28</to> - <read>a</read> - </transition> - <transition> - <from>3</from> - <to>4</to> - <read>a</read> - </transition> - <transition> - <from>20</from> - <to>19</to> - <read>c</read> - </transition> - <transition> - <from>20</from> - <to>19</to> - <read>b</read> - </transition> - <transition> - <from>19</from> - <to>20</to> - <read>a</read> - </transition> - <transition> - <from>14</from> - <to>12</to> - <read>b</read> - </transition> <transition> <from>28</from> <to>26</to> <read>b</read> </transition> <transition> - <from>11</from> - <to>12</to> - <read>b</read> - </transition> - <transition> - <from>22</from> - <to>19</to> + <from>7</from> + <to>7</to> <read>a</read> </transition> <transition> <from>16</from> <to>17</to> - <read>c</read> - </transition> - <transition> - <from>16</from> - <to>17</to> - <read>b</read> - </transition> - <transition> - <from>29</from> - <to>30</to> - <read>a</read> - </transition> - <transition> - <from>16</from> - <to>17</to> - <read>a</read> - </transition> - <transition> - <from>22</from> - <to>19</to> - <read>b</read> - </transition> - <transition> - <from>1</from> - <to>10</to> - <read>b</read> - </transition> - <transition> - <from>12</from> - <to>13</to> - <read>a</read> - </transition> - <transition> - <from>22</from> - <to>23</to> - <read>c</read> - </transition> - <transition> - <from>25</from> - <to>28</to> - <read>a</read> - </transition> - <transition> - <from>1</from> - <to>10</to> <read>a</read> </transition> <transition> @@ -395,11 +320,6 @@ <to>9</to> <read>a</read> </transition> - <transition> - <from>7</from> - <to>7</to> - <read>a</read> - </transition> <transition> <from>11</from> <to>11</to> @@ -431,13 +351,18 @@ <read>a</read> </transition> <transition> - <from>3</from> - <to>3</to> + <from>4</from> + <to>4</to> <read>b</read> </transition> <transition> - <from>4</from> - <to>4</to> + <from>16</from> + <to>17</to> + <read>b</read> + </transition> + <transition> + <from>3</from> + <to>3</to> <read>b</read> </transition> <transition> @@ -455,11 +380,26 @@ <to>7</to> <read>b</read> </transition> + <transition> + <from>19</from> + <to>19</to> + <read>b</read> + </transition> + <transition> + <from>32</from> + <to>32</to> + <read>b</read> + </transition> <transition> <from>34</from> <to>34</to> <read>b</read> </transition> + <transition> + <from>30</from> + <to>30</to> + <read>b</read> + </transition> <transition> <from>2</from> <to>2</to> @@ -470,26 +410,21 @@ <to>5</to> <read>b</read> </transition> - <transition> - <from>19</from> - <to>19</to> - <read>b</read> - </transition> - <transition> - <from>32</from> - <to>32</to> - <read>b</read> - </transition> <transition> <from>24</from> <to>24</to> <read>b</read> </transition> <transition> - <from>30</from> - <to>30</to> + <from>14</from> + <to>12</to> <read>b</read> </transition> + <transition> + <from>16</from> + <to>17</to> + <read>c</read> + </transition> <transition> <from>19</from> <to>19</to> @@ -516,39 +451,104 @@ <read>c</read> </transition> <transition> - <from>23</from> + <from>17</from> + <to>18</to> + <read>b</read> + </transition> + <transition> + <from>18</from> + <to>16</to> + <read>b</read> + </transition> + <transition> + <from>22</from> <to>19</to> <read>b</read> </transition> + <transition> + <from>17</from> + <to>18</to> + <read>c</read> + </transition> + <transition> + <from>18</from> + <to>16</to> + <read>c</read> + </transition> + <transition> + <from>17</from> + <to>18</to> + <read>a</read> + </transition> + <transition> + <from>18</from> + <to>16</to> + <read>a</read> + </transition> + <transition> + <from>22</from> + <to>19</to> + <read>a</read> + </transition> + <transition> + <from>22</from> + <to>23</to> + <read>c</read> + </transition> + <transition> + <from>35</from> + <to>32</to> + <read>a</read> + </transition> <transition> <from>23</from> <to>19</to> <read>a</read> </transition> <transition> - <from>13</from> - <to>11</to> - <read>a</read> + <from>32</from> + <to>35</to> + <read>c</read> </transition> <transition> <from>23</from> - <to>24</to> - <read>c</read> - </transition> - <transition> - <from>13</from> - <to>14</to> + <to>19</to> <read>b</read> </transition> <transition> - <from>26</from> - <to>27</to> - <read>c</read> + <from>35</from> + <to>32</to> + <read>b</read> </transition> <transition> - <from>14</from> - <to>11</to> + <from>1</from> + <to>10</to> + <read>b</read> + </transition> + <transition> + <from>6</from> + <to>7</to> <read>a</read> </transition> + <transition> + <from>1</from> + <to>10</to> + <read>a</read> + </transition> + <transition> + <from>30</from> + <to>33</to> + <read>a</read> + </transition> + <transition> + <from>33</from> + <to>30</to> + <read>b</read> + </transition> + <transition> + <from>33</from> + <to>30</to> + <read>c</read> + </transition> </automaton> </structure> \ No newline at end of file diff --git a/Automate/TP0/Ex2.jff b/Automate/TP0/Ex2.jff index 6841b20..99eb083 100644 --- a/Automate/TP0/Ex2.jff +++ b/Automate/TP0/Ex2.jff @@ -65,12 +65,12 @@ <y>-61.0</y> </state> <state id="14" name="5mod9"> - <x>950.0</x> - <y>119.0</y> + <x>995.0</x> + <y>97.0</y> </state> <state id="15" name="6mod9"> - <x>1079.0</x> - <y>124.0</y> + <x>1113.0</x> + <y>112.0</y> </state> <state id="16" name="7mod9"> <x>1202.0</x> @@ -91,23 +91,8 @@ </state> <!--The list of transitions.--> <transition> - <from>17</from> - <to>16</to> - <read>0</read> - </transition> - <transition> - <from>14</from> - <to>19</to> - <read>0</read> - </transition> - <transition> - <from>8</from> - <to>9</to> - <read>0</read> - </transition> - <transition> - <from>9</from> - <to>8</to> + <from>19</from> + <to>11</to> <read>0</read> </transition> <transition> @@ -117,54 +102,14 @@ </transition> <transition> <from>13</from> - <to>18</to> - <read>1</read> + <to>17</to> + <read>0</read> </transition> <transition> <from>15</from> <to>13</to> <read>1</read> </transition> - <transition> - <from>18</from> - <to>19</to> - <read>1</read> - </transition> - <transition> - <from>10</from> - <to>18</to> - <read>0</read> - </transition> - <transition> - <from>19</from> - <to>11</to> - <read>0</read> - </transition> - <transition> - <from>19</from> - <to>12</to> - <read>1</read> - </transition> - <transition> - <from>1</from> - <to>4</to> - <read>1</read> - </transition> - <transition> - <from>11</from> - <to>13</to> - <read>0</read> - </transition> - <transition> - <from>0</from> - <to>2</to> - <read>b</read> - </transition> - <transition> - <from>2</from> - <to>0</to> - <read>a</read> - </transition> <transition> <from>12</from> <to>15</to> @@ -176,30 +121,10 @@ <read>0</read> </transition> <transition> - <from>0</from> - <to>0</to> - <read>a</read> - </transition> - <transition> - <from>2</from> - <to>2</to> - <read>b</read> - </transition> - <transition> - <from>4</from> - <to>5</to> - <read>0</read> - </transition> - <transition> - <from>5</from> + <from>1</from> <to>4</to> <read>1</read> </transition> - <transition> - <from>13</from> - <to>17</to> - <read>0</read> - </transition> <transition> <from>7</from> <to>8</to> @@ -211,19 +136,24 @@ <read>1</read> </transition> <transition> - <from>11</from> - <to>14</to> + <from>17</from> + <to>16</to> + <read>0</read> + </transition> + <transition> + <from>18</from> + <to>19</to> <read>1</read> </transition> <transition> <from>14</from> - <to>11</to> - <read>1</read> + <to>19</to> + <read>0</read> </transition> <transition> - <from>16</from> - <to>14</to> - <read>0</read> + <from>19</from> + <to>12</to> + <read>1</read> </transition> <transition> <from>10</from> @@ -240,6 +170,61 @@ <to>8</to> <read>1</read> </transition> + <transition> + <from>0</from> + <to>0</to> + <read>a</read> + </transition> + <transition> + <from>2</from> + <to>2</to> + <read>b</read> + </transition> + <transition> + <from>12</from> + <to>16</to> + <read>1</read> + </transition> + <transition> + <from>8</from> + <to>9</to> + <read>0</read> + </transition> + <transition> + <from>9</from> + <to>8</to> + <read>0</read> + </transition> + <transition> + <from>16</from> + <to>14</to> + <read>0</read> + </transition> + <transition> + <from>4</from> + <to>5</to> + <read>0</read> + </transition> + <transition> + <from>11</from> + <to>13</to> + <read>0</read> + </transition> + <transition> + <from>5</from> + <to>4</to> + <read>1</read> + </transition> + <transition> + <from>11</from> + <to>14</to> + <read>1</read> + </transition> + <transition> + <from>14</from> + <to>11</to> + <read>1</read> + </transition> <transition> <from>1</from> <to>1</to> @@ -277,20 +262,30 @@ <to>17</to> <read>1</read> </transition> + <transition> + <from>0</from> + <to>2</to> + <read>b</read> + </transition> + <transition> + <from>10</from> + <to>18</to> + <read>0</read> + </transition> + <transition> + <from>2</from> + <to>0</to> + <read>a</read> + </transition> <transition> <from>6</from> <to>7</to> <read>0</read> </transition> <transition> - <from>12</from> - <to>16</to> + <from>13</from> + <to>18</to> <read>1</read> </transition> - <note> - <text/> - <x>286.0</x> - <y>756.0</y> - </note> </automaton> </structure> \ No newline at end of file diff --git a/DEV3.4/ControleMachine/pourchot_dev34.tar.gz b/DEV3.4/ControleMachine/pourchot_dev34.tar.gz new file mode 100644 index 0000000..da50644 Binary files /dev/null and b/DEV3.4/ControleMachine/pourchot_dev34.tar.gz differ diff --git a/DEV3.4/ControleMachine/test.tar.gz b/DEV3.4/ControleMachine/test.tar.gz new file mode 100644 index 0000000..b3b3b05 Binary files /dev/null and b/DEV3.4/ControleMachine/test.tar.gz differ diff --git a/DEV3.4/ControleMachine/test/.bashrc b/DEV3.4/ControleMachine/test/.bashrc new file mode 100644 index 0000000..c3eba21 --- /dev/null +++ b/DEV3.4/ControleMachine/test/.bashrc @@ -0,0 +1 @@ +export CLASSPATH=".:/usr/share/java/junit.jar:/usr/share/java/hamcrest-core.jar" diff --git a/DEV3.4/ControleMachine/test/AbstractToken.java b/DEV3.4/ControleMachine/test/AbstractToken.java new file mode 100644 index 0000000..6580bd3 --- /dev/null +++ b/DEV3.4/ControleMachine/test/AbstractToken.java @@ -0,0 +1,20 @@ +/** + * Classe Abstraite pour modéliser les éléments d'un programme après analyse lexicale (ou tokenization en franglais). + * + * Le programme est une succession de lexèmes ou jetons après analyse lexicale. Par exemple, un jeton contenant le nom d'une variable, + * un jeton pour un symbole d'une opération etc. + * + * Une classe concrète étendant cette classe permet de modéliser un type de jeton, et d'adapter le traitement selon le type du jeton + * lors de l'analyse syntaxique / compilation. + * + * On utilise simplement toString pour retrouver le texte initial. + * + * @author Florent Madelaine + */ + + +public abstract class AbstractToken { + + +} + diff --git a/DEV3.4/ControleMachine/test/Exemple.java b/DEV3.4/ControleMachine/test/Exemple.java new file mode 100644 index 0000000..ff22ceb --- /dev/null +++ b/DEV3.4/ControleMachine/test/Exemple.java @@ -0,0 +1,23 @@ +import java.util.Deque; +import java.util.ArrayDeque; + +public class Exemple{ + public static void main(String[] args){ + // 3 + 4 × (2 − 1) + // pas de parenthèse encore, je fais 3 + 4 * 2 + Deque<AbstractToken> expression = new ArrayDeque<AbstractToken>(); + expression.addLast(new TokenConstant(3)); + expression.addLast(new TokenOperator(Operator.ADD)); + expression.addLast(new TokenConstant(4)); + expression.addLast(new TokenOperator(Operator.MUL)); + expression.addLast(new TokenConstant(2)); + + StringBuilder b = new StringBuilder(); + for(AbstractToken t : expression ){ + b.append(t.toString()); + } + System.out.println(b.toString()); + + } + +} diff --git a/DEV3.4/ControleMachine/test/ExempleSY1.java b/DEV3.4/ControleMachine/test/ExempleSY1.java new file mode 100644 index 0000000..039edd0 --- /dev/null +++ b/DEV3.4/ControleMachine/test/ExempleSY1.java @@ -0,0 +1,60 @@ +import java.util.Deque; +import java.util.ArrayDeque; + +public class ExempleSY1{ + public static void main(String[] args){ + // 3 + 4 * 2 + // doit donner 342*+ + ArrayDeque<AbstractToken> expression = new ArrayDeque<AbstractToken>(); + expression.addLast(new TokenConstant(3)); + expression.addLast(new TokenOperator(Operator.ADD)); + expression.addLast(new TokenConstant(4)); + expression.addLast(new TokenOperator(Operator.MUL)); + expression.addLast(new TokenConstant(2)); + + ShuntingYard se1 = new ShuntingYard(expression); + ShuntingYard se2 = new ShuntingYard(expression.clone()); + // à la main + System.out.println("-----à la main -----"); + System.out.println(se1); + se1.shuntFromInput(); //step1 + System.out.println(se1); + se1.pushToStack(); //step2 + System.out.println(se1); + se1.shuntFromInput(); //step3 + System.out.println(se1); + se1.pushToStack(); //step4 + System.out.println(se1); + se1.shuntFromInput(); //step5 + System.out.println(se1); + se1.shuntFromStack(); //step6 + System.out.println(se1); + se1.shuntFromStack(); //step7 + System.out.println(se1); + System.out.println("-----------FIN à la main---------------"); + + // avec l'algo + System.out.println("-----avec l'algo -----"); + System.out.println(se2); + se2.shunting(); + System.out.println(se2); + se2.shunting(); + System.out.println(se2); + se2.shunting(); + System.out.println(se2); + se2.shunting(); + System.out.println(se2); + se2.shunting(); + System.out.println(se2); + se2.shunting(); + System.out.println(se2); + se2.shunting(); + System.out.println(se2); + + // se2.shunting(); + // System.out.println(se2); + // se2.shunting(); + // System.out.println(se2); + } +} + diff --git a/DEV3.4/ControleMachine/test/ExempleSY2.java b/DEV3.4/ControleMachine/test/ExempleSY2.java new file mode 100644 index 0000000..212f8bf --- /dev/null +++ b/DEV3.4/ControleMachine/test/ExempleSY2.java @@ -0,0 +1,43 @@ +import java.util.Deque; +import java.util.ArrayDeque; + +public class ExempleSY2{ + public static void main(String[] args){ + // 3 + 4 * 2 − 1 + // doit donner 342*+1- + Deque<AbstractToken> expression = new ArrayDeque<AbstractToken>(); + expression.addLast(new TokenConstant(3)); + expression.addLast(new TokenOperator(Operator.ADD)); + expression.addLast(new TokenConstant(4)); + expression.addLast(new TokenOperator(Operator.MUL)); + expression.addLast(new TokenConstant(2)); + expression.addLast(new TokenOperator(Operator.SUB2)); + expression.addLast(new TokenConstant(1)); + + ShuntingYard se = new ShuntingYard(expression); + + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + + } +} + diff --git a/DEV3.4/ControleMachine/test/ExempleSY3.java b/DEV3.4/ControleMachine/test/ExempleSY3.java new file mode 100644 index 0000000..7ec2db9 --- /dev/null +++ b/DEV3.4/ControleMachine/test/ExempleSY3.java @@ -0,0 +1,48 @@ +import java.util.Deque; +import java.util.ArrayDeque; + +public class ExempleSY3{ + public static void main(String[] args){ + // 3 + 4 × (2 − 1) + // doit donner 3421-*+ + Deque<AbstractToken> expression = new ArrayDeque<AbstractToken>(); + expression.addLast(new TokenConstant(3)); + expression.addLast(new TokenOperator(Operator.ADD)); + expression.addLast(new TokenConstant(4)); + expression.addLast(new TokenOperator(Operator.MUL)); + expression.addLast(new TokenSeparator(Separator.LB)); + expression.addLast(new TokenConstant(2)); + expression.addLast(new TokenOperator(Operator.SUB2)); + expression.addLast(new TokenConstant(1)); + expression.addLast(new TokenSeparator(Separator.RB)); + + ShuntingYard se = new ShuntingYard(expression); + + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + } +} + diff --git a/DEV3.4/ControleMachine/test/ExempleSY4.java b/DEV3.4/ControleMachine/test/ExempleSY4.java new file mode 100644 index 0000000..6b690b4 --- /dev/null +++ b/DEV3.4/ControleMachine/test/ExempleSY4.java @@ -0,0 +1,105 @@ +import java.util.Deque; +import java.util.ArrayDeque; + + + +public class ExempleSY4{ + public static void main(String[] args){ + // utilisation de l'algo de Fortan sur l'expression de ExempleSY3 + // (( 3 ))+(( 4 )*( ( (( 2 ))-(( 1))))) + // doit donner 3421-*+ mais le parseur actuel ne sait pas gérer plusieurs parenthèses. + Deque<AbstractToken> expression = new ArrayDeque<AbstractToken>(); + expression.addLast(new TokenSeparator(Separator.LB)); + expression.addLast(new TokenSeparator(Separator.LB)); + expression.addLast(new TokenConstant(3)); + expression.addLast(new TokenSeparator(Separator.RB)); + expression.addLast(new TokenSeparator(Separator.RB)); + expression.addLast(new TokenOperator(Operator.ADD)); + expression.addLast(new TokenSeparator(Separator.LB)); + expression.addLast(new TokenSeparator(Separator.LB)); + expression.addLast(new TokenConstant(4)); + expression.addLast(new TokenSeparator(Separator.RB)); + expression.addLast(new TokenOperator(Operator.MUL)); + expression.addLast(new TokenSeparator(Separator.LB)); + expression.addLast(new TokenSeparator(Separator.LB)); + expression.addLast(new TokenSeparator(Separator.LB)); + expression.addLast(new TokenSeparator(Separator.LB)); + expression.addLast(new TokenConstant(2)); + expression.addLast(new TokenSeparator(Separator.RB)); + expression.addLast(new TokenSeparator(Separator.RB)); + expression.addLast(new TokenOperator(Operator.SUB2)); + expression.addLast(new TokenSeparator(Separator.LB)); + expression.addLast(new TokenSeparator(Separator.LB)); + expression.addLast(new TokenConstant(1)); + expression.addLast(new TokenSeparator(Separator.RB)); + expression.addLast(new TokenSeparator(Separator.RB)); + expression.addLast(new TokenSeparator(Separator.RB)); + expression.addLast(new TokenSeparator(Separator.RB)); + expression.addLast(new TokenSeparator(Separator.RB)); + + ShuntingYard se = new ShuntingYard(expression); + + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + } +} + diff --git a/DEV3.4/ControleMachine/test/ExempleSY5.java b/DEV3.4/ControleMachine/test/ExempleSY5.java new file mode 100644 index 0000000..fc19aba --- /dev/null +++ b/DEV3.4/ControleMachine/test/ExempleSY5.java @@ -0,0 +1,73 @@ +import java.util.Deque; +import java.util.ArrayDeque; + +public class ExempleSY5{ + public static void main(String[] args){ + // 3 + 4 * 2 / ( 1 − 5 ) ^ 2 ^ 3 + // doit donner 342*15-23^^/+ + Deque<AbstractToken> expression = new ArrayDeque<AbstractToken>(); + expression.addLast(new TokenConstant(3)); + expression.addLast(new TokenOperator(Operator.ADD)); + expression.addLast(new TokenConstant(4)); + expression.addLast(new TokenOperator(Operator.MUL)); + expression.addLast(new TokenConstant(2)); + expression.addLast(new TokenOperator(Operator.DIV)); + expression.addLast(new TokenSeparator(Separator.LB)); + expression.addLast(new TokenConstant(1)); + expression.addLast(new TokenOperator(Operator.SUB2)); + expression.addLast(new TokenConstant(5)); + expression.addLast(new TokenSeparator(Separator.RB)); + expression.addLast(new TokenOperator(Operator.EXP)); + expression.addLast(new TokenConstant(2)); + expression.addLast(new TokenOperator(Operator.EXP)); + expression.addLast(new TokenConstant(3)); + + ShuntingYard se = new ShuntingYard(expression); + + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + + } +} + diff --git a/DEV3.4/ControleMachine/test/Operator.java b/DEV3.4/ControleMachine/test/Operator.java new file mode 100644 index 0000000..09b16e3 --- /dev/null +++ b/DEV3.4/ControleMachine/test/Operator.java @@ -0,0 +1,35 @@ +/** + * Enum pour représenter les opérations sur les entiers (pas d'autre type manipulé pour l'instant). + * + * Attention : l'ordre de l'énumération sert à coder la précédence des opérateurs. + * + * @author Florent Madelaine + */ + + +public enum Operator { + SUB1 ("-", true), + EXP ("^", false), + MUL ("*", true), + DIV ("/", true), + ADD ("+", true), + SUB2 ("-", true); + + private final String str; // String in original program + + private final boolean isLeftAssociative; + + public boolean isLeftAssociative(){ + return isLeftAssociative; + } + + private Operator(String str, boolean b){ + this.str=str; + this.isLeftAssociative=b; + } + + @Override + public String toString(){ + return this.str; + } +} diff --git a/DEV3.4/ControleMachine/test/Questions.md b/DEV3.4/ControleMachine/test/Questions.md new file mode 100644 index 0000000..baa4434 --- /dev/null +++ b/DEV3.4/ControleMachine/test/Questions.md @@ -0,0 +1,214 @@ +# Questions. +ce fichier sert à indiquer les réponses après chaque question, indiquez aussi svp vos nom et prénom. +il faut rédiger au format markdown svp. +En particulier, le code est à mettre entre deux triple quotes. + +Les sources sont disponibles en ligne sur le site des TPs. + +Vous devez rendre sur devoir une archive tar.gz contenant un répertoire test/ contenant les fichiers java (pas les .class) et ce fichier Questions.md. + +```bash +tar -czvf test.tar.gz test/ +``` + +Nom : Pourchot +Prénom : Adrian + + +## Programmation défensive. + +1. [2 points] Préparez la javadoc pour les 4 méthodes suivantes de ShuntingYard + shuntFromInput() + shuntFromStack() + pushToStack() + crushParenthesis() + +Il faut prévoir un comportement adapté en cas de problème. +Par exemple shuntFromInput ne devrait transférer que des TokenConstant et des TokenVariable +et pushToStack ne devrait transférer que des TokenOperator ou des parenthèse gauche. + +Indiquez la javadoc dans ce fichier juste après cette ligne, en recopiant la première ligne de déclaration de chaque méthode. + +--- +```java +/** + * Envoie la premiere constante ou variables de la file d'entrée vers la file de sortie. + * Si le Token récupéré n'est pas TokenConstant ou un TokenVariable, il y a 2 cas possible: + * Soit il s'agit d'un TokenOperator ou d'un TokenSeparator de gauche, dans ce cas on replace l'élément extrait au départ de la file d'entrée + * puis on fait appel à la méthode shuntFromStack() plutôt que celle-ci. + * Soit il s'agit d'un TokenSeparator de droite, dans ce cas on la replace au départ de ola file d'entrée et on fait appel à la méthode crushParenthesis() + * pour la supprimer. + */ + public void shuntFromInput() { + +/** + * Envoie le dernier élément de la pile stack vers la file de sortie. + */ + public void shuntFromStack() { + +/** + * Envoie le premier opérateur ou parenthèse gauche de la file d'entrée vers la pile stack. + * Si le Token récupéré n'est pas un TokenOperator ou un TokenSeparator de gauche, il y a 2 cas possible: + * Soit le Token est un TokenConstant ou un TokenVariable, dans ce cas on replace le Token extrait au départ de la file d'entrée + * puis on fait appel à la méthode shuntFromInput() plutôt que celle-ci. + * Soit il s'agit d'un TokenSeparator de droite, dans ce cas on la replace au départ de ola file d'entrée et on fait appel à la méthode crushParenthesis() + * pour la supprimer. + */ + public void pushToStack(){ + +/** + * Supprime le premier élément de la file d'entrée et le dernier de la pile stack. + * @exception IllegalStateException Renvoyer si il y s'agit d'un cas particulier. + */ + public void crushParenthesis(){ +``` + +--- + +2. [2 points] Proposez le changement adapté au code de shuntFromInput et de pushToStack + +donnez le code ci-dessous. + +--- + +public void shuntFromInput() { + x=this.input.getFirst(); + if(x instanceof(TokenConstant)||x instanceof(TokenVariable)) + this.output.addLast(x); + else if(x instanceof(TokenOperator)){ + this.input.addFirst(x); + shuntFromStack(); + } + else if(x.getSeparator().equals(Separator.LB)){ + this.input.addFirst(x); + shuntFromStack(); + } + else{ + this.input.addFirst(x); + crushParenthesis(); + } + } + +--- + +## Invariant +3. [2 points] Quels sont les invariants des méthodes suivantes? + shuntFromInput() + shuntFromStack() + pushToStack() +--- + + +--- + +## Debug +4. [1 point] Faite tourner les tests avec le fichier JUnit fourni (TestShuntingYard1.java) + Quels tests sont passés avec succès? + Quels tests ne sont pas passés avec succès? +--- + +Test réussi: + +1) pushStack(TestShuntingYard1) + + +Test échoué: + +1) shuntingTest1(TestShuntingYard1) +2) shuntInput(TestShuntingYard1) +3) shuntStack(TestShuntingYard1) +4) CandyCrush(TestShuntingYard1) + +--- + +5. [7 points] Pour chaque test non passé, indiquez le bug que vous observez en français. + Puis pour chaque test non passé, proposez un changement de code. + + Il faut indiquer le numéro de la ligne dans le fichier initial (vous pouvez le renommer en ajoutant OLD au bout avant de changer le fichier dans une copie). + recopier la ligne, puis indiquez en dessous la nouvelle ligne. + Il faut expliquer en français dans un commentaire ci-dessous en quoi ce changement consiste. + Dans le fichier changé, il faut ajouter en commentaire à la fin //BUGFIX 0 où le numéro correspond à la notation ci-dessous. + En dessous je vous donne une exemple en cadeau. + +--- + +### Test concerné : +aucun, ceci est un BUGFIX gratuit pour indiquer le format attendu +Le test d'arrêt de ShuntingYard est incorrect, car il faut lever l'exception seulement quand l'input et la pile sont vide, pas l'un ou l'autre. + +ShuntingYard.java line 73 (avant): + +```java + return (this.input.isEmpty() || this.stack.isEmpty()); +``` + +devient +ShuntingYard.java line 73 (après): + +```java + return (this.input.isEmpty() && this.stack.isEmpty()); //BUG FIX 0 +``` + +### Test concerné : +??? + +```java + // BUGFIX 1 +``` + +```java + // BUGFIX 2 +``` + +--- +1) shuntingTest1(TestShuntingYard1): On observe que le shunting c'est arrêter car la file d'entrée et la pile stack étaient vide ce qui ne devrait pas être le cas. + +2) shuntInput(TestShuntingYard1): On observe que l'AbstractToken n'est pas trouvé dans la file alors qu'il devrait. + +3) shuntStack(TestShuntingYard1): Même chose que pour shuntInput, un AbstractToken n'est pas trouvé dans la pile alors qu'il devrait. + +4) CandyCrush(TestShuntingYard1): On observe qu'une parenthèse droite est trouvé alors qu'il devrait s'agir d'une parenthèse gauche. + + +--- + +6. [6 points] Complétez le fichier de test TestShuntingYard2.java + +a) [1 point] Proposez un test JUnit pour attraper un NullPointerException lorsqu'on appelle shuntFromInput() sur un input vide. + +indiquez le nom de ce test ici : + +--- + +--- + +b) [1 point] Proposez un test JUnit pour attraper l'exception adaptée lorsqu'on appelle shuntFromInput() sur un input dont le prochain token n'est pas un TokenVariable ou un TokenConstant. + +indiquez le nom de ce test ici : + +--- + +--- + +c) [2 points] Pour l'exemple ExempleSY2.java, proposez la liste des instructions primitives correspondant à l'algo de Dijkstra. + (i.e. les primitives que shunting devrait appeller si code convenablement). + +--- + + +```java + +``` + +--- + + +d) [3 points] +Proposez un test JUnit correspondant à l'exemple ExempleSY2.java +Expliquez bien votre démarche. + +indiquez le nom de ce test ici, puis expliquez votre démarche : + +--- + +--- diff --git a/DEV3.4/ControleMachine/test/README.txt b/DEV3.4/ControleMachine/test/README.txt new file mode 100644 index 0000000..789916c --- /dev/null +++ b/DEV3.4/ControleMachine/test/README.txt @@ -0,0 +1,47 @@ +Ce projet concerne l'agorithme de Dijkstra présenté sur wikipedia +ici : +https://en.wikipedia.org/wiki/Shunting_yard_algorithm + +================================================================= + +Ce projet contient le présent fichier et une image et des fichiers java +README.txt descripton des fichiers de ce répertoire +Shunting_yard.svg.png image tiré de la page wikipedia de l'algo + +================================================================= +Ce projet concerne les fichiers java suivant. + +AbstractToken.java type abstrait pour les token (jeton) d'une expression. +TokenConstant.java hérite du précédent, jeton pour les constantes +TokenVariable.java jeton pour les variables + ReservedWord.java type énuméré pour les mots réservés qui ne peuvent être des noms de variable. +TokenOperator.java jeton pour les opérateurs + Operator.java type énuméré pour les symboles d'opérateurs, utilisé par TokenOperator +TokenSeparator.java jeton pour les séparateurs + Separator.java type énuméré pour les symboles de séparateurs, utilisé par TokenSeparator + +Exemple.java exemple d'expression construite + +ShuntingYard.java classe fournissant l'algorithme de parsing de Dijkstra + +ExempleSY1.java exemple d'usage de Shunting Yard +ExempleSY2.java exemple d'usage de Shunting Yard +ExempleSY3.java exemple d'usage de Shunting Yard +ExempleSY4.java exemple d'usage de Shunting Yard +ExempleSY5.java exemple d'usage de Shunting Yard + +================================================================ +Pour l'examen proprement dit. + +Questions.md fichier avec le barème et les questions + +TestShuntingYard1.java fichier de test fourni +TestShuntingYard2.java fichier de test à compléter + + + + + + + + diff --git a/DEV3.4/ControleMachine/test/ReservedWord.java b/DEV3.4/ControleMachine/test/ReservedWord.java new file mode 100644 index 0000000..43692f1 --- /dev/null +++ b/DEV3.4/ControleMachine/test/ReservedWord.java @@ -0,0 +1,23 @@ +/** + * Enum pour représenter les mots réservés du langage qui ne peuvent pas être des noms de variables. + * + * + * @author Florent Madelaine + */ + + +public enum ReservedWord { + INT ("int"), + FUNC ("function"); + + private final String str; // String in original program + + private ReservedWord(String str){ + this.str=str; + } + + @Override + public String toString(){ + return this.str; + } +} diff --git a/DEV3.4/ControleMachine/test/Separator.java b/DEV3.4/ControleMachine/test/Separator.java new file mode 100644 index 0000000..a1df022 --- /dev/null +++ b/DEV3.4/ControleMachine/test/Separator.java @@ -0,0 +1,28 @@ +/** + * Enum pour représenter les "séparateurs" dans le programme. + * + * @author Florent Madelaine + */ + + +public enum Separator { + LB ("("), + RB (")"), + COMMA (","), + SCL (";"), + LCB ("{"), + RCB ("}"), + LSB ("["), + RSB ("]"); + + private final String str; // String in original program + + private Separator(String str){ + this.str=str; + } + + @Override + public String toString(){ + return this.str; + } +} diff --git a/DEV3.4/ControleMachine/test/ShuntingYard.java b/DEV3.4/ControleMachine/test/ShuntingYard.java new file mode 100644 index 0000000..43eaea1 --- /dev/null +++ b/DEV3.4/ControleMachine/test/ShuntingYard.java @@ -0,0 +1,273 @@ +import java.util.Deque; +import java.util.ArrayDeque; + +/** + * Classe implémentant l'algorithme proposé par Dijkstra en 1961 pour transformer une expression en notation infixe, en expression postfixe. + * https://en.wikipedia.org/wiki/Shunting_yard_algorithm + * + * Le constructeur prend en entrée l'entrée de l'algorithme (input) qui sera une file de AbstractToken et initialise + * une pile pour les opérateurs et séparateurs, et une file de sortie. + * Pour uniformiser, tout est modélisé avec l'interface Deque pour des AbstractToken. + * + * En pratique les seuls mouvements entre ces trois structures de données sont faits par trois primitives : + * shuntFromInput() (input vers output) + * shuntFromStack() (stack vers output) + * pushToStack() (input vers stack) + * + * L'algorithme fonctionne par analogie au rangement des wagons dans une gare de triage (shunting yard veut dire gare de triage). + * + * output ================== input + * \\ // + * \ / + * \/ + * || + * stack + * + * Le dessin en ASCII ci-dessus a été qualifié de "Jackson Pollock" du crobar par Luc Hernandez. + * Pour un exemple plus explicite : regardez svp le dessin "Shunting_yard.svg.png" + * + * + * Les constantes et les variables sont envoyées de droite à gauche avec shuntFromInput + * Les symboles d'opérations ou de séparation sont envoyés sur la pile avec pushToStack + * puis envoyés en sortie avec shuntFromStack quand c'est le bon moment. + * + * pour les opérateurs, en gros tout se décide avec la priorité des opérations + * En cas d'égalité on regarde si l'opérateur est associatif à gauche : + * ceci est le cas des 4 opérations binaires * \/ + - mais pas de l'exponentiation ^ (associativité à droite). + * Ainsi a^b^c sera interprété convenablement comme a^(b^c) + * + * @author Florent Madelaine + */ + + +public class ShuntingYard { + /** + * + * + */ + private Deque<AbstractToken> input; + private Deque<AbstractToken> output; + private Deque<AbstractToken> stack; + + public ShuntingYard(Deque<AbstractToken> input){ + this.input = input; + this.output = new ArrayDeque<AbstractToken>(); + this.stack = new ArrayDeque<AbstractToken>(); + } + + public Deque<AbstractToken> getInput(){ + return this.input; + } + + public Deque<AbstractToken> getOutput(){ + return this.stack; + } + + public Deque<AbstractToken> getStack(){ + return this.output; + } + + + // input and stack are empty + public boolean isOver(){ + return (this.input.isEmpty() || this.stack.isEmpty()); //BUG FIX 1 + } + + // + // output <---------------- input + // + // + // stack + /** + * Envoie la premiere constante ou variables de la file d'entrée vers la file de sortie. + * Si le Token récupéré n'est pas TokenConstant ou un TokenVariable, il y a 2 cas possible: + * Soit il s'agit d'un TokenOperator ou d'un TokenSeparator de gauche, dans ce cas on replace l'élément extrait au départ de la file d'entrée + * puis on fait appel à la méthode shuntFromStack() plutôt que celle-ci. + * Soit il s'agit d'un TokenSeparator de droite, dans ce cas on la replace au départ de la file d'entrée et on fait appel à la méthode crushParenthesis() + * pour la supprimer. + */ + public void shuntFromInput() { + x=this.input.getFirst(); + if(x instanceof(TokenConstant)||x instanceof(TokenVariable)) + this.output.addLast(x); + else if(x instanceof(TokenOperator)){ + this.input.addFirst(x); + shuntFromStack(); + } + else if(x.getSeparator().equals(Separator.LB)){ + this.input.addFirst(x); + shuntFromStack(); + } + else{ + this.input.addFirst(x); + crushParenthesis(); + } + } + + + // output <--- input + // \ + // | + // stack + /** + * Envoie le dernier élément de la pile stack vers la file de sortie. + */ + public void shuntFromStack() { + this.output.addFirst(this.stack.removeLast()); + } + + // output ---------- input + // / + // V + // stack + /** + * Envoie le premier opérateur ou parenthèse gauche de la file d'entrée vers la pile stack. + * Si le Token récupéré n'est pas un TokenOperator ou un TokenSeparator de gauche, il y a 2 cas possible: + * Soit le Token est un TokenConstant ou un TokenVariable, dans ce cas on replace le Token extrait au départ de la file d'entrée + * puis on fait appel à la méthode shuntFromInput() plutôt que celle-ci. + * Soit il s'agit d'un TokenSeparator de droite, dans ce cas on la replace au départ de ola file d'entrée et on fait appel à la méthode crushParenthesis() + * pour la supprimer. + */ + public void pushToStack(){ + this.stack.addFirst(this.input.getFirst()); + } + + // output ) input + // ^ + // ( <------| both to be destroyed + // stack + // + // throws IllegalStateException si ce n'est pas exactement ce cas. + /** + * Supprime le premier élément de la file d'entrée et le dernier de la pile stack. + * @exception IllegalStateException Renvoyer si il y s'agit d'un cas particulier. + */ + public void crushParenthesis(){ + this.stack.removeLast(); + this.input.removeFirst(); + } + + // does one step of Dijkstra Shunting algorithm + // if is is done it throws the exception + public void shunting(){ + if (isOver()) throw new IllegalStateException("the shunting is over, since both the input and the stack are empty."); + else if (this.input.isEmpty()){ + if (this.stack.getFirst() instanceof TokenSeparator){ + TokenSeparator s = (TokenSeparator) this.stack.getFirst(); + if (s.getSeparator().equals(Separator.LB)){ + throw new IllegalArgumentException("the shunting is over with a parenthesis mismatch extra left bracket");} + } + else // should be an operator + shuntFromStack(); + } + else if (this.input.getFirst() instanceof TokenConstant) { + shuntFromInput(); + shuntFromInput(); + } + // else + if (this.input.getFirst() instanceof TokenVariable) { + shuntFromInput(); + } + else if (this.input.getFirst() instanceof TokenSeparator) { + TokenSeparator s = (TokenSeparator) this.input.getFirst(); + // test si LB left bracket + if (s.getSeparator().equals(Separator.LB)){ + pushToStack(); + } + else if (s.getSeparator().equals(Separator.RB)){ + if(stack.isEmpty()) throw new IllegalArgumentException("the shunting is over with a parenthesis mismatch extra right bracket"); + else { + if (this.stack.getFirst() instanceof TokenOperator){ + shuntFromStack(); // should be the operator concerned by parenthesis + } + else {// it is a separator + crushParenthesis(); // we discard the parenthesis. + } + } + } + } + else if (this.input.getFirst() instanceof TokenOperator) { + if (this.stack.isEmpty()){ + pushToStack(); + } + else if (this.stack.getFirst() instanceof TokenSeparator){ + TokenSeparator s = (TokenSeparator) this.stack.getFirst(); + pushToStack(); + } + else if (this.stack.getFirst() instanceof TokenOperator){ + TokenOperator o = (TokenOperator) this.input.getFirst(); + TokenOperator o2 = (TokenOperator) this.stack.getFirst(); + if (o2.takesPrecedenceOver(o)){ + shuntFromStack(); + } + else pushToStack();// shuntFromInput();// input takes precedence + } + } + } + + @Override + public String toString(){ + StringBuilder b = new StringBuilder(); + b.append("\t\t\t\t"); + for(AbstractToken t : this.input ){ + b.append(t.toString()); + } + b.append(" :input\noutput: "); + for(AbstractToken t : this.output ){ + b.append(t.toString()); + } + b.append("\n\t\t stack: "); + for(AbstractToken t : this.stack ){ + b.append(t.toString()); + } + b.append("\n"); + b.append("--------------------------------------------------------------\n"); + return b.toString(); + } + + + + public static void main(String[] args){ + // 3 + 4 × (2 − 1) + // pas de parenthèse encore, je fais 3 + 4 * 2 + Deque<AbstractToken> expression = new ArrayDeque<AbstractToken>(); + expression.addLast(new TokenConstant(3)); + expression.addLast(new TokenOperator(Operator.ADD)); + expression.addLast(new TokenConstant(4)); + expression.addLast(new TokenOperator(Operator.MUL)); + expression.addLast(new TokenSeparator(Separator.LB)); + expression.addLast(new TokenConstant(2)); + expression.addLast(new TokenOperator(Operator.SUB2)); + expression.addLast(new TokenConstant(1)); + expression.addLast(new TokenSeparator(Separator.RB)); + + ShuntingYard se = new ShuntingYard(expression); + + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + System.out.println(se); + se.shunting(); + } + +} + diff --git a/DEV3.4/ControleMachine/test/Shunting_yard.svg.png b/DEV3.4/ControleMachine/test/Shunting_yard.svg.png new file mode 100644 index 0000000..f7f52fb Binary files /dev/null and b/DEV3.4/ControleMachine/test/Shunting_yard.svg.png differ diff --git a/DEV3.4/ControleMachine/test/TestShuntingYard1.java b/DEV3.4/ControleMachine/test/TestShuntingYard1.java new file mode 100644 index 0000000..abc1b5d --- /dev/null +++ b/DEV3.4/ControleMachine/test/TestShuntingYard1.java @@ -0,0 +1,179 @@ +import java.util.Deque; +import java.util.ArrayDeque; + +import static org.junit.Assert.assertTrue; // import static : une facilité offerte depuis java5 (pas besoin de mettre le préfixe) +import static org.junit.Assert.assertFalse; // +import static org.junit.Assert.assertSame; // +import static org.junit.Assert.assertNotSame; // +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertArrayEquals; +import org.junit.Test; + + +/** + * Une classe pour faire des tests sur la classe ShuntingYard avec JUnit + */ +public class TestShuntingYard1 { + + + /** + * ShuntInput déplace un token depuis input vers output + * + */ + @Test + public void shuntInput(){ + Deque<AbstractToken> expression = new ArrayDeque<AbstractToken>(); + expression.addLast(new TokenConstant(3)); + ShuntingYard se = new ShuntingYard(expression); + AbstractToken t1 = se.getInput().getFirst(); + se.shuntFromInput(); + AbstractToken t2 = se.getOutput().getLast(); + assertSame(t1,t2); + } + + /** + * PushStack déplace un token depuis input vers stack + * + */ + @Test + public void pushStack(){ + Deque<AbstractToken> expression = new ArrayDeque<AbstractToken>(); + expression.addLast(new TokenConstant(3)); + expression.addLast(new TokenOperator(Operator.ADD)); + expression.addLast(new TokenConstant(4)); + ShuntingYard se = new ShuntingYard(expression); + se.shuntFromInput(); + AbstractToken t1 = se.getInput().getFirst(); + se.pushToStack(); + AbstractToken t2 = se.getStack().getFirst(); + assertSame(t1,t2); + } + + /** + * ShuntFromStack déplace un token depuis stack vers output + * + */ + @Test + public void shuntStack(){ + Deque<AbstractToken> expression = new ArrayDeque<AbstractToken>(); + expression.addLast(new TokenConstant(3)); + expression.addLast(new TokenOperator(Operator.ADD)); + expression.addLast(new TokenConstant(4)); + ShuntingYard se = new ShuntingYard(expression); + se.shuntFromInput(); + se.pushToStack(); + se.shuntFromInput(); + AbstractToken t1 = se.getStack().getFirst(); + se.shuntFromStack(); + AbstractToken t2 = se.getOutput().getLast(); + assertSame(t1,t2); + } + + /** + * crushParenthesis écrase les parenthèses quand stack est une LB + * et input est un RB + */ + @Test + public void CandyCrush(){ + Deque<AbstractToken> expression = new ArrayDeque<AbstractToken>(); + expression.addLast(new TokenSeparator(Separator.LB)); + expression.addLast(new TokenConstant(2)); + expression.addLast(new TokenOperator(Operator.SUB2)); + expression.addLast(new TokenConstant(1)); + expression.addLast(new TokenSeparator(Separator.RB)); + ShuntingYard se = new ShuntingYard(expression); + se.pushToStack(); + se.shuntFromInput(); + se.pushToStack(); + se.shuntFromInput(); + se.shuntFromStack(); + //prêt pour enlever les parenthèses. + AbstractToken t1 = se.getStack().getFirst(); + TokenSeparator s1 = (TokenSeparator) t1; + int sizeStackbefore = se.getStack().size(); + AbstractToken t2 = se.getInput().getFirst(); + TokenSeparator s2 = (TokenSeparator) t2; + int sizeInputbefore = se.getInput().size(); + assertEquals(Separator.LB,s1.getSeparator()); + assertEquals(Separator.RB,s2.getSeparator()); + se.crushParenthesis(); + int sizeStackafter = se.getStack().size(); + int sizeInputafter = se.getInput().size(); + assertEquals(sizeStackbefore-1,sizeStackafter); + assertEquals(sizeInputbefore-1,sizeInputafter); + } + + /** + * shunbtingTest1 vérifie que tout se passe bien pour l'exemple de ExempleSY1 + */ + @Test + public void shuntingTest1(){ + ArrayDeque<AbstractToken> expression = new ArrayDeque<AbstractToken>(); + expression.addLast(new TokenConstant(3)); + expression.addLast(new TokenOperator(Operator.ADD)); + expression.addLast(new TokenConstant(4)); + expression.addLast(new TokenOperator(Operator.MUL)); + expression.addLast(new TokenConstant(2)); + + // moralement on veut tester que les trois structures de données sont les mêmes de manière synchrone entre ceci + // ShuntingYard se1 = new ShuntingYard(expression); + // se1.shuntFromInput(); //step1 + // se1.pushToStack(); //step2 + // se1.shuntFromInput(); //step3 + // se1.pushToStack(); //step4 + // se1.shuntFromInput(); //step5 + // se1.shuntFromStack(); //step6 + // se1.shuntFromStack(); //step7 + // et cela + // ShuntingYard se2 = new ShuntingYard(expression); + // se2.shunting(); //step1 + // Pour tester on utilise la facilité permettant de comparer élément pas élément deux tableaux. + // assertArrayEquals("Inputs are not the same",se1.getInput().toArray(),se2.getInput().toArray()); + // assertArrayEquals("stacks are not the same",se1.getStack().toArray(),se2.getStack().toArray()); + // assertArrayEquals("Output are not the same",se1.getOutput().toArray(),se2.getOutput().toArray()); + ShuntingYard se1 = new ShuntingYard(expression); + ShuntingYard se2 = new ShuntingYard(expression.clone());// on clone l'expression, car sinon l'input est le même pour les deux exemples + assertArrayEquals("Inputs are not the same",se1.getInput().toArray(),se2.getInput().toArray()); + assertArrayEquals("stacks are not the same",se1.getStack().toArray(),se2.getStack().toArray()); + assertArrayEquals("Output are not the same",se1.getOutput().toArray(),se2.getOutput().toArray()); + se1.shuntFromInput(); //step1 + se2.shunting(); //step1 + assertArrayEquals("Inputs are not the same",se1.getInput().toArray(),se2.getInput().toArray()); + assertArrayEquals("stacks are not the same",se1.getStack().toArray(),se2.getStack().toArray()); + assertArrayEquals("Output are not the same",se1.getOutput().toArray(),se2.getOutput().toArray()); + se1.pushToStack(); //step2 + se2.shunting(); //step2 + assertArrayEquals("Inputs are not the same",se1.getInput().toArray(),se2.getInput().toArray()); + assertArrayEquals("stacks are not the same",se1.getStack().toArray(),se2.getStack().toArray()); + assertArrayEquals("Output are not the same",se1.getOutput().toArray(),se2.getOutput().toArray()); + se1.shuntFromInput(); //step3 + se2.shunting(); //step3 + assertArrayEquals("Inputs are not the same",se1.getInput().toArray(),se2.getInput().toArray()); + assertArrayEquals("stacks are not the same",se1.getStack().toArray(),se2.getStack().toArray()); + assertArrayEquals("Output are not the same",se1.getOutput().toArray(),se2.getOutput().toArray()); + se1.pushToStack(); //step4 + se2.shunting(); //step4 + assertArrayEquals("Inputs are not the same",se1.getInput().toArray(),se2.getInput().toArray()); + assertArrayEquals("stacks are not the same",se1.getStack().toArray(),se2.getStack().toArray()); + assertArrayEquals("Output are not the same",se1.getOutput().toArray(),se2.getOutput().toArray()); + se1.shuntFromInput(); //step5 + se2.shunting(); //step5 + assertArrayEquals("Inputs are not the same",se1.getInput().toArray(),se2.getInput().toArray()); + assertArrayEquals("stacks are not the same",se1.getStack().toArray(),se2.getStack().toArray()); + assertArrayEquals("Output are not the same",se1.getOutput().toArray(),se2.getOutput().toArray()); + se1.shuntFromStack(); //step6 + se2.shunting(); //step6 + assertArrayEquals("Inputs are not the same",se1.getInput().toArray(),se2.getInput().toArray()); + assertArrayEquals("stacks are not the same",se1.getStack().toArray(),se2.getStack().toArray()); + assertArrayEquals("Output are not the same",se1.getOutput().toArray(),se2.getOutput().toArray()); + se1.shuntFromStack(); //step7 + se2.shunting(); //step7 + assertArrayEquals("Inputs are not the same",se1.getInput().toArray(),se2.getInput().toArray()); + assertArrayEquals("stacks are not the same",se1.getStack().toArray(),se2.getStack().toArray()); + assertArrayEquals("Output are not the same",se1.getOutput().toArray(),se2.getOutput().toArray()); + } + + + + +} diff --git a/DEV3.4/ControleMachine/test/TestShuntingYard2.java b/DEV3.4/ControleMachine/test/TestShuntingYard2.java new file mode 100644 index 0000000..0d56df8 --- /dev/null +++ b/DEV3.4/ControleMachine/test/TestShuntingYard2.java @@ -0,0 +1,22 @@ +import java.util.Deque; +import java.util.ArrayDeque; + +import static org.junit.Assert.assertTrue; // import static : une facilité offerte depuis java5 (pas besoin de mettre le préfixe) +import static org.junit.Assert.assertFalse; // +import static org.junit.Assert.assertSame; // +import static org.junit.Assert.assertNotSame; // +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertArrayEquals; +import org.junit.Test; + + +/** + * Une classe pour faire des tests sur la classe ShuntingYard avec JUnit + */ +public class TestShuntingYard2 { + + + + + +} diff --git a/DEV3.4/ControleMachine/test/TokenConstant.java b/DEV3.4/ControleMachine/test/TokenConstant.java new file mode 100644 index 0000000..5bc455f --- /dev/null +++ b/DEV3.4/ControleMachine/test/TokenConstant.java @@ -0,0 +1,30 @@ +import java.util.Objects; + +/** + * Jeton pour les constantes + * + * sert uniquement aux entiers, pas d'autre type pour l'instant + * + * + * @author Florent Madelaine + */ + +public class TokenConstant extends AbstractToken { + + private int value; + + public TokenConstant (int i){ + Objects.requireNonNull(i, "i must not be null"); + this.value=i; + } + + public int getValue(){ + return this.value; + } + + @Override + public String toString(){ + return String.valueOf(this.value); + } +} + diff --git a/DEV3.4/ControleMachine/test/TokenOperator.java b/DEV3.4/ControleMachine/test/TokenOperator.java new file mode 100644 index 0000000..99d71e9 --- /dev/null +++ b/DEV3.4/ControleMachine/test/TokenOperator.java @@ -0,0 +1,39 @@ +import java.util.Objects; + +/** + * Jeton pour les opérateurs + * + * sert uniquement à des opérations entières, pas d'autre type pour l'instant. + * + * + * @author Florent Madelaine + * @see Operators.java + */ + + +public class TokenOperator extends AbstractToken{ + + private Operator o; + + public TokenOperator(Operator o){ + Objects.requireNonNull(o, "o must not be null"); + this.o=o; + } + + public Operator getOperator(){ + return this.o; + } + + public boolean takesPrecedenceOver(TokenOperator to2){ + return (this.o.ordinal() < to2.getOperator().ordinal() + || + ((this.o.ordinal() == to2.getOperator().ordinal()) + && + to2.getOperator().isLeftAssociative())); + } + + @Override + public String toString(){ + return this.o.toString(); + } +} diff --git a/DEV3.4/ControleMachine/test/TokenSeparator.java b/DEV3.4/ControleMachine/test/TokenSeparator.java new file mode 100644 index 0000000..f3b3c3f --- /dev/null +++ b/DEV3.4/ControleMachine/test/TokenSeparator.java @@ -0,0 +1,30 @@ +import java.util.Objects; + +/** + * Jeton pour les séparateurs + * + * parenthèses pour des expressions, etc. + * + * @author Florent Madelaine + * @see Separator.java + */ + + +public class TokenSeparator extends AbstractToken{ + + private Separator s; + + public TokenSeparator(Separator s){ + Objects.requireNonNull(s, "s must not be null"); + this.s=s; + } + + public Separator getSeparator(){ + return this.s; + } + + @Override + public String toString(){ + return this.s.toString(); + } +} diff --git a/DEV3.4/ControleMachine/test/TokenVariable.java b/DEV3.4/ControleMachine/test/TokenVariable.java new file mode 100644 index 0000000..426cd2e --- /dev/null +++ b/DEV3.4/ControleMachine/test/TokenVariable.java @@ -0,0 +1,49 @@ +import java.util.Objects; + +/** + * Jeton pour les variables + * + * sert uniquement à des variables entières, pas d'autre type pour l'instant. + * + * + * The general rules for naming variables are: + * + * Names can contain letters and digits + * Names must begin with a letter + * Names should start with a lowercase letter, and cannot contain whitespace + * Names are case-sensitive ("myVar" and "myvar" are different variables) + * Reserved words cannot be used as names + * + * + * @author Florent Madelaine + * @see ReservedWords.java + */ + + +public class TokenVariable extends AbstractToken { + + private final static String regexp="[a-z][0-9a-zA-Z]*"; + + private String variableName; // String in original program + + public TokenVariable (String s){ + Objects.requireNonNull(s, "s must not be null"); + for (ReservedWord k : ReservedWord.values()){ + if (k.toString().equals(s)){ + throw new IllegalArgumentException("Illegal variable name, attempt to use reserved keyword " + k.toString()); + } + } + if (! s.matches(this.regexp)){ + throw new IllegalArgumentException("Illegal variable name, name should start with a lower case letter followed potentially by digits or other letters lower or upper case."); + } + else { + this.variableName=s; + } + } + + @Override + public String toString(){ + return this.variableName; + } + +} diff --git a/DEV3.4/TP4/stub/0Bad/Base.class b/DEV3.4/TP4/stub/0Bad/Base.class index 729c95a..0a42418 100644 Binary files a/DEV3.4/TP4/stub/0Bad/Base.class and b/DEV3.4/TP4/stub/0Bad/Base.class differ diff --git a/DEV3.4/TP4/stub/0Bad/Exemple.class b/DEV3.4/TP4/stub/0Bad/Exemple.class index 1e92419..470d6f8 100644 Binary files a/DEV3.4/TP4/stub/0Bad/Exemple.class and b/DEV3.4/TP4/stub/0Bad/Exemple.class differ diff --git a/DEV3.4/TP4/stub/0Bad/MonBrin.class b/DEV3.4/TP4/stub/0Bad/MonBrin.class index 78df7e0..0da92a9 100644 Binary files a/DEV3.4/TP4/stub/0Bad/MonBrin.class and b/DEV3.4/TP4/stub/0Bad/MonBrin.class differ diff --git a/DEV3.4/TP4/stub/0Bad/MonMaillon.class b/DEV3.4/TP4/stub/0Bad/MonMaillon.class index a34e2ca..1323523 100644 Binary files a/DEV3.4/TP4/stub/0Bad/MonMaillon.class and b/DEV3.4/TP4/stub/0Bad/MonMaillon.class differ diff --git a/DEV3.4/TP4/stub/1Iterable/Base.class b/DEV3.4/TP4/stub/1Iterable/Base.class index 729c95a..0a42418 100644 Binary files a/DEV3.4/TP4/stub/1Iterable/Base.class and b/DEV3.4/TP4/stub/1Iterable/Base.class differ diff --git a/DEV3.4/TP4/stub/1Iterable/Exemple.class b/DEV3.4/TP4/stub/1Iterable/Exemple.class index 9e48e56..ab97995 100644 Binary files a/DEV3.4/TP4/stub/1Iterable/Exemple.class and b/DEV3.4/TP4/stub/1Iterable/Exemple.class differ diff --git a/DEV3.4/TP4/stub/1Iterable/MonBrin.class b/DEV3.4/TP4/stub/1Iterable/MonBrin.class index b69f223..818cb56 100644 Binary files a/DEV3.4/TP4/stub/1Iterable/MonBrin.class and b/DEV3.4/TP4/stub/1Iterable/MonBrin.class differ diff --git a/DEV3.4/TP4/stub/1Iterable/MonMaillon.class b/DEV3.4/TP4/stub/1Iterable/MonMaillon.class index 4334c4e..f0346b1 100644 Binary files a/DEV3.4/TP4/stub/1Iterable/MonMaillon.class and b/DEV3.4/TP4/stub/1Iterable/MonMaillon.class differ diff --git a/DEV32/Division.java b/DEV32/Division.java new file mode 100644 index 0000000..4abe7d6 --- /dev/null +++ b/DEV32/Division.java @@ -0,0 +1,43 @@ +//Pourchot Adrian +import java.util.*; + +public class Division{ + + public static void main(String[] args) { + ArrayDeque<String> entier = new ArrayDeque(args.length); + ArrayDeque<String> variable = new ArrayDeque(args.length); + //J'ai choisi une file comme structure de donnée car j'ai trouvé qu'il s'agissait de la solution la plus pratique pour la parcourir et récolter des éléments. + + for (int i=0; i<args.length; i++){ + if(String.valueOf(args[i].charAt(0)).equals(String.valueOf('-'))){ + try{ + Integer.parseInt(String.valueOf(args[i].charAt(1))); + entier.add(args[i]); + } catch(NumberFormatException e){ + variable.add(args[i]); + } + } + else{ + try{ + Integer.parseInt(String.valueOf(args[i].charAt(0))); + entier.add(args[i]); + } catch(NumberFormatException e){ + variable.add(args[i]); + } + } + } + /* + Pour la 2nd partie: + + variable.removeIf(String.valueOf(variable[i].charAt(0)).equals(String.valueOf('-'))); + */ + while(!entier.isEmpty()){ + System.out.print(" "+entier.remove()); + } + System.out.print("\n"); + while(!variable.isEmpty()){ + System.out.print(" "+variable.remove()); + } + System.out.print("\n"); + } +} \ No newline at end of file diff --git a/pourchot_dev32.tar.gz b/pourchot_dev32.tar.gz new file mode 100644 index 0000000..99d1ad2 Binary files /dev/null and b/pourchot_dev32.tar.gz differ