Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump to Android SDK 33 #379

Merged
merged 2 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle/android_project/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath 'com.android.tools.build:gradle:8.1.1'
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
9 changes: 5 additions & 4 deletions gradle/android_project/library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@ android {

namespace 'com.gluonhq.helloandroid'

compileSdkVersion 31
compileSdkVersion 33

defaultConfig {
minSdkVersion 21
targetSdkVersion 31
targetSdkVersion 33
}

dependencies {
compileOnly fileTree(dir: '../libs', include: '*.jar')
}

afterEvaluate {
generateDebugBuildConfig.enabled = false
buildFeatures {
buildConfig = false
resValues = false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ android {

namespace 'com.gluonhq.helloandroid'

compileSdkVersion 31
compileSdkVersion 33

defaultConfig {
minSdkVersion 21
targetSdkVersion 31
targetSdkVersion 33
}

compileOptions {
Expand All @@ -22,7 +22,8 @@ android {
implementation 'de.javagl:obj:0.3.0'
}

afterEvaluate {
generateDebugBuildConfig.enabled = false
buildFeatures {
buildConfig = false
resValues = false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@ android {

namespace 'com.gluonhq.helloandroid'

compileSdkVersion 31
compileSdkVersion 33

defaultConfig {
minSdkVersion 21
targetSdkVersion 31
targetSdkVersion 33
}

dependencies {
compileOnly fileTree(dir: '../libs', include: '*.jar')
implementation 'com.google.zxing:core:3.4.1'
}

afterEvaluate {
generateDebugBuildConfig.enabled = false
buildFeatures {
buildConfig = false
resValues = false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
*/
package com.gluonhq.helloandroid;

import android.Manifest;
import android.app.Activity;
import android.app.AlarmManager;
import android.app.Notification;
Expand All @@ -40,6 +41,7 @@
import android.graphics.Color;
import android.net.Uri;
import android.os.Build;
import android.util.Log;

public class DalvikLocalNotificationsService {

Expand All @@ -50,6 +52,13 @@ public class DalvikLocalNotificationsService {

public DalvikLocalNotificationsService(Activity activity) {
DalvikLocalNotificationsService.this.activity = activity;

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
boolean notificationsEnabled = Util.verifyPermissions(Manifest.permission.POST_NOTIFICATIONS);
if (!notificationsEnabled) {
Log.v(TAG, "Post notifications disabled. POST_NOTIFICATIONS permission is required");
}
}
}

static Activity getActivity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
<uses-sdk android:minSdkVersion="21" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<application>
<activity android:name='com.gluonhq.helloandroid.MainActivity'
android:exported="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
*/
package com.gluonhq.helloandroid;

import android.Manifest;
import android.app.Activity;
import android.app.job.JobInfo;
import android.app.job.JobScheduler;
Expand All @@ -51,6 +52,13 @@ public class DalvikPushNotificationsService {

public DalvikPushNotificationsService(Activity activity) {
DalvikPushNotificationsService.this.activity = activity;

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
boolean notificationsEnabled = Util.verifyPermissions(Manifest.permission.POST_NOTIFICATIONS);
if (!notificationsEnabled) {
Log.v(TAG, "Post notifications disabled. POST_NOTIFICATIONS permission is required");
}
}
}

static Activity getActivity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<application>
<activity android:name='com.gluonhq.helloandroid.MainActivity'
android:exported="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ android {

namespace 'com.gluonhq.helloandroid'

compileSdkVersion 31
compileSdkVersion 33

defaultConfig {
minSdkVersion 21
targetSdkVersion 31
targetSdkVersion 33
}

afterEvaluate {
generateDebugBuildConfig.enabled = false
buildFeatures {
buildConfig = false
resValues = false
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ android {

namespace 'com.gluonhq.helloandroid'

compileSdkVersion 31
compileSdkVersion 33

defaultConfig {
minSdkVersion 21
targetSdkVersion 31
targetSdkVersion 33
}

afterEvaluate {
generateDebugBuildConfig.enabled = false
buildFeatures {
buildConfig = false
resValues = false
}

}
Expand Down
Loading