summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-06-29 00:49:21 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-06-29 00:49:21 +0000
commit436ce4d83fc28b78c25713126824c551948e511f (patch)
treed7455b8880ef0bbf78e6ec1018ffd93dd7c20dae /android
parent541941ceefd7ef267a7fb86bab4344f8561bb959 (diff)
feat: scaffold Android widget project (Kotlin + Glance)
Diffstat (limited to 'android')
-rw-r--r--android/app/build.gradle.kts52
-rw-r--r--android/app/src/main/AndroidManifest.xml48
-rw-r--r--android/build.gradle.kts6
-rw-r--r--android/settings.gradle.kts18
4 files changed, 124 insertions, 0 deletions
diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts
new file mode 100644
index 0000000..e0745ea
--- /dev/null
+++ b/android/app/build.gradle.kts
@@ -0,0 +1,52 @@
+plugins {
+ id("com.android.application")
+ id("org.jetbrains.kotlin.android")
+ id("org.jetbrains.kotlin.plugin.serialization")
+ id("org.jetbrains.kotlin.plugin.compose")
+}
+
+android {
+ namespace = "org.terst.doot.widget"
+ compileSdk = 34
+
+ defaultConfig {
+ applicationId = "org.terst.doot.widget"
+ minSdk = 26
+ targetSdk = 34
+ versionCode = 1
+ versionName = "1.0"
+ }
+
+ buildFeatures {
+ compose = true
+ }
+
+ kotlinOptions {
+ jvmTarget = "11"
+ }
+
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_11
+ targetCompatibility = JavaVersion.VERSION_11
+ }
+}
+
+dependencies {
+ val composeBom = platform("androidx.compose:compose-bom:2024.02.00")
+ implementation(composeBom)
+
+ implementation("androidx.glance:glance-appwidget:1.1.0")
+ implementation("androidx.glance:glance-material3:1.1.0")
+ implementation("androidx.work:work-runtime-ktx:2.9.0")
+ implementation("androidx.datastore:datastore-preferences:1.1.1")
+ implementation("com.squareup.okhttp3:okhttp:4.12.0")
+ implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3")
+ implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0")
+ implementation("androidx.activity:activity-compose:1.9.0")
+ implementation("androidx.compose.material3:material3")
+ implementation("androidx.compose.ui:ui")
+
+ testImplementation("junit:junit:4.13.2")
+ testImplementation("io.mockk:mockk:1.13.9")
+ testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.8.0")
+}
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..cac3a50
--- /dev/null
+++ b/android/app/src/main/AndroidManifest.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <uses-permission android:name="android.permission.INTERNET" />
+ <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
+
+ <application
+ android:label="Doot Widget"
+ android:theme="@style/Theme.Material3.DayNight"
+ android:allowBackup="false">
+
+ <!-- Settings activity (also the widget config screen) -->
+ <activity
+ android:name=".ui.SettingsActivity"
+ android:exported="true">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ <intent-filter>
+ <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
+ </intent-filter>
+ </activity>
+
+ <!-- Widget receiver (filled in Task 10) -->
+ <receiver
+ android:name=".DootWidgetReceiver"
+ android:exported="true">
+ <intent-filter>
+ <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
+ </intent-filter>
+ <meta-data
+ android:name="android.appwidget.provider"
+ android:resource="@xml/widget_info" />
+ </receiver>
+
+ <!-- WorkManager initialization -->
+ <provider
+ android:name="androidx.startup.InitializationProvider"
+ android:authorities="${applicationId}.androidx-startup"
+ android:exported="false">
+ <meta-data
+ android:name="androidx.work.WorkManagerInitializer"
+ android:value="androidx.startup" />
+ </provider>
+
+ </application>
+</manifest>
diff --git a/android/build.gradle.kts b/android/build.gradle.kts
new file mode 100644
index 0000000..e6a7dbf
--- /dev/null
+++ b/android/build.gradle.kts
@@ -0,0 +1,6 @@
+plugins {
+ id("com.android.application") version "8.2.0" apply false
+ id("org.jetbrains.kotlin.android") version "1.9.22" apply false
+ id("org.jetbrains.kotlin.plugin.serialization") version "1.9.22" apply false
+ id("org.jetbrains.kotlin.plugin.compose") version "1.9.22" apply false
+}
diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts
new file mode 100644
index 0000000..1e1aed4
--- /dev/null
+++ b/android/settings.gradle.kts
@@ -0,0 +1,18 @@
+pluginManagement {
+ repositories {
+ google()
+ mavenCentral()
+ gradlePluginPortal()
+ }
+}
+
+dependencyResolutionManagement {
+ repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
+ repositories {
+ google()
+ mavenCentral()
+ }
+}
+
+rootProject.name = "DootWidget"
+include(":app")