-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 05eaee9
Showing
90 changed files
with
4,691 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Gradle files | ||
.gradle/ | ||
build/ | ||
|
||
# Local configuration file (sdk path, etc) | ||
local.properties | ||
|
||
# Log/OS Files | ||
*.log | ||
|
||
# Android Studio generated files and folders | ||
captures/ | ||
.externalNativeBuild/ | ||
.cxx/ | ||
*.apk | ||
output.json | ||
|
||
# IntelliJ | ||
*.iml | ||
.idea/ | ||
misc.xml | ||
deploymentTargetDropDown.xml | ||
render.experimental.xml | ||
|
||
# Keystore files | ||
*.jks | ||
*.keystore | ||
|
||
# Google Services (e.g. APIs or Firebase) | ||
google-services.json | ||
|
||
# Android Profiling | ||
*.hprof |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
plugins { | ||
id("com.android.application") | ||
id("org.jetbrains.kotlin.android") | ||
id("kotlin-kapt") | ||
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") | ||
} | ||
|
||
android { | ||
namespace = "com.example.vishavjit_harika" | ||
compileSdk = 34 | ||
|
||
defaultConfig { | ||
applicationId = "com.example.vishavjit_harika" | ||
minSdk = 34 | ||
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("androidx.core:core-ktx:1.12.0") | ||
implementation("androidx.appcompat:appcompat:1.6.1") | ||
implementation("com.google.android.material:material:1.10.0") | ||
implementation("androidx.constraintlayout:constraintlayout:2.1.4") | ||
implementation("androidx.preference:preference-ktx:1.2.1") | ||
implementation("androidx.room:room-common:2.6.0") | ||
implementation("com.google.android.gms:play-services-maps:18.2.0") | ||
implementation("androidx.room:room-ktx:2.6.0") | ||
implementation("com.google.android.gms:play-services-location:21.0.1") | ||
testImplementation("junit:junit:4.13.2") | ||
androidTestImplementation("androidx.test.ext:junit:1.1.5") | ||
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") | ||
|
||
// Room components | ||
val room_version = "2.6.0" | ||
val lifecycle_version = "2.6.2" | ||
implementation("androidx.room:room-ktx:$room_version") | ||
kapt("androidx.room:room-compiler:$room_version") | ||
implementation ("androidx.lifecycle:lifecycle-livedata-ktx: $lifecycle_version") | ||
|
||
implementation("com.google.code.gson:gson:2.9.0") | ||
|
||
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2") | ||
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.6.2") | ||
implementation("androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.2") | ||
|
||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1") | ||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1") | ||
|
||
implementation("androidx.localbroadcastmanager:localbroadcastmanager:1.1.0") | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
24 changes: 24 additions & 0 deletions
24
app/src/androidTest/java/com/example/vishavjit_harika/ExampleInstrumentedTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.example.vishavjit_harika | ||
|
||
import androidx.test.platform.app.InstrumentationRegistry | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
|
||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
import org.junit.Assert.* | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* See [testing documentation](http://d.android.com/tools/testing). | ||
*/ | ||
@RunWith(AndroidJUnit4::class) | ||
class ExampleInstrumentedTest { | ||
@Test | ||
fun useAppContext() { | ||
// Context of the app under test. | ||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext | ||
assertEquals("com.example.vishavjit_harika", appContext.packageName) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<?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-feature android:name="android.hardware.camera" /> | ||
|
||
<uses-permission android:name="android.permission.CAMERA" /> | ||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | ||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | ||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> | ||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/> | ||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/> | ||
|
||
<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.Vishavjit_Harika_MyRuns5"> | ||
|
||
<!-- | ||
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="${MAPS_API_KEY}" /> | ||
|
||
<activity | ||
android:name=".DisplayEntryMapsActivity" | ||
android:exported="false" /> | ||
<activity | ||
android:name=".MapsActivity" | ||
android:exported="false" /> | ||
<activity | ||
android:name=".DisplayEntryActivity" | ||
android:exported="false" /> | ||
<activity | ||
android:name=".ManualEntryActivity" | ||
android:exported="false" /> | ||
<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> | ||
<activity | ||
android:name=".ProfileSettingsActivity" | ||
android:exported="true"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
|
||
<provider | ||
android:name="androidx.core.content.FileProvider" | ||
android:authorities="com.example.vishavjit_harika" | ||
android:exported="false" | ||
android:grantUriPermissions="true"> | ||
<meta-data | ||
android:name="android.support.FILE_PROVIDER_PATHS" | ||
android:resource="@xml/file_path" /> | ||
</provider> | ||
</application> | ||
|
||
</manifest> |
40 changes: 40 additions & 0 deletions
40
app/src/main/java/com/example/vishavjit_harika/Converters.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.example.vishavjit_harika | ||
|
||
import androidx.room.TypeConverter | ||
import com.google.android.gms.maps.model.LatLng | ||
import com.google.gson.Gson | ||
import com.google.gson.reflect.TypeToken | ||
import java.text.SimpleDateFormat | ||
import java.util.Calendar | ||
import java.util.Locale | ||
|
||
class Converters { | ||
private val format = SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.getDefault()) | ||
|
||
@TypeConverter | ||
fun fromTimestamp(value: String?): Calendar? { | ||
return value?.let { | ||
val cal = Calendar.getInstance() | ||
cal.time = format.parse(value) ?: return null | ||
cal | ||
} | ||
} | ||
|
||
@TypeConverter | ||
fun calendarToTimestamp(calendar: Calendar?): String? { | ||
return calendar?.let { | ||
format.format(it.time) | ||
} | ||
} | ||
|
||
@TypeConverter | ||
fun fromLatLngList(value: ArrayList<LatLng>?): String { | ||
return Gson().toJson(value) | ||
} | ||
|
||
@TypeConverter | ||
fun toLatLngList(value: String): ArrayList<LatLng> { | ||
val listType = object : TypeToken<ArrayList<LatLng>>() {}.type | ||
return Gson().fromJson(value, listType) | ||
} | ||
} |
Oops, something went wrong.