Skip to content

Commit ecf43fc

Browse files
committed
Bump gradle, android api, and dependency version
1 parent 045c4d1 commit ecf43fc

8 files changed

+50
-19
lines changed

app/build.gradle

+9-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ plugins {
33
}
44

55
android {
6-
compileSdk 32
6+
compileSdk 34
77

88
defaultConfig {
99
applicationId "de.cmtjk.linkupconnect"
1010
minSdk 28
11-
targetSdk 32
11+
targetSdk 34
1212
versionCode 1
13-
versionName "1.3.5-beta.1"
13+
versionName "1.3.5"
1414

1515
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1616
}
@@ -25,15 +25,16 @@ android {
2525
sourceCompatibility JavaVersion.VERSION_1_8
2626
targetCompatibility JavaVersion.VERSION_1_8
2727
}
28+
namespace 'de.cmtjk.linkupconnect'
2829
}
2930

3031
dependencies {
3132

32-
implementation 'androidx.appcompat:appcompat:1.5.0'
33-
implementation 'com.google.android.material:material:1.6.1'
34-
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
33+
implementation 'androidx.appcompat:appcompat:1.7.0'
34+
implementation 'com.google.android.material:material:1.12.0'
35+
implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
3536
implementation 'com.android.volley:volley:1.2.1'
3637
testImplementation 'junit:junit:4.13.2'
37-
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
38-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
38+
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
39+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
3940
}

app/src/main/AndroidManifest.xml

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:tools="http://schemas.android.com/tools"
4-
package="de.cmtjk.linkupconnect">
3+
xmlns:tools="http://schemas.android.com/tools">
54

65
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
6+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
7+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
78
<uses-permission android:name="android.permission.INTERNET" />
89
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
910

@@ -28,7 +29,9 @@
2829
<category android:name="android.intent.category.LAUNCHER" />
2930
</intent-filter>
3031
</activity>
31-
<service android:name="de.cmtjk.linkupconnect.LinkUpConnectService" />
32+
<service
33+
android:name="de.cmtjk.linkupconnect.LinkUpConnectService"
34+
android:foregroundServiceType="specialUse" />
3235
</application>
3336

3437
</manifest>

app/src/main/java/de/cmtjk/linkupconnect/LinkUpConnectService.java

+12-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
import android.app.Service;
1010
import android.content.Intent;
1111
import android.content.SharedPreferences;
12+
import android.content.pm.ServiceInfo;
13+
import android.os.Build;
1214
import android.os.Bundle;
1315
import android.os.IBinder;
1416

@@ -271,7 +273,16 @@ private void sendNotification(String formattedBloodGlucoseValue, String formatte
271273
// watch
272274
manager.notify(PERMANENT_NOTIFICATION_ID, notification);
273275
// phone
274-
startForeground(PERMANENT_NOTIFICATION_ID, notification);
276+
if (Build.VERSION.SDK_INT >= 34) {
277+
startForeground(
278+
PERMANENT_NOTIFICATION_ID,
279+
notification,
280+
ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE);
281+
} else {
282+
startForeground(
283+
PERMANENT_NOTIFICATION_ID,
284+
notification);
285+
}
275286
}
276287

277288
@NonNull

app/src/main/java/de/cmtjk/linkupconnect/MainActivity.java

+16-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
package de.cmtjk.linkupconnect;
22

3+
import android.Manifest;
34
import android.content.BroadcastReceiver;
45
import android.content.Context;
56
import android.content.Intent;
67
import android.content.IntentFilter;
78
import android.content.SharedPreferences;
9+
import android.os.Build;
810
import android.os.Bundle;
911
import android.widget.Button;
1012
import android.widget.CheckBox;
@@ -13,6 +15,7 @@
1315

1416
import androidx.appcompat.app.AlertDialog;
1517
import androidx.appcompat.app.AppCompatActivity;
18+
import androidx.core.app.ActivityCompat;
1619
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
1720

1821
import com.google.android.material.switchmaterial.SwitchMaterial;
@@ -29,6 +32,14 @@ protected void onCreate(Bundle savedInstanceState) {
2932

3033
findViewById(R.id.notification_enabled).setEnabled(false);
3134

35+
if (Build.VERSION.SDK_INT > 32) {
36+
if (!shouldShowRequestPermissionRationale("112")) {
37+
ActivityCompat.requestPermissions(this,
38+
new String[]{Manifest.permission.POST_NOTIFICATIONS},
39+
112);
40+
}
41+
}
42+
3243
SharedPreferences preferences = getSharedPreferences("LinkUpConnect", MODE_PRIVATE);
3344

3445
fillInputFieldsWith(preferences);
@@ -50,7 +61,8 @@ private void configureXDripCheckBox() {
5061
AlertDialog.Builder builder = new AlertDialog.Builder(this);
5162
builder.setTitle("ℹ️ Information")
5263
.setMessage("Choose 'Libre2 (patched App)' as source in xDrip.")
53-
.setPositiveButton("Ok", (dialog, id) -> {});
64+
.setPositiveButton("Ok", (dialog, id) -> {
65+
});
5466
AlertDialog dialog = builder.create();
5567
dialog.show();
5668
}
@@ -168,6 +180,7 @@ public void onReceive(Context context, Intent intent) {
168180
}
169181

170182
}
183+
171184
private boolean debugEnabled() {
172185
return ((CheckBox) findViewById(R.id.debug)).isChecked();
173186
}
@@ -187,7 +200,8 @@ private void showAlert(String message) {
187200
AlertDialog.Builder builder = new AlertDialog.Builder(this);
188201
builder.setTitle("ℹ️ Information")
189202
.setMessage(message)
190-
.setPositiveButton("Ok", (dialog, id) -> {});
203+
.setPositiveButton("Ok", (dialog, id) -> {
204+
});
191205
AlertDialog dialog = builder.create();
192206
dialog.show();
193207
}

app/src/main/java/de/cmtjk/linkupconnect/xDripProperties.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ public enum xDripProperties {
55
GLUCOSE("glucose"),
66
TIMESTAMP("timestamp"),
77
SENSOR_SERIAL("sensorSerial"),
8-
BLE_MANAGER("bleManager") ;
8+
BLE_MANAGER("bleManager");
99

1010
final String value;
1111

build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
plugins {
3-
id 'com.android.application' version '7.3.1' apply false
4-
id 'com.android.library' version '7.3.1' apply false
3+
id 'com.android.application' version '8.5.0' apply false
4+
id 'com.android.library' version '8.5.0' apply false
55
}
66

77
task clean(type: Delete) {

gradle.properties

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@ android.useAndroidX=true
1818
# Enables namespacing of each library's R class so that its R class includes only the
1919
# resources declared in the library itself and none from the library's dependencies,
2020
# thereby reducing the size of the R class for that library
21-
android.nonTransitiveRClass=true
21+
android.nonTransitiveRClass=true
22+
android.defaults.buildfeatures.buildconfig=true
23+
android.nonFinalResIds=false
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Sat Aug 27 21:55:31 CEST 2022
22
distributionBase=GRADLE_USER_HOME
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
44
distributionPath=wrapper/dists
55
zipStorePath=wrapper/dists
66
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)