Skip to content

Commit

Permalink
Upgrade to Android API 34 (Android 14)
Browse files Browse the repository at this point in the history
  • Loading branch information
christianrowlands committed Oct 30, 2023
1 parent 801b851 commit fadf032
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 72 deletions.
36 changes: 11 additions & 25 deletions .github/workflows/android-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,25 @@ jobs:

strategy:
matrix:
api-level: [ 26, 31 ]
api-level: [ 26, 34 ]
target: [ default, google_apis ]

steps:
- name: Checkout the code
uses: actions/checkout@v4

- name: Set up JDK 11
uses: actions/setup-java@v2
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'adopt'
java-version: 17
distribution: 'temurin'
cache: 'gradle'

- name: Save google-services.json
env:
GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES }}
run: echo "$GOOGLE_SERVICES" > networksurvey/google-services.json

- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }}

- name: Unit Tests
run: ./gradlew test --stacktrace

Expand Down Expand Up @@ -118,19 +111,12 @@ jobs:
- name: Checkout the code
uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }}

- name: Set up JDK 11
uses: actions/setup-java@v2
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'adopt'
java-version: 17
distribution: 'temurin'
cache: 'gradle'

- name: Save Keystore
env:
Expand Down
36 changes: 11 additions & 25 deletions .github/workflows/android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,12 @@ jobs:
- name: Checkout the code
uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v2
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }}

- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'adopt'
java-version: 17
distribution: 'temurin'
cache: 'gradle'

- name: Save google-services.json
env:
Expand Down Expand Up @@ -66,32 +59,25 @@ jobs:

strategy:
matrix:
api-level: [ 26, 31 ]
api-level: [ 26, 34 ]
target: [ default, google_apis ]

steps:
- name: Checkout the code
uses: actions/checkout@v4

- name: Set up JDK 11
uses: actions/setup-java@v2
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'adopt'
java-version: 17
distribution: 'temurin'
cache: 'gradle'

- name: Save google-services.json
env:
GOOGLE_SERVICES: ${{ secrets.GOOGLE_SERVICES }}
run: echo "$GOOGLE_SERVICES" > networksurvey/google-services.json

- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }}

- name: Unit Tests
run: ./gradlew test --stacktrace

Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.1'
classpath 'com.android.tools.build:gradle:8.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.15'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.6'
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.5.3"
classpath 'com.google.gms:google-services:4.4.0'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.9'
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.7.4"
}
}

Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m
applicationName=networksurvey
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
# 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
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip
29 changes: 14 additions & 15 deletions networksurvey/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ apply plugin: 'kotlin-android'


ext.androidVersion = '28.0.0'
ext.grpcVersion = '1.45.1'
ext.networkSurveyMessagingVersion = '0.11.1'
ext.navigationVersion = '2.6.0'
ext.grpcVersion = '1.58.0'
ext.networkSurveyMessagingVersion = '0.12.0'
ext.navigationVersion = '2.7.4'

android {
compileSdkVersion 33
compileSdk 34
defaultConfig {
buildConfigField "String", "MESSAGING_API_VERSION", "\"${networkSurveyMessagingVersion}\""
applicationId "com.craxiom.networksurvey"
minSdkVersion 26
targetSdkVersion 31
targetSdkVersion 34
versionCode 49
versionName "1.14-SNAPSHOT"
setProperty("archivesBaseName", "$applicationName-$versionName")
Expand All @@ -34,18 +34,17 @@ android {
}
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
buildFeatures {
viewBinding true
dataBinding true
}
buildToolsVersion '30.0.3'

packagingOptions {
exclude 'google/cloud/audit/audit_log.proto'
resources {
excludes += ['META-INF/INDEX.LIST', 'META-INF/io.netty.versions.properties']
excludes += ['META-INF/INDEX.LIST', 'META-INF/io.netty.versions.properties', 'google/cloud/audit/audit_log.proto']
}
}

Expand All @@ -71,10 +70,10 @@ android {
dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.jakewharton.timber:timber:5.0.1'
implementation 'com.google.android.material:material:1.9.0'
implementation 'com.google.android.material:material:1.10.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.preference:preference-ktx:1.2.0'
implementation 'androidx.preference:preference-ktx:1.2.1'
implementation "androidx.navigation:navigation-runtime-ktx:${navigationVersion}"
implementation "androidx.navigation:navigation-fragment-ktx:${navigationVersion}"
implementation "androidx.navigation:navigation-ui-ktx:${navigationVersion}"
Expand All @@ -92,15 +91,15 @@ dependencies {
implementation("com.craxiom:network-survey-messaging:${networkSurveyMessagingVersion}") {
exclude group: 'com.google.api.grpc', module: 'proto-google-common-protos'
}
implementation "com.google.protobuf:protobuf-java-util:3.19.3"
implementation "com.google.protobuf:protobuf-java-util:3.24.3"

implementation "mil.nga.geopackage:geopackage-android:6.6.0"
implementation 'org.apache.commons:commons-csv:1.9.0'

implementation 'com.craxiom:mqtt-library:0.5.0'

implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.recyclerview:recyclerview:1.3.0'
implementation 'androidx.recyclerview:recyclerview:1.3.2'

implementation 'app.futured.donut:donut:2.2.0'

Expand All @@ -115,7 +114,7 @@ dependencies {
regularImplementation 'com.google.firebase:firebase-crashlytics'

testImplementation 'junit:junit:4.13.2'
implementation 'androidx.annotation:annotation:1.6.0'
implementation 'androidx.annotation:annotation:1.7.0'

androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test:runner:1.5.2'
Expand Down
4 changes: 4 additions & 0 deletions networksurvey/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
-keepattributes SourceFile,LineNumberTable
-dontobfuscate

-keep class com.google.gson.reflect.TypeToken
-keep class * extends com.google.gson.reflect.TypeToken
-keep public class * implements java.lang.reflect.Type

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ public void onServiceConnected(final ComponentName name, final IBinder iBinder)
Timber.i("%s service connected", name);
final NetworkSurveyService.SurveyServiceBinder binder = (NetworkSurveyService.SurveyServiceBinder) iBinder;
networkSurveyService = (NetworkSurveyService) binder.getService();
deviceId = networkSurveyService.getDeviceId();
deviceId = networkSurveyService.getNsDeviceId();
gpsListener = networkSurveyService.getGpsListener();
networkSurveyService.registerCellularSurveyRecordListener(GrpcConnectionService.this);
networkSurveyService.registerWifiSurveyRecordListener(GrpcConnectionService.this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ public GpsListener getGpsListener()
return gpsListener;
}

public String getDeviceId()
public String getNsDeviceId()
{
return deviceId;
}
Expand Down

0 comments on commit fadf032

Please sign in to comment.