Adds QR code scanning functionality to both ServerSetupActivity and SettingsActivity, allowing users to auto-fill server configuration by scanning a QR code from the server's admin dashboard. Changes: - Add ZXing Android Embedded library (v4.3.0) for QR scanning - Add CAMERA permission to AndroidManifest - Create QrServerConfig model to parse and validate QR JSON data - Create QrScannerUtil for shared scanning functionality - Extend PermissionUtil with camera permission handling - Add "Scan QR Code" button to ServerSetupActivity with hint text - Add "Scan QR Code" button to SettingsActivity - Add QR scan icon and string resources - Configure Gradle Java toolchain auto-detection The QR code contains JSON with server address, port, and client key which are automatically populated into the input fields when scanned.
95 lines
2.8 KiB
Groovy
95 lines
2.8 KiB
Groovy
plugins {
|
|
id 'com.android.application'
|
|
id 'org.jetbrains.kotlin.android'
|
|
id 'kotlin-kapt'
|
|
}
|
|
|
|
android {
|
|
namespace 'com.mattintech.simplelogupload'
|
|
compileSdkVersion 36
|
|
|
|
defaultConfig {
|
|
applicationId "com.mattintech.simplelogupload"
|
|
minSdkVersion 30
|
|
targetSdkVersion 36
|
|
versionCode 1
|
|
versionName "1.0"
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_17
|
|
targetCompatibility JavaVersion.VERSION_17
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = '17'
|
|
}
|
|
|
|
// Optional: explicitly specify Java toolchain
|
|
java {
|
|
toolchain {
|
|
languageVersion.set(JavaLanguageVersion.of(17))
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
// Kotlin
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
|
|
// Core Android UI
|
|
implementation 'androidx.appcompat:appcompat:1.6.1'
|
|
implementation 'com.google.android.material:material:1.11.0'
|
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
|
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
|
|
|
|
// Networking
|
|
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
|
|
implementation 'com.android.support:support-annotations:28.0.0'
|
|
implementation 'androidx.palette:palette:1.0.0'
|
|
|
|
// QR Code scanning
|
|
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
|
|
|
|
// Room
|
|
def room_version = "2.6.1"
|
|
implementation "androidx.room:room-runtime:$room_version"
|
|
kapt "androidx.room:room-compiler:$room_version"
|
|
|
|
// Lifecycle
|
|
def lifecycle_version = "2.6.2"
|
|
implementation "androidx.lifecycle:lifecycle-viewmodel:$lifecycle_version"
|
|
implementation "androidx.lifecycle:lifecycle-livedata:$lifecycle_version"
|
|
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
|
|
|
|
// UI Components
|
|
implementation "androidx.recyclerview:recyclerview:1.3.2"
|
|
implementation "androidx.cardview:cardview:1.0.0"
|
|
|
|
// Coroutines
|
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3"
|
|
|
|
// Testing
|
|
testImplementation 'junit:junit:4.13.2'
|
|
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
|
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
|
|
|
|
// Kotlin compatibility
|
|
constraints {
|
|
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version") {
|
|
because("Merged into kotlin-stdlib")
|
|
}
|
|
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version") {
|
|
because("Merged into kotlin-stdlib")
|
|
}
|
|
}
|
|
}
|