From 770e5afb22f7c1c4edb52eaf215d4e7703c50758 Mon Sep 17 00:00:00 2001 From: heighn23 <Ignacio.Hernandez_de_la_fuente@Student.Reutlingen-University.DE> Date: Thu, 18 Jan 2024 12:58:07 +0100 Subject: [PATCH] stuffify --- .idea/codeStyles/Project.xml | 123 ------------------ .idea/codeStyles/codeStyleConfig.xml | 5 - .idea/compiler.xml | 2 +- .idea/deploymentTargetDropDown.xml | 29 ----- .idea/gradle.xml | 4 +- .idea/kotlinc.xml | 6 - .idea/migrations.xml | 10 -- .idea/misc.xml | 2 +- README.md | 93 ------------- app/build.gradle | 50 +++++++ app/build.gradle.kts | 50 ------- app/google-services.json | 30 ----- .../ExampleInstrumentedTest.kt | 4 +- app/src/main/AndroidManifest.xml | 31 +++-- .../com/example/googlemapsapp/MapsActivity.kt | 91 +++++++++++++ .../mobilecomputingapp/LoginActivity.kt | 76 ----------- .../mobilecomputingapp/MainActivity.kt | 20 --- .../mobilecomputingapp/SignupActivity.kt | 69 ---------- .../example/mobilecomputingapp/UserData.kt | 7 - app/src/main/res/drawable/edittext_border.xml | 9 -- app/src/main/res/layout/activity_login.xml | 70 ---------- app/src/main/res/layout/activity_main.xml | 22 ---- app/src/main/res/layout/activity_maps.xml | 9 ++ app/src/main/res/layout/activity_signup.xml | 70 ---------- .../res/mipmap-anydpi-v26/ic_launcher.xml | 1 - .../mipmap-anydpi-v26/ic_launcher_round.xml | 1 - app/src/main/res/values-night/themes.xml | 15 ++- app/src/main/res/values/colors.xml | 7 +- app/src/main/res/values/strings.xml | 3 +- app/src/main/res/values/themes.xml | 19 ++- .../ExampleUnitTest.kt | 2 +- build.gradle | 7 + build.gradle.kts | 11 -- gradle.properties | 4 +- gradle/libs.versions.toml | 30 ----- gradle/wrapper/gradle-wrapper.properties | 6 +- settings.gradle | 16 +++ settings.gradle.kts | 24 ---- 38 files changed, 237 insertions(+), 791 deletions(-) delete mode 100644 .idea/codeStyles/Project.xml delete mode 100644 .idea/codeStyles/codeStyleConfig.xml delete mode 100644 .idea/deploymentTargetDropDown.xml delete mode 100644 .idea/kotlinc.xml delete mode 100644 .idea/migrations.xml delete mode 100644 README.md create mode 100644 app/build.gradle delete mode 100644 app/build.gradle.kts delete mode 100644 app/google-services.json rename app/src/androidTest/java/com/example/{mobilecomputingapp => googlemapsapp}/ExampleInstrumentedTest.kt (82%) create mode 100644 app/src/main/java/com/example/googlemapsapp/MapsActivity.kt delete mode 100644 app/src/main/java/com/example/mobilecomputingapp/LoginActivity.kt delete mode 100644 app/src/main/java/com/example/mobilecomputingapp/MainActivity.kt delete mode 100644 app/src/main/java/com/example/mobilecomputingapp/SignupActivity.kt delete mode 100644 app/src/main/java/com/example/mobilecomputingapp/UserData.kt delete mode 100644 app/src/main/res/drawable/edittext_border.xml delete mode 100644 app/src/main/res/layout/activity_login.xml delete mode 100644 app/src/main/res/layout/activity_main.xml create mode 100644 app/src/main/res/layout/activity_maps.xml delete mode 100644 app/src/main/res/layout/activity_signup.xml rename app/src/test/java/com/example/{mobilecomputingapp => googlemapsapp}/ExampleUnitTest.kt (88%) create mode 100644 build.gradle delete mode 100644 build.gradle.kts delete mode 100644 gradle/libs.versions.toml create mode 100644 settings.gradle delete mode 100644 settings.gradle.kts diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml deleted file mode 100644 index 7643783..0000000 --- a/.idea/codeStyles/Project.xml +++ /dev/null @@ -1,123 +0,0 @@ -<component name="ProjectCodeStyleConfiguration"> - <code_scheme name="Project" version="173"> - <JetCodeStyleSettings> - <option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" /> - </JetCodeStyleSettings> - <codeStyleSettings language="XML"> - <option name="FORCE_REARRANGE_MODE" value="1" /> - <indentOptions> - <option name="CONTINUATION_INDENT_SIZE" value="4" /> - </indentOptions> - <arrangement> - <rules> - <section> - <rule> - <match> - <AND> - <NAME>xmlns:android</NAME> - <XML_ATTRIBUTE /> - <XML_NAMESPACE>^$</XML_NAMESPACE> - </AND> - </match> - </rule> - </section> - <section> - <rule> - <match> - <AND> - <NAME>xmlns:.*</NAME> - <XML_ATTRIBUTE /> - <XML_NAMESPACE>^$</XML_NAMESPACE> - </AND> - </match> - <order>BY_NAME</order> - </rule> - </section> - <section> - <rule> - <match> - <AND> - <NAME>.*:id</NAME> - <XML_ATTRIBUTE /> - <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE> - </AND> - </match> - </rule> - </section> - <section> - <rule> - <match> - <AND> - <NAME>.*:name</NAME> - <XML_ATTRIBUTE /> - <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE> - </AND> - </match> - </rule> - </section> - <section> - <rule> - <match> - <AND> - <NAME>name</NAME> - <XML_ATTRIBUTE /> - <XML_NAMESPACE>^$</XML_NAMESPACE> - </AND> - </match> - </rule> - </section> - <section> - <rule> - <match> - <AND> - <NAME>style</NAME> - <XML_ATTRIBUTE /> - <XML_NAMESPACE>^$</XML_NAMESPACE> - </AND> - </match> - </rule> - </section> - <section> - <rule> - <match> - <AND> - <NAME>.*</NAME> - <XML_ATTRIBUTE /> - <XML_NAMESPACE>^$</XML_NAMESPACE> - </AND> - </match> - <order>BY_NAME</order> - </rule> - </section> - <section> - <rule> - <match> - <AND> - <NAME>.*</NAME> - <XML_ATTRIBUTE /> - <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE> - </AND> - </match> - <order>ANDROID_ATTRIBUTE_ORDER</order> - </rule> - </section> - <section> - <rule> - <match> - <AND> - <NAME>.*</NAME> - <XML_ATTRIBUTE /> - <XML_NAMESPACE>.*</XML_NAMESPACE> - </AND> - </match> - <order>BY_NAME</order> - </rule> - </section> - </rules> - </arrangement> - </codeStyleSettings> - <codeStyleSettings language="kotlin"> - <option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" /> - </codeStyleSettings> - </code_scheme> -</component> \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml deleted file mode 100644 index 79ee123..0000000 --- a/.idea/codeStyles/codeStyleConfig.xml +++ /dev/null @@ -1,5 +0,0 @@ -<component name="ProjectCodeStyleConfiguration"> - <state> - <option name="USE_PER_PROJECT_SETTINGS" value="true" /> - </state> -</component> \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml index b589d56..fb7f4a8 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="CompilerConfiguration"> - <bytecodeTargetLevel target="17" /> + <bytecodeTargetLevel target="11" /> </component> </project> \ No newline at end of file diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml deleted file mode 100644 index fdf939b..0000000 --- a/.idea/deploymentTargetDropDown.xml +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="deploymentTargetDropDown"> - <value> - <entry key="LoginActivity"> - <State> - <targetSelectedWithDropDown> - <Target> - <type value="QUICK_BOOT_TARGET" /> - <deviceKey> - <Key> - <type value="VIRTUAL_DEVICE_PATH" /> - <value value="H:\Androidstudio_AVD\avd\Pixel_3a_API_34.avd" /> - </Key> - </deviceKey> - </Target> - </targetSelectedWithDropDown> - <timeTargetWasSelectedWithDropDown value="2024-01-17T20:36:19.481840300Z" /> - </State> - </entry> - <entry key="SignupActivity"> - <State /> - </entry> - <entry key="app"> - <State /> - </entry> - </value> - </component> -</project> \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 0897082..a2d7c21 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -4,15 +4,15 @@ <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="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> diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml deleted file mode 100644 index fdf8d99..0000000 --- a/.idea/kotlinc.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="KotlinJpsPluginSettings"> - <option name="version" value="1.9.0" /> - </component> -</project> \ No newline at end of file diff --git a/.idea/migrations.xml b/.idea/migrations.xml deleted file mode 100644 index f8051a6..0000000 --- a/.idea/migrations.xml +++ /dev/null @@ -1,10 +0,0 @@ -<?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/.idea/misc.xml b/.idea/misc.xml index 0ad17cb..bdd9278 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,7 +1,7 @@ <?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"> + <component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="Android Studio default JDK" project-jdk-type="JavaSDK"> <output url="file://$PROJECT_DIR$/build/classes" /> </component> <component name="ProjectType"> diff --git a/README.md b/README.md deleted file mode 100644 index 7ef2832..0000000 --- a/README.md +++ /dev/null @@ -1,93 +0,0 @@ -# mobileAppProject - - - -## Getting started - -To make it easy for you to get started with GitLab, here's a list of recommended next steps. - -Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! - -## Add your files - -- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files -- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command: - -``` -cd existing_repo -git remote add origin https://gitlab.reutlingen-university.de/heignh23/mobileappproject.git -git branch -M main -git push -uf origin main -``` - -## Integrate with your tools - -- [ ] [Set up project integrations](https://gitlab.reutlingen-university.de/heignh23/mobileappproject/-/settings/integrations) - -## Collaborate with your team - -- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) -- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) -- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) -- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) -- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) - -## Test and Deploy - -Use the built-in continuous integration in GitLab. - -- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html) -- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) -- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) -- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) -- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) - -*** - -# Editing this README - -When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template. - -## Suggestions for a good README - -Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. - -## Name -Choose a self-explaining name for your project. - -## Description -Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. - -## Badges -On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. - -## Visuals -Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. - -## Installation -Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. - -## Usage -Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. - -## Support -Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. - -## Roadmap -If you have ideas for releases in the future, it is a good idea to list them in the README. - -## Contributing -State if you are open to contributions and what your requirements are for accepting them. - -For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. - -You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. - -## Authors and acknowledgment -Show your appreciation to those who have contributed to the project. - -## License -For open source projects, say how it is licensed. - -## Project status -If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..6835f3e --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,50 @@ +plugins { + id 'com.android.application' + id 'org.jetbrains.kotlin.android' + id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' +} + +android { + namespace 'com.example.googlemapsapp' + compileSdk 32 + + defaultConfig { + applicationId "com.example.googlemapsapp" + minSdk 21 + targetSdk 32 + 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 + } + kotlinOptions { + jvmTarget = '1.8' + } + buildFeatures { + viewBinding true + } +} + +dependencies { + + implementation 'androidx.core:core-ktx:1.7.0' + implementation 'androidx.appcompat:appcompat:1.5.1' + implementation 'com.google.android.material:material:1.6.1' + implementation 'com.google.android.gms:play-services-maps:18.0.2' + implementation 'com.google.android.gms:play-services-location:21.0.1' + 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/app/build.gradle.kts b/app/build.gradle.kts deleted file mode 100644 index c1c3509..0000000 --- a/app/build.gradle.kts +++ /dev/null @@ -1,50 +0,0 @@ -plugins { - alias(libs.plugins.android.application) - alias(libs.plugins.jetbrains.kotlin.android) - id("com.google.gms.google-services") -} - -android { - namespace = "com.example.mobilecomputingapp" - compileSdk = 34 - - defaultConfig { - applicationId = "com.example.mobilecomputingapp" - minSdk = 22 - 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 - } - kotlinOptions { - jvmTarget = "1.8" - } - buildFeatures{ - viewBinding = true - } -} - -dependencies { - - implementation(libs.androidx.core.ktx) - implementation(libs.androidx.appcompat) - implementation(libs.material) - implementation(libs.androidx.activity) - implementation(libs.androidx.constraintlayout) - implementation(libs.firebase.database) - testImplementation(libs.junit) - androidTestImplementation(libs.androidx.junit) - androidTestImplementation(libs.androidx.espresso.core) -} \ No newline at end of file diff --git a/app/google-services.json b/app/google-services.json deleted file mode 100644 index 199bde1..0000000 --- a/app/google-services.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "project_info": { - "project_number": "897141802282", - "firebase_url": "https://mobilecomputingapp-47d1b-default-rtdb.firebaseio.com", - "project_id": "mobilecomputingapp-47d1b", - "storage_bucket": "mobilecomputingapp-47d1b.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:897141802282:android:d22976023dd2da2d32ca53", - "android_client_info": { - "package_name": "com.example.mobilecomputingapp" - } - }, - "oauth_client": [], - "api_key": [ - { - "current_key": "AIzaSyBsvQnZuQ67aJ4eGenW0aRCLUpOCp77iAw" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [] - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/app/src/androidTest/java/com/example/mobilecomputingapp/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/example/googlemapsapp/ExampleInstrumentedTest.kt similarity index 82% rename from app/src/androidTest/java/com/example/mobilecomputingapp/ExampleInstrumentedTest.kt rename to app/src/androidTest/java/com/example/googlemapsapp/ExampleInstrumentedTest.kt index 84647d4..fbe4b09 100644 --- a/app/src/androidTest/java/com/example/mobilecomputingapp/ExampleInstrumentedTest.kt +++ b/app/src/androidTest/java/com/example/googlemapsapp/ExampleInstrumentedTest.kt @@ -1,4 +1,4 @@ -package com.example.mobilecomputingapp +package com.example.googlemapsapp import androidx.test.platform.app.InstrumentationRegistry import androidx.test.ext.junit.runners.AndroidJUnit4 @@ -19,6 +19,6 @@ class ExampleInstrumentedTest { fun useAppContext() { // Context of the app under test. val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("com.example.mobilecomputingapp", appContext.packageName) + assertEquals("com.example.googlemapsapp", appContext.packageName) } } \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index a359696..8c12420 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,6 +2,7 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"> + <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <application android:allowBackup="true" android:dataExtractionRules="@xml/data_extraction_rules" @@ -10,24 +11,34 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" - android:theme="@style/Theme.MobileComputingApp" + android:theme="@style/Theme.GoogleMapsApp" tools:targetApi="31"> + + <!-- + TODO: Before you run your application, you need a Google Maps API key. + + To get one, follow the directions here: + + https://developers.google.com/maps/documentation/android-sdk/get-api-key + + Once you have your API key (it starts with "AIza"), define a new property in your + project's local.properties file (e.g. MAPS_API_KEY=Aiza...), and replace the + "YOUR_API_KEY" string in this file with "${MAPS_API_KEY}". + --> + <meta-data + android:name="com.google.android.geo.API_KEY" + android:value="AIzaSyBNA8WPQFNX0xciVg1yajD8RQiOq5GGH0M" /> + <activity - android:name=".LoginActivity" - android:exported="true"> + android:name=".MapsActivity" + android:exported="true" + android:label="@string/title_activity_maps"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> - <activity - android:name=".SignupActivity" - android:exported="false" /> - <activity - android:name=".MainActivity" - android:exported="false"> - </activity> </application> </manifest> \ No newline at end of file diff --git a/app/src/main/java/com/example/googlemapsapp/MapsActivity.kt b/app/src/main/java/com/example/googlemapsapp/MapsActivity.kt new file mode 100644 index 0000000..3b9fc53 --- /dev/null +++ b/app/src/main/java/com/example/googlemapsapp/MapsActivity.kt @@ -0,0 +1,91 @@ +package com.example.googlemapsapp + +import android.content.pm.PackageManager +import android.location.Location +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import android.widget.Toast +import androidx.core.app.ActivityCompat + +import com.google.android.gms.maps.CameraUpdateFactory +import com.google.android.gms.maps.GoogleMap +import com.google.android.gms.maps.OnMapReadyCallback +import com.google.android.gms.maps.SupportMapFragment +import com.google.android.gms.maps.model.LatLng +import com.google.android.gms.maps.model.MarkerOptions +import com.example.googlemapsapp.databinding.ActivityMapsBinding +import com.google.android.gms.location.FusedLocationProviderClient +import com.google.android.gms.location.LocationServices + +class MapsActivity : AppCompatActivity(), OnMapReadyCallback { + + private lateinit var mMap: GoogleMap + private lateinit var binding: ActivityMapsBinding + + private lateinit var currentLocation: Location + private lateinit var fusedLocationProviderClient: FusedLocationProviderClient + private val permissionCode =101 + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + binding = ActivityMapsBinding.inflate(layoutInflater) + setContentView(binding.root) + + fusedLocationProviderClient= LocationServices.getFusedLocationProviderClient(this) + + // Obtain the SupportMapFragment and get notified when the map is ready to be used. + + + getCurrentLocationUser() + } + + private fun getCurrentLocationUser(){ + if(ActivityCompat.checkSelfPermission( + this, android.Manifest.permission.ACCESS_FINE_LOCATION)!= + PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission + (this, android.Manifest.permission.ACCESS_COARSE_LOCATION)!= + PackageManager.PERMISSION_GRANTED) { + ActivityCompat.requestPermissions(this, + arrayOf(android.Manifest.permission.ACCESS_FINE_LOCATION),permissionCode) + return + } + val getLocation = fusedLocationProviderClient.lastLocation.addOnSuccessListener { + location -> + if(location != null){ + currentLocation = location + + Toast.makeText(applicationContext, currentLocation.latitude.toString()+""+currentLocation.longitude.toString(), + Toast.LENGTH_LONG).show() + + val mapFragment = supportFragmentManager + .findFragmentById(R.id.map) as SupportMapFragment + mapFragment.getMapAsync(this) + } + } + } + + override fun onRequestPermissionsResult( + requestCode: Int, + permissions: Array<out String>, + grantResults: IntArray + ) { + super.onRequestPermissionsResult(requestCode, permissions, grantResults) + when(requestCode) + { + permissionCode -> if(grantResults.isNotEmpty() && grantResults[0]== + PackageManager.PERMISSION_GRANTED){ + getCurrentLocationUser() + } + } + } + + override fun onMapReady(googleMap: GoogleMap) { + val latLng =LatLng(currentLocation.latitude, currentLocation.longitude) + val markerOptions =MarkerOptions().position(latLng).title("Current Location") + + googleMap?.animateCamera(CameraUpdateFactory.newLatLng(latLng)) + googleMap?.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, 7f)) + googleMap?.addMarker(markerOptions) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/mobilecomputingapp/LoginActivity.kt b/app/src/main/java/com/example/mobilecomputingapp/LoginActivity.kt deleted file mode 100644 index d9b3728..0000000 --- a/app/src/main/java/com/example/mobilecomputingapp/LoginActivity.kt +++ /dev/null @@ -1,76 +0,0 @@ -package com.example.mobilecomputingapp - -import android.content.Intent -import androidx.appcompat.app.AppCompatActivity -import android.os.Bundle -import android.widget.Toast -import com.example.mobilecomputingapp.databinding.ActivityLoginBinding -import com.google.firebase.database.DataSnapshot -import com.google.firebase.database.DatabaseError -import com.google.firebase.database.DatabaseReference -import com.google.firebase.database.FirebaseDatabase -import com.google.firebase.database.ValueEventListener -import kotlin.math.sign - -class LoginActivity : AppCompatActivity() { - - private lateinit var binding: ActivityLoginBinding - private lateinit var firebaseDatabase: FirebaseDatabase - private lateinit var databaseReference: DatabaseReference - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - binding = ActivityLoginBinding.inflate(layoutInflater) - setContentView(binding.root) - - firebaseDatabase = FirebaseDatabase.getInstance() - databaseReference = firebaseDatabase.reference.child("users") - - binding.loginButton.setOnClickListener{ - val loginUsername = binding.loginUsername.text.toString() - val loginPassword = binding.loginPassword.text.toString() - - if(loginUsername.isNotEmpty() && loginPassword.isNotEmpty()){ - loginUser(loginUsername, loginPassword) - } else { - Toast.makeText(this@LoginActivity, "All Fields are mandatory !", Toast.LENGTH_SHORT).show() - - } - } - - val id = databaseReference.push().key - val userData = UserData(id,"test1","test1") - databaseReference.child(id!!).setValue(userData) - - binding.signupRedirect.setOnClickListener { - startActivity(Intent(this@LoginActivity, SignupActivity::class.java)) - finish() - } - } - - private fun loginUser(username: String, password: String){ - databaseReference.orderByChild("username").equalTo(username).addListenerForSingleValueEvent(object: ValueEventListener{ - override fun onDataChange(dataSnapshot: DataSnapshot) { - if (dataSnapshot.exists()){ - for (userSnapshot in dataSnapshot.children){ - val userData = userSnapshot.getValue(UserData::class.java) - - if(userData != null && userData.password == password){ - Toast.makeText(this@LoginActivity, "Login Successful", Toast.LENGTH_SHORT).show() - startActivity(Intent(this@LoginActivity, MainActivity::class.java)) - finish() - return - } - } - } - Toast.makeText(this@LoginActivity, "Login Failed", Toast.LENGTH_SHORT).show() - - } - - override fun onCancelled(databaseError: DatabaseError) { - Toast.makeText(this@LoginActivity, "Database Error: ${databaseError.message}", Toast.LENGTH_SHORT).show() - - } - }) - } -} \ No newline at end of file diff --git a/app/src/main/java/com/example/mobilecomputingapp/MainActivity.kt b/app/src/main/java/com/example/mobilecomputingapp/MainActivity.kt deleted file mode 100644 index 2231ab2..0000000 --- a/app/src/main/java/com/example/mobilecomputingapp/MainActivity.kt +++ /dev/null @@ -1,20 +0,0 @@ -package com.example.mobilecomputingapp - -import android.os.Bundle -import androidx.activity.enableEdgeToEdge -import androidx.appcompat.app.AppCompatActivity -import androidx.core.view.ViewCompat -import androidx.core.view.WindowInsetsCompat - -class MainActivity : AppCompatActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - enableEdgeToEdge() - setContentView(R.layout.activity_main) - ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets -> - val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()) - v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom) - insets - } - } -} \ No newline at end of file diff --git a/app/src/main/java/com/example/mobilecomputingapp/SignupActivity.kt b/app/src/main/java/com/example/mobilecomputingapp/SignupActivity.kt deleted file mode 100644 index 7760cd9..0000000 --- a/app/src/main/java/com/example/mobilecomputingapp/SignupActivity.kt +++ /dev/null @@ -1,69 +0,0 @@ -package com.example.mobilecomputingapp - -import android.content.Intent -import androidx.appcompat.app.AppCompatActivity -import android.os.Bundle -import android.widget.Toast -import com.example.mobilecomputingapp.databinding.ActivitySignupBinding -import com.google.firebase.database.DataSnapshot -import com.google.firebase.database.DatabaseError -import com.google.firebase.database.DatabaseReference -import com.google.firebase.database.FirebaseDatabase -import com.google.firebase.database.ValueEventListener - -class SignupActivity : AppCompatActivity() { - - private lateinit var binding: ActivitySignupBinding - private lateinit var firebaseDatabase: FirebaseDatabase - private lateinit var databaseReference: DatabaseReference - - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - binding = ActivitySignupBinding.inflate(layoutInflater) - setContentView(binding.root) - - firebaseDatabase = FirebaseDatabase.getInstance() - databaseReference = firebaseDatabase.reference.child("users") - - binding.signupButton.setOnClickListener { - val signupUsername = binding.signupUsername.text.toString() - val signupPassword = binding.signupPassword.text.toString() - - if(signupUsername.isNotEmpty() && signupPassword.isNotEmpty()){ - signupUser(signupUsername, signupPassword) - } else { - Toast.makeText(this@SignupActivity, "All Fields are mandatory !", Toast.LENGTH_SHORT).show() - - } - } - - binding.loginRedirect.setOnClickListener { - startActivity(Intent(this@SignupActivity, LoginActivity::class.java)) - finish() - } - - } - - private fun signupUser(username: String, password: String){ - databaseReference.orderByChild("username").equalTo(username).addListenerForSingleValueEvent(object : ValueEventListener{ - override fun onDataChange(dataSnapshot: DataSnapshot) { - if(!dataSnapshot.exists()){ - val id = databaseReference.push().key - val userData = UserData(id,username,password) - databaseReference.child(id!!).setValue(userData) - Toast.makeText(this@SignupActivity, "Sign up Successful", Toast.LENGTH_SHORT).show() - startActivity(Intent(this@SignupActivity, LoginActivity::class.java)) - finish() - } else { - Toast.makeText(this@SignupActivity, "User already exists !", Toast.LENGTH_SHORT).show() - } - } - - override fun onCancelled(databaseError: DatabaseError) { - Toast.makeText(this@SignupActivity, "Database Error: ${databaseError.message}", Toast.LENGTH_SHORT).show() - - } - }) - } -} \ No newline at end of file diff --git a/app/src/main/java/com/example/mobilecomputingapp/UserData.kt b/app/src/main/java/com/example/mobilecomputingapp/UserData.kt deleted file mode 100644 index 1299d94..0000000 --- a/app/src/main/java/com/example/mobilecomputingapp/UserData.kt +++ /dev/null @@ -1,7 +0,0 @@ -package com.example.mobilecomputingapp - -data class UserData( - val id: String? = null, - val username: String? = null, - val password: String? = null -) diff --git a/app/src/main/res/drawable/edittext_border.xml b/app/src/main/res/drawable/edittext_border.xml deleted file mode 100644 index 7a24c32..0000000 --- a/app/src/main/res/drawable/edittext_border.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<shape xmlns:android="http://schemas.android.com/apk/res/android" - android:shape="rectangle"> - - <stroke android:color="@color/green" - android:width="2dp"/> - <corners android:radius="20dp"/> - -</shape> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml deleted file mode 100644 index 34d27a3..0000000 --- a/app/src/main/res/layout/activity_login.xml +++ /dev/null @@ -1,70 +0,0 @@ -<?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=".LoginActivity" - tools:ignore="HardcodedText"> - - <EditText - android:layout_width="0dp" - android:layout_height="wrap_content" - android:id="@+id/loginUsername" - android:hint="Username" - android:padding="12dp" - android:background="@drawable/edittext_border" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintTop_toTopOf="parent" - android:layout_marginTop="330dp" - android:layout_marginStart="16dp" - android:layout_marginEnd="16dp"/> - - <EditText - android:layout_width="0dp" - android:layout_height="wrap_content" - android:id="@+id/loginPassword" - android:hint="Password" - android:inputType="textPassword" - android:padding="12dp" - android:background="@drawable/edittext_border" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintTop_toBottomOf="@+id/loginUsername" - app:layout_constraintBottom_toTopOf="@+id/loginButton" - android:layout_marginTop="30dp" - android:layout_marginStart="16dp" - android:layout_marginEnd="16dp"/> - - <Button - android:layout_width="0dp" - android:layout_height="wrap_content" - android:id="@+id/loginButton" - android:text="LOGIN" - android:backgroundTint="@color/green" - android:layout_marginTop="50dp" - android:layout_marginStart="16dp" - android:layout_marginEnd="16dp" - app:layout_constraintBottom_toTopOf="@+id/signupRedirect" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintTop_toBottomOf="@+id/loginPassword"/> - - <TextView - android:layout_width="0dp" - android:layout_height="wrap_content" - android:id="@+id/signupRedirect" - android:text="Not yet registered ? Sign up" - android:textSize="18sp" - android:gravity="center" - android:textColor="@color/green" - android:layout_marginTop="70dp" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintTop_toBottomOf="@+id/loginButton"/> - - - - -</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml deleted file mode 100644 index 4142277..0000000 --- a/app/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,22 +0,0 @@ -<?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:id="@+id/main" - 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="Welcome to the app !" - android:textSize="36sp" - android:textColor="@color/green" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - tools:ignore="HardcodedText" /> - -</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_maps.xml b/app/src/main/res/layout/activity_maps.xml new file mode 100644 index 0000000..ec352fc --- /dev/null +++ b/app/src/main/res/layout/activity_maps.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<fragment xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:map="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/map" + android:name="com.google.android.gms.maps.SupportMapFragment" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".MapsActivity" /> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_signup.xml b/app/src/main/res/layout/activity_signup.xml deleted file mode 100644 index 9ecea81..0000000 --- a/app/src/main/res/layout/activity_signup.xml +++ /dev/null @@ -1,70 +0,0 @@ -<?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=".SignupActivity" - tools:ignore="HardcodedText"> - - <EditText - android:layout_width="0dp" - android:layout_height="wrap_content" - android:id="@+id/signupUsername" - android:hint="Username" - android:padding="12dp" - android:background="@drawable/edittext_border" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintTop_toTopOf="parent" - android:layout_marginTop="330dp" - android:layout_marginStart="16dp" - android:layout_marginEnd="16dp"/> - - <EditText - android:layout_width="0dp" - android:layout_height="wrap_content" - android:id="@+id/signupPassword" - android:hint="Password" - android:inputType="textPassword" - android:padding="12dp" - android:background="@drawable/edittext_border" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintTop_toBottomOf="@+id/signupUsername" - app:layout_constraintBottom_toTopOf="@+id/signupButton" - android:layout_marginTop="30dp" - android:layout_marginStart="16dp" - android:layout_marginEnd="16dp"/> - - <Button - android:layout_width="0dp" - android:layout_height="wrap_content" - android:id="@+id/signupButton" - android:text="SIGNUP" - android:backgroundTint="@color/green" - android:layout_marginTop="50dp" - android:layout_marginStart="16dp" - android:layout_marginEnd="16dp" - app:layout_constraintBottom_toTopOf="@+id/loginRedirect" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintTop_toBottomOf="@+id/signupPassword"/> - - <TextView - android:layout_width="0dp" - android:layout_height="wrap_content" - android:id="@+id/loginRedirect" - android:text="Already registered? Login" - android:textSize="18sp" - android:gravity="center" - android:textColor="@color/green" - android:layout_marginTop="70dp" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintTop_toBottomOf="@+id/signupButton"/> - - - - -</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml index 6f3b755..eca70cf 100644 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -2,5 +2,4 @@ <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/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml index 6f3b755..eca70cf 100644 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -2,5 +2,4 @@ <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/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml index beb2881..32618fb 100644 --- a/app/src/main/res/values-night/themes.xml +++ b/app/src/main/res/values-night/themes.xml @@ -1,7 +1,16 @@ <resources xmlns:tools="http://schemas.android.com/tools"> <!-- Base application theme. --> - <style name="Base.Theme.MobileComputingApp" parent="Theme.Material3.DayNight.NoActionBar"> - <!-- Customize your dark theme here. --> - <!-- <item name="colorPrimary">@color/my_dark_primary</item> --> + <style name="Theme.GoogleMapsApp" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> + <!-- Primary brand color. --> + <item name="colorPrimary">@color/purple_200</item> + <item name="colorPrimaryVariant">@color/purple_700</item> + <item name="colorOnPrimary">@color/black</item> + <!-- Secondary brand color. --> + <item name="colorSecondary">@color/teal_200</item> + <item name="colorSecondaryVariant">@color/teal_200</item> + <item name="colorOnSecondary">@color/black</item> + <!-- Status bar color. --> + <item name="android:statusBarColor">?attr/colorPrimaryVariant</item> + <!-- Customize your theme here. --> </style> </resources> \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 93e9116..f8c6127 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -1,7 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> <resources> + <color name="purple_200">#FFBB86FC</color> + <color name="purple_500">#FF6200EE</color> + <color name="purple_700">#FF3700B3</color> + <color name="teal_200">#FF03DAC5</color> + <color name="teal_700">#FF018786</color> <color name="black">#FF000000</color> <color name="white">#FFFFFFFF</color> - <color name="green">#4fa853</color> - <color name="blue">#59b5df</color> </resources> \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c823457..ef6e33e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,3 +1,4 @@ <resources> - <string name="app_name">MobileComputingApp</string> + <string name="app_name">GoogleMapsApp</string> + <string name="title_activity_maps">MapsActivity</string> </resources> \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 9e751bd..b21d523 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -1,11 +1,16 @@ <resources xmlns:tools="http://schemas.android.com/tools"> <!-- Base application theme. --> - <style name="Base.Theme.MobileComputingApp" parent="Theme.Material3.DayNight.NoActionBar"> - <!-- Customize your light theme here. --> - <item name="colorPrimary">@color/blue</item> - <item name="colorPrimaryVariant">@color/blue</item> - <item name="android:statusBarColor">@color/blue</item> + <style name="Theme.GoogleMapsApp" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> + <!-- Primary brand color. --> + <item name="colorPrimary">@color/purple_500</item> + <item name="colorPrimaryVariant">@color/purple_700</item> + <item name="colorOnPrimary">@color/white</item> + <!-- Secondary brand color. --> + <item name="colorSecondary">@color/teal_200</item> + <item name="colorSecondaryVariant">@color/teal_700</item> + <item name="colorOnSecondary">@color/black</item> + <!-- Status bar color. --> + <item name="android:statusBarColor">?attr/colorPrimaryVariant</item> + <!-- Customize your theme here. --> </style> - - <style name="Theme.MobileComputingApp" parent="Base.Theme.MobileComputingApp" /> </resources> \ No newline at end of file diff --git a/app/src/test/java/com/example/mobilecomputingapp/ExampleUnitTest.kt b/app/src/test/java/com/example/googlemapsapp/ExampleUnitTest.kt similarity index 88% rename from app/src/test/java/com/example/mobilecomputingapp/ExampleUnitTest.kt rename to app/src/test/java/com/example/googlemapsapp/ExampleUnitTest.kt index 9af9635..81742f3 100644 --- a/app/src/test/java/com/example/mobilecomputingapp/ExampleUnitTest.kt +++ b/app/src/test/java/com/example/googlemapsapp/ExampleUnitTest.kt @@ -1,4 +1,4 @@ -package com.example.mobilecomputingapp +package com.example.googlemapsapp import org.junit.Test diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..f8ba472 --- /dev/null +++ b/build.gradle @@ -0,0 +1,7 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + id 'com.android.application' version '7.3.0' apply false + id 'com.android.library' version '7.3.0' apply false + id 'org.jetbrains.kotlin.android' version '1.7.10' apply false + id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' version '2.0.1' apply false +} \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts deleted file mode 100644 index 9a914c9..0000000 --- a/build.gradle.kts +++ /dev/null @@ -1,11 +0,0 @@ -buildscript { - dependencies { - classpath("com.google.gms:google-services:4.4.0") - - } -} -// Top-level build file where you can add configuration options common to all sub-projects/modules. -plugins { - alias(libs.plugins.android.application) apply false - alias(libs.plugins.jetbrains.kotlin.android) apply false -} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 20e2a01..3c5031e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,8 +8,8 @@ # 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 +# 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 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml deleted file mode 100644 index ba097c4..0000000 --- a/gradle/libs.versions.toml +++ /dev/null @@ -1,30 +0,0 @@ -[versions] -agp = "8.4.0-alpha04" -kotlin = "1.9.0" -coreKtx = "1.10.1" -junit = "4.13.2" -junitVersion = "1.1.5" -espressoCore = "3.5.1" -appcompat = "1.6.1" -material = "1.10.0" -activity = "1.8.0" -constraintlayout = "2.1.4" -googleServices = "4.4.0" -firebaseDatabase = "20.3.0" - -[libraries] -androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } -junit = { group = "junit", name = "junit", version.ref = "junit" } -androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" } -androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" } -androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } -material = { group = "com.google.android.material", name = "material", version.ref = "material" } -androidx-activity = { group = "androidx.activity", name = "activity", version.ref = "activity" } -androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" } -google-services = { group = "com.google.gms", name = "google-services", version.ref = "googleServices" } -firebase-database = { group = "com.google.firebase", name = "firebase-database", version.ref = "firebaseDatabase" } - -[plugins] -android-application = { id = "com.android.application", version.ref = "agp" } -jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } - diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9bcb6c8..0b816f1 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Jan 17 21:03:03 CET 2024 +#Wed Jan 17 14:32:50 CET 2024 distributionBase=GRADLE_USER_HOME +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip -zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..e266ea9 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,16 @@ +pluginManagement { + repositories { + gradlePluginPortal() + google() + mavenCentral() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} +rootProject.name = "GoogleMapsApp" +include ':app' diff --git a/settings.gradle.kts b/settings.gradle.kts deleted file mode 100644 index 6b6ce08..0000000 --- a/settings.gradle.kts +++ /dev/null @@ -1,24 +0,0 @@ -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 = "MobileComputingApp" -include(":app") - \ No newline at end of file -- GitLab