From 3e4bacb7b939b1de98a2fb07115f638750637357 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 8 May 2026 00:05:39 +0300 Subject: Rewrite as Flutter app and rename to Quicklog Drop the Go/Fyne implementation and replace it with a native Flutter app targeting Android (primary) and Linux desktop (development). Rename quicklogger -> quicklog throughout (project, applicationId, MethodChannel, cache filename, AppBar title, Linux binary). Storage on Android moves to /Android/data/org.buetow.quicklog/files/ so MANAGE_EXTERNAL_STORAGE is no longer required. Share-intent receive is preserved via a Kotlin ShareActivity that writes shared text to the app cache, which Dart reads through a MethodChannel on app resume; MainActivity also accepts SEND directly so launchers that prefer the main target work. New since the Fyne version: an entry browser screen with read-only viewer and long-press delete. Cross-compiling to Android ARM from amd64 Linux no longer needs Docker / fyne-cross / NDK -- flutter build apk emits ARM binaries directly. Co-Authored-By: Claude Opus 4.7 --- android/app/src/debug/AndroidManifest.xml | 7 +++ android/app/src/main/AndroidManifest.xml | 56 +++++++++++++++++++++ .../kotlin/org/buetow/quicklog/MainActivity.kt | 56 +++++++++++++++++++++ .../kotlin/org/buetow/quicklog/ShareActivity.kt | 54 ++++++++++++++++++++ .../res/drawable-hdpi/ic_launcher_foreground.png | Bin 0 -> 26129 bytes .../res/drawable-mdpi/ic_launcher_foreground.png | Bin 0 -> 15260 bytes .../main/res/drawable-v21/launch_background.xml | 12 +++++ .../res/drawable-xhdpi/ic_launcher_foreground.png | Bin 0 -> 38865 bytes .../res/drawable-xxhdpi/ic_launcher_foreground.png | Bin 0 -> 67448 bytes .../drawable-xxxhdpi/ic_launcher_foreground.png | Bin 0 -> 98799 bytes .../src/main/res/drawable/launch_background.xml | 12 +++++ .../src/main/res/mipmap-anydpi-v26/ic_launcher.xml | 9 ++++ .../app/src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 9013 bytes .../app/src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 5127 bytes .../app/src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 13086 bytes .../app/src/main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 22244 bytes .../src/main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 32096 bytes android/app/src/main/res/values-night/styles.xml | 18 +++++++ android/app/src/main/res/values/colors.xml | 4 ++ android/app/src/main/res/values/styles.xml | 18 +++++++ android/app/src/profile/AndroidManifest.xml | 7 +++ 21 files changed, 253 insertions(+) create mode 100644 android/app/src/debug/AndroidManifest.xml create mode 100644 android/app/src/main/AndroidManifest.xml create mode 100644 android/app/src/main/kotlin/org/buetow/quicklog/MainActivity.kt create mode 100644 android/app/src/main/kotlin/org/buetow/quicklog/ShareActivity.kt create mode 100644 android/app/src/main/res/drawable-hdpi/ic_launcher_foreground.png create mode 100644 android/app/src/main/res/drawable-mdpi/ic_launcher_foreground.png create mode 100644 android/app/src/main/res/drawable-v21/launch_background.xml create mode 100644 android/app/src/main/res/drawable-xhdpi/ic_launcher_foreground.png create mode 100644 android/app/src/main/res/drawable-xxhdpi/ic_launcher_foreground.png create mode 100644 android/app/src/main/res/drawable-xxxhdpi/ic_launcher_foreground.png create mode 100644 android/app/src/main/res/drawable/launch_background.xml create mode 100644 android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 android/app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 android/app/src/main/res/values-night/styles.xml create mode 100644 android/app/src/main/res/values/colors.xml create mode 100644 android/app/src/main/res/values/styles.xml create mode 100644 android/app/src/profile/AndroidManifest.xml (limited to 'android/app/src') diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 0000000..399f698 --- /dev/null +++ b/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..6eddff0 --- /dev/null +++ b/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/kotlin/org/buetow/quicklog/MainActivity.kt b/android/app/src/main/kotlin/org/buetow/quicklog/MainActivity.kt new file mode 100644 index 0000000..426589f --- /dev/null +++ b/android/app/src/main/kotlin/org/buetow/quicklog/MainActivity.kt @@ -0,0 +1,56 @@ +package org.buetow.quicklog + +import android.content.Intent +import android.os.Bundle +import io.flutter.embedding.android.FlutterActivity +import io.flutter.embedding.engine.FlutterEngine +import io.flutter.plugin.common.MethodChannel +import java.io.File + +class MainActivity : FlutterActivity() { + private val channelName = "org.buetow.quicklog/share" + private val cacheFilename = "quicklog-shared.txt" + + override fun configureFlutterEngine(flutterEngine: FlutterEngine) { + super.configureFlutterEngine(flutterEngine) + MethodChannel(flutterEngine.dartExecutor.binaryMessenger, channelName) + .setMethodCallHandler { call, result -> + when (call.method) { + "readSharedTextFromCache" -> result.success(readCache()) + "clearSharedTextCache" -> { + clearCache() + result.success(null) + } + else -> result.notImplemented() + } + } + } + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + captureSendIntent(intent) + } + + override fun onNewIntent(intent: Intent) { + super.onNewIntent(intent) + captureSendIntent(intent) + } + + private fun captureSendIntent(intent: Intent?) { + if (intent?.action == Intent.ACTION_SEND && intent.type?.startsWith("text/") == true) { + intent.getStringExtra(Intent.EXTRA_TEXT)?.let { text -> + File(cacheDir, cacheFilename).writeText(text) + } + } + } + + private fun readCache(): String? { + val f = File(cacheDir, cacheFilename) + return if (f.exists()) f.readText() else null + } + + private fun clearCache() { + val f = File(cacheDir, cacheFilename) + if (f.exists()) f.delete() + } +} diff --git a/android/app/src/main/kotlin/org/buetow/quicklog/ShareActivity.kt b/android/app/src/main/kotlin/org/buetow/quicklog/ShareActivity.kt new file mode 100644 index 0000000..15261e6 --- /dev/null +++ b/android/app/src/main/kotlin/org/buetow/quicklog/ShareActivity.kt @@ -0,0 +1,54 @@ +package org.buetow.quicklog + +import android.app.Activity +import android.content.Intent +import android.os.Bundle +import android.util.Log +import java.io.File + +class ShareActivity : Activity() { + companion object { + private const val TAG = "QuicklogShare" + private const val CACHE_FILENAME = "quicklog-shared.txt" + } + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + handleShare(intent) + launchMain() + finish() + } + + private fun handleShare(intent: Intent?) { + if (intent == null) return + val type = intent.type + if (intent.action == Intent.ACTION_SEND && type != null && type.startsWith("text/")) { + val sharedText = intent.getStringExtra(Intent.EXTRA_TEXT) + if (sharedText != null) { + try { + val f = File(cacheDir, CACHE_FILENAME) + f.writeText(sharedText) + Log.i(TAG, "Wrote shared text to ${f.absolutePath}") + } catch (e: Exception) { + Log.e(TAG, "Error writing shared text", e) + } + } + } + } + + private fun launchMain() { + try { + val launch = Intent(this, MainActivity::class.java).apply { + action = Intent.ACTION_MAIN + addCategory(Intent.CATEGORY_LAUNCHER) + flags = Intent.FLAG_ACTIVITY_NEW_TASK or + Intent.FLAG_ACTIVITY_SINGLE_TOP or + Intent.FLAG_ACTIVITY_CLEAR_TOP or + Intent.FLAG_ACTIVITY_REORDER_TO_FRONT + } + startActivity(launch) + } catch (t: Throwable) { + Log.e(TAG, "Failed to launch main activity", t) + } + } +} diff --git a/android/app/src/main/res/drawable-hdpi/ic_launcher_foreground.png b/android/app/src/main/res/drawable-hdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..a454844 Binary files /dev/null and b/android/app/src/main/res/drawable-hdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/drawable-mdpi/ic_launcher_foreground.png b/android/app/src/main/res/drawable-mdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..7a9bc40 Binary files /dev/null and b/android/app/src/main/res/drawable-mdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 0000000..f74085f --- /dev/null +++ b/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/android/app/src/main/res/drawable-xhdpi/ic_launcher_foreground.png b/android/app/src/main/res/drawable-xhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..7badce7 Binary files /dev/null and b/android/app/src/main/res/drawable-xhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/drawable-xxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/drawable-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..5ed2063 Binary files /dev/null and b/android/app/src/main/res/drawable-xxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..089a22a Binary files /dev/null and b/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 0000000..304732f --- /dev/null +++ b/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..c79c58a --- /dev/null +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,9 @@ + + + + + + + diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..f75d22f Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..d24ba69 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..b49236f Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..a20c849 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..9a1fafa Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/values-night/styles.xml b/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 0000000..06952be --- /dev/null +++ b/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/android/app/src/main/res/values/colors.xml b/android/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..c5d5899 --- /dev/null +++ b/android/app/src/main/res/values/colors.xml @@ -0,0 +1,4 @@ + + + #FFFFFF + \ No newline at end of file diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..cb1ef88 --- /dev/null +++ b/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 0000000..399f698 --- /dev/null +++ b/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + -- cgit v1.2.3