Skip to content

Commit bd48cde

Browse files
authored
rewrite core utilities functions in kotlin (#12)
* rewrite core utilities functions in kotlin * remove unnecessary xml files; replaced with jetpack compose * bump up protobuf version
1 parent 5673077 commit bd48cde

File tree

121 files changed

+283
-6999
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+283
-6999
lines changed

.github/workflows/android.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,14 @@ jobs:
1919
java-version: '11'
2020
distribution: 'temurin'
2121
cache: gradle
22+
- name: Setup Android SDK
23+
uses: android-actions/setup-android@v2
2224
- name: Grant execute permission for gradlew
2325
run: chmod +x gradlew
2426
- name: Build with Gradle
2527
run: ./gradlew build
28+
- name: Run Tests
29+
run: ./gradlew app:testDebugUnitTest
2630
- name: Generate APK Debug Build with Gradle
2731
if: startsWith(github.ref, 'refs/tags/')
2832
run: ./gradlew assembleDebug

app/build.gradle

Lines changed: 20 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
plugins {
22
id 'com.android.application'
3-
id 'kotlin-kapt'
4-
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
53
id 'org.jetbrains.kotlin.android'
4+
id 'kotlin-kapt'
65
id 'kotlin-android'
76
id 'com.google.dagger.hilt.android'
87
id "com.google.protobuf" version "0.8.17"
@@ -18,7 +17,7 @@ android {
1817
minSdkVersion 24
1918
targetSdkVersion 31
2019
versionCode 2
21-
versionName "1.0.2"
20+
versionName "1.0.3"
2221
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2322
javaCompileOptions {
2423
annotationProcessorOptions {
@@ -62,69 +61,58 @@ dependencies {
6261

6362
// implementation fileTree(dir: 'libs', include: ['*.jar'])
6463

65-
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.3'
66-
implementation 'androidx.navigation:navigation-ui-ktx:2.5.3'
67-
implementation 'androidx.core:core-ktx:1.9.0'
64+
// Kotlin
65+
implementation 'androidx.core:core-ktx:1.10.0'
6866
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
6967
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0"
7068

71-
def appCenterSdkVersion = '4.1.0'
72-
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
73-
69+
// Worker
7470
implementation 'androidx.work:work-runtime-ktx:2.8.1'
7571
implementation "androidx.hilt:hilt-work:1.0.0"
7672
kapt "androidx.hilt:hilt-compiler:1.0.0"
7773

78-
implementation 'androidx.appcompat:appcompat:1.3.0'
79-
implementation 'com.google.android.material:material:1.3.0'
80-
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
81-
implementation 'androidx.navigation:navigation-fragment:2.3.0'
82-
implementation 'androidx.navigation:navigation-ui:2.3.0'
83-
implementation 'androidx.preference:preference:1.1.0'
74+
// Location Service
8475
implementation 'com.google.android.gms:play-services-location:21.0.1'
85-
implementation 'com.google.android.gms:play-services-maps:18.1.0'
8676

77+
// DB
8778
implementation "androidx.room:room-runtime:$room_version"
8879
kapt "androidx.room:room-compiler:$room_version"
8980
implementation "androidx.room:room-ktx:$room_version"
9081

82+
// UI
83+
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.3'
84+
implementation 'androidx.navigation:navigation-ui-ktx:2.5.3'
85+
def appCenterSdkVersion = '4.1.0'
86+
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
9187
def composeBom = platform('androidx.compose:compose-bom:2022.10.00')
9288
implementation composeBom
9389
androidTestImplementation composeBom
94-
// implementation 'androidx.compose.material:material'
95-
// implementation("androidx.compose.runtime:runtime:$compose_version")
9690
implementation "androidx.compose.material3:material3:1.0.1"
9791
implementation "androidx.compose.material3:material3-window-size-class:1.0.1"
98-
9992
implementation "androidx.lifecycle:lifecycle-runtime-compose:2.6.1"
100-
101-
// start up runtime
102-
implementation "androidx.startup:startup-runtime:1.1.1"
103-
104-
105-
// datastore with protobuf preferences
106-
implementation "androidx.datastore:datastore-preferences:1.0.0"
107-
implementation "androidx.datastore:datastore:1.0.0"
108-
implementation "com.google.protobuf:protobuf-javalite:3.18.0"
109-
11093
debugImplementation "androidx.compose.ui:ui-tooling-preview:1.3.2"
11194
implementation "androidx.compose.ui:ui-tooling:1.3.2"
11295
implementation "androidx.compose.material:material-icons-extended:1.3.1"
11396
implementation "androidx.navigation:navigation-compose:2.5.3"
11497

98+
// datastore with protobuf preferences
99+
implementation "androidx.datastore:datastore-preferences:1.0.0"
100+
implementation "androidx.datastore:datastore:1.0.0"
101+
implementation "com.google.protobuf:protobuf-javalite:3.21.12"
102+
115103
// hilt dependency injection
116104
implementation 'com.google.dagger:hilt-android:2.44.2'
117105
implementation 'androidx.hilt:hilt-navigation-compose:1.0.0'
118106
kapt 'com.google.dagger:hilt-compiler:2.44.2'
119107

108+
// start up runtime
109+
implementation "androidx.startup:startup-runtime:1.1.1"
120110

121111
// third-party lib
122112
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
123113
implementation 'com.squareup.retrofit2:converter-scalars:2.9.0'
124-
125114
implementation "com.squareup.okhttp3:okhttp:$okhttp_version"
126115
implementation 'com.github.kongzue.DialogX:DialogX:0.0.43.beta13'
127-
128116
implementation 'com.github.getActivity:XXPermissions:16.6'
129117
implementation "io.github.g00fy2.quickie:quickie-bundled:1.6.0"
130118
implementation 'org.bouncycastle:bcpkix-jdk15to18:1.70'
@@ -135,12 +123,8 @@ dependencies {
135123
implementation "com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}"
136124
implementation "com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}"
137125

126+
// Testing
138127
testImplementation 'junit:junit:4.+'
139-
// androidTestImplementation 'androidx.test.ext:junit:1.1.5'
140-
// androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
141-
implementation "androidx.room:room-runtime:2.3.0"
142-
annotationProcessor "androidx.room:room-compiler:2.3.0"
143-
androidTestImplementation "androidx.room:room-testing:2.3.0"
144128
}
145129

146130
protobuf {
@@ -165,12 +149,3 @@ protobuf {
165149
kapt {
166150
correctErrorTypes true
167151
}
168-
169-
170-
secrets {
171-
// To add your Maps API key to this project:
172-
// 1. Open the root project's local.properties file
173-
// 2. Add this line, where YOUR_API_KEY is your API key:
174-
// MAPS_API_KEY=YOUR_API_KEY
175-
defaultPropertiesFileName 'gradle.properties'
176-
}

app/src/androidTest/java/com/lcl/lclmeasurementtool/SignalStrengthReadAndWriteTest.java

Lines changed: 0 additions & 52 deletions
This file was deleted.

app/src/main/java/com/lcl/lclmeasurementtool/ConnectivityDataFragment.java

Lines changed: 0 additions & 116 deletions
This file was deleted.

app/src/main/java/com/lcl/lclmeasurementtool/FirstFragment.kt

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)