diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..0290866 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,16 @@ +* text=auto +*.kt text eol=lf +*.kts text eol=lf +*.xml text eol=lf +*.md text eol=lf +*.txt text eol=lf +*.yml text eol=lf +*.yaml text eol=lf +*.toml text eol=lf +*.properties text eol=lf +*.sha256 text eol=lf +gradlew text eol=lf +gradlew.bat text eol=crlf +*.png binary +*.webp binary +*.jar binary diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 0000000..d6a5dce --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,58 @@ +name: Android checks + +on: + push: + pull_request: + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: android-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + verify: + runs-on: ubuntu-24.04 + timeout-minutes: 25 + steps: + - name: Check out source + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + persist-credentials: false + + - name: Set up Java 21 + uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6 + with: + distribution: temurin + java-version: '21' + cache: gradle + + - name: Set up Android SDK + uses: android-actions/setup-android@be39fa834029ff78f1a44aa3bb0819b8fc2bd8fd # v4 + with: + packages: 'platform-tools platforms;android-36.1 build-tools;36.1.0' + + - name: Verify Gradle wrapper + run: sha256sum --check gradle/wrapper/gradle-wrapper.jar.sha256 + + - name: Build, lint, test, and compile device tests + run: ./gradlew --no-daemon :app:assembleDebug :app:lintDebug :app:testDebugUnitTest :app:assembleDebugAndroidTest + + - name: Upload check reports + if: always() + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7 + with: + name: check-reports + path: app/build/reports/ + if-no-files-found: ignore + retention-days: 14 + + - name: Upload debug APK + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7 + with: + name: remember-debug-apk + path: app/build/outputs/apk/debug/app-debug.apk + if-no-files-found: error + retention-days: 14 diff --git a/.gitignore b/.gitignore index aa724b7..7779225 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,34 @@ +# Local IDE, SDK, and machine configuration +.idea/ *.iml -.gradle -/local.properties -/.idea/caches -/.idea/libraries -/.idea/modules.xml -/.idea/workspace.xml -/.idea/navEditor.xml -/.idea/assetWizardSettings.xml -.DS_Store -/build -/captures -.externalNativeBuild -.cxx local.properties +.DS_Store +Thumbs.db + +# Gradle and Android build output +.gradle/ +**/build/ +captures/ +.externalNativeBuild/ +.cxx/ +*.apk +*.aab + +# Signing material and local credentials +*.jks +*.keystore +*.p12 +*.pfx +*.pem +keystore.properties +signing.properties +.env +.env.* +!.env.example + +# Personal recordings and interrupted capture files +*.m4a +*.aac +*.wav +*.mp3 +*.pending diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..eb875c4 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,30 @@ +# Contributing + +Remember is an experimental Wear OS recorder. Focused fixes and improvements are welcome. + +## Getting started + +Follow the JDK and Android SDK setup in [README.md](README.md). Keep changes focused, explain the behavior they change, and include relevant validation in your pull request. + +Before opening a pull request, run: + +```sh +./gradlew :app:assembleDebug :app:lintDebug :app:testDebugUnitTest +``` + +Recording-service changes also need the device tests. Use a disposable emulator: the tests request microphone permission, create audio files, and temporarily change app preferences. Some tests record for a real minute. Never run them while a personal recording is active. + +```sh +./gradlew :app:connectedDebugAndroidTest +``` + +## Design and behavior + +- Keep controls comfortable on a round watch screen and reachable by touch and rotary input. +- Maintain spoken descriptions for custom visuals and native alternatives to edge gestures. +- Keep microphone activity visible to the user. Recording should begin with an explicit action. +- Preserve saved audio and bookmarks when changing recording or storage behavior. +- Respect disabled system animations and battery-saving mode. +- Do not introduce accounts, networking, or analytics without discussing the change first. + +Do not include local IDE/device configuration, credentials, signing keys, build output, or personal audio in a pull request. Avoid attaching private recordings or identifying information to issues. Contributions are covered by the repository's [MIT license](LICENSE). diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0f2d2fb --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Meghdad + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/PRIVACY.md b/PRIVACY.md new file mode 100644 index 0000000..2fb6e15 --- /dev/null +++ b/PRIVACY.md @@ -0,0 +1,13 @@ +# Privacy + +Remember records audio only after the user starts capture and grants microphone access. + +- Recordings and bookmark metadata are stored in the app's private local storage. +- The app has no internet permission, accounts, analytics, advertising, or upload feature. +- Storage monitoring reads device capacity and Remember's own usage; it does not request access to another app's data. +- Recording uses a microphone foreground service so it can continue when the screen is off. An ongoing recording notification includes a Save action when notifications are allowed. +- Playback pauses when the playback activity leaves the foreground. +- Renaming updates a recording's local metadata. Deletion removes the recording after confirmation. +- Uninstalling the app removes its recordings and preferences. Export and phone transfer are not implemented. + +Developer tools and test runs can access the debug app's files. Use disposable emulator recordings for testing, and do not publish private audio or logs in issues or pull requests. diff --git a/README.md b/README.md new file mode 100644 index 0000000..0e176e5 --- /dev/null +++ b/README.md @@ -0,0 +1,143 @@ +# Remember + +An experimental, standalone Wear OS audio recorder designed for round watches, with the Galaxy Watch 7 as the primary design target. Capture a thought or the sounds around you, keep bookmarks, and listen back on the watch. No phone app or account is required. + +## Preview + +Screenshots from a Wear OS round-screen emulator: + +

+ Remember home screen with a floating minute number and recording controls + Settings with Storage and Recording limit sections + Large storage ring showing free space and total device capacity +

+ +## Features + +- One-tap microphone recording, pause/resume, and on-watch playback. +- Timestamp bookmarks, renaming, and deletion with confirmation. +- Recording continues in a microphone foreground service when the screen turns off or you leave the app. +- Floating rounded numerals show captured minutes; the background sweep shows seconds within the current minute. +- A live microphone edge meter and an interactive bookmark/playback edge. +- Device and app storage monitoring with a large proportional chart. +- Optional minute limits: save and stop, or save each clip and start the next at zero. +- Native controls, spoken descriptions for custom visuals, and rotary input. + +The appearance is inspired by Samsung's [Spatial Number watch face](https://galaxystore.samsung.com/geardetail/com.samsung.android.watch.watchface.spatialnumber?langCd=ko). The numerals are original vector paths drawn in code; no Samsung font or wallpaper is bundled. This is an independent project, not an official Samsung app. + +## Status and limitations + +**Experimental: suitable for development and evaluation.** Build, lint, unit tests, and recording integration tests have passed locally. The UI has been checked on a Wear OS round-screen emulator; recording integration tests used a separate Android emulator. Physical Galaxy Watch 7 validation is still pending. + +- Captures microphone sound, not internal system audio or call audio. +- Recordings stay on the watch. Export, phone transfer, and transcription are not implemented. +- Playback pauses when you leave the playback activity. +- A brief gap can occur between automatically split clips. +- Each clip has a 500 MB safety cap; reaching it saves the clip and stops the session. +- The app attempts to recover playable unfinished files after an interruption, but an abrupt shutdown can leave unrecoverable audio. +- Uninstalling removes recordings and preferences. Text currently uses English. + +Before relying on long sessions, validate microphone quality, screen-off capture, battery use, interruptions, permissions, and rotary behavior on your physical watch. Repository readiness does not imply production or Play Store release readiness. + +## Build from source + +### Requirements + +- JDK **21**. Android Studio's bundled JDK can be used if it is version 21. +- Android SDK platform **36.1** (`platforms;android-36.1`). +- Android SDK Build Tools **36.1.0** and Platform Tools. +- Android Studio with support for the project's Android Gradle Plugin **9.2.1**, or the command-line tools. +- Internet access for the first build to download Gradle and dependencies. + +The Gradle **9.4.1** wrapper is included; a global Gradle installation is unnecessary. AGP provides built-in Kotlin support. The app supports Android API 31 and later and targets API 36. + +### Setup + +1. Clone or download this repository and open its root folder in Android Studio. +2. Install the SDK packages above in SDK Manager and select JDK 21 for Gradle. +3. Android Studio normally creates the local SDK configuration. For a command-line build, set `ANDROID_HOME` to your SDK directory or create an untracked `local.properties` containing `sdk.dir=/absolute/path/to/android-sdk`. + +With Android command-line tools installed, the SDK packages can also be installed using: + +```sh +sdkmanager "platform-tools" "platforms;android-36.1" "build-tools;36.1.0" +``` + +Build and check from the project root: + +```sh +./gradlew :app:assembleDebug :app:lintDebug :app:testDebugUnitTest :app:assembleDebugAndroidTest +``` + +On Windows, use `gradlew.bat` instead of `./gradlew`. The debug APK is generated at `app/build/outputs/apk/debug/app-debug.apk`; generated APKs are not committed. + +## Install on a watch or emulator + +For an emulator, create a **Wear OS Large Round** device in Android Studio Device Manager, start it, select it as the deployment target, and run the `app` configuration. + +For a physical watch: + +1. Enable developer options and wireless debugging on the watch. +2. Connect the watch and computer to the same Wi-Fi network. +3. Pair using Android Studio's **Pair Devices Using Wi-Fi**, or use Platform Tools: + +```sh +adb pair WATCH_IP:PAIRING_PORT +adb connect WATCH_IP:CONNECTION_PORT +adb -s WATCH_IP:CONNECTION_PORT install -r app/build/outputs/apk/debug/app-debug.apk +``` + +The pairing and connection ports are different. Read each from the watch's Wireless debugging screens. See [Google's Wear OS Wi-Fi debugging guide](https://developer.android.com/training/wearables/get-started/debug-wifi). + +## Using Remember + +- **Record:** tap Record and allow microphone access. Allow notifications to make the recording notification and its Save action easy to reach. +- **Pause / Resume:** paused time is excluded from captured duration and minute limits. +- **Mark:** add a timestamp bookmark using the button or by tapping the right edge during capture. +- **Save:** finish and save the current clip. +- **Moments:** browse and play recordings, rename them, or delete them after confirmation. Tap a bookmark to jump to it. The right edge also seeks during playback; the native slider is available as an alternative. +- Swipe vertically or use rotary input to reach controls below the screen. + +Audio is stored as mono AAC in M4A files at 44.1 kHz / 128 kbps, approximately 1 MB per minute. The large numeral shows whole minutes in the current recording or playback, and total saved minutes on the home screen. Floating motion stops while capture is paused, the app is in the background, animations are disabled, or battery saver is active. + +## Settings + +Open **Settings** beside Moments. During capture, scroll below Save to reach it; recording continues while you browse. + +### Storage + +A large proportional ring fills most of the initial view. Lime is available space, gray is other used storage, and white represents Remember. A small white marker makes a tiny app slice visible without inflating its share. The center shows the percentage free and total capacity. Scroll down for available/app-used amounts, Refresh, and Back. + +App usage includes installed app files, recordings, data, and cache. Readings refresh every five seconds while the page is open. Available space follows Android's accounting, including reclaimable cache. If Android's app accounting is unavailable, an approximate app size is marked with `≈`. + +### Recording limit + +Turn the limit off for unlimited recording by time, or turn it on and choose **1–1,440 minutes** with the picker or rotary input. Disabling it retains your chosen length and action. + +Under **At the limit**, choose **Save & stop** to end the recording, or **Save & start next** to continue with a new clip at zero. Split clips have numbered titles and their own bookmarks. Paused time does not count. Changes apply to the next recording session, including all its parts. The 500 MB safety cap applies in either mode. + +## Tests and automated checks + +Local checks: + +```sh +./gradlew :app:assembleDebug :app:lintDebug :app:testDebugUnitTest :app:assembleDebugAndroidTest +``` + +Device tests require a **disposable** emulator with a microphone. They create audio files and temporarily change preferences. Two tests record for a real minute; do not run them during a personal recording. Ensure only the intended test emulator is connected, because the connected-test task can target every connected device. + +```sh +./gradlew :app:connectedDebugAndroidTest +``` + +Coverage includes duration formatting, limit boundaries, pause exclusion, real one-minute automatic stop and split rollover, playable file output, bookmarks, settings persistence/navigation, storage accounting, and clip rename/delete behavior. + +[Android checks](.github/workflows/android.yml) runs on pushes, pull requests, and manual dispatch. It verifies the wrapper, builds the debug app, runs lint and unit tests, and compiles device tests. It uploads check reports and a debug APK with a 14-day retention period. Device tests are run locally; the workflow does not claim to run them. The workflow uses pinned action commits and read-only repository permissions. Its first hosted run will happen after the repository is pushed to GitHub. + +## Privacy, contributions, and license + +Recordings remain in the app's private local storage. There are no accounts, analytics, ads, or upload features, and no internet permission. See [PRIVACY.md](PRIVACY.md). + +See [CONTRIBUTING.md](CONTRIBUTING.md) for development and pull-request guidance. Keep private audio, credentials, signing keys, local IDE/device configuration, and build output out of the repository. + +Remember's code and original artwork are released under the [MIT license](LICENSE). Android, Kotlin, Gradle, build plugins, and test dependencies retain their own licenses. See [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md). diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md new file mode 100644 index 0000000..ce9adf3 --- /dev/null +++ b/THIRD_PARTY_NOTICES.md @@ -0,0 +1,15 @@ +# Third-party notices + +Remember's source code and original vector artwork are covered by [LICENSE](LICENSE). Third-party tools and libraries retain their own licenses. + +## Gradle wrapper + +The checked-in `gradlew`, `gradlew.bat`, and `gradle/wrapper/gradle-wrapper.jar` are generated from [Gradle 9.4.1](https://github.com/gradle/gradle/tree/v9.4.1) and distributed under the Apache License, Version 2.0. The generated script copyright and license headers are retained, and the JAR includes `META-INF/LICENSE`. A copy of the license is available in [licenses/Apache-2.0.txt](licenses/Apache-2.0.txt). + +The wrapper configuration pins the Gradle distribution and its official SHA-256 checksum. The included JAR checksum also matches Gradle's published checksum. These generated wrapper files are not relicensed under MIT. + +## Resolved dependencies and platform resources + +Android APIs, Kotlin runtime libraries, the Android Gradle Plugin, and test libraries are obtained through the Android SDK or Gradle rather than copied as source into this repository. Their own license notices apply. Dependency coordinates and versions are listed in `gradle/libs.versions.toml` and `app/build.gradle.kts`. + +The app uses Android's installed system fonts. No Samsung font, watch-face asset, or wallpaper is bundled. The Spatial Number appearance is referenced as design inspiration; the numeral paths and other app artwork are drawn in project code. Screenshots in `docs/` show the app running in an emulator. diff --git a/app/build.gradle.kts b/app/build.gradle.kts index f5d907e..34e8c20 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -4,6 +4,7 @@ plugins { android { namespace = "meghdad.remember" + buildToolsVersion = "36.1.0" compileSdk { version = release(36) { minorApiLevel = 1 @@ -34,9 +35,6 @@ android { } dependencies { - implementation(libs.androidx.appcompat) - implementation(libs.androidx.core.ktx) - implementation(libs.material) testImplementation(libs.junit) androidTestImplementation(libs.androidx.espresso.core) androidTestImplementation(libs.androidx.junit) diff --git a/app/src/androidTest/java/meghdad/remember/ExampleInstrumentedTest.kt b/app/src/androidTest/java/meghdad/remember/ExampleInstrumentedTest.kt deleted file mode 100644 index 560434f..0000000 --- a/app/src/androidTest/java/meghdad/remember/ExampleInstrumentedTest.kt +++ /dev/null @@ -1,24 +0,0 @@ -package meghdad.remember - -import androidx.test.platform.app.InstrumentationRegistry -import androidx.test.ext.junit.runners.AndroidJUnit4 - -import org.junit.Test -import org.junit.runner.RunWith - -import org.junit.Assert.* - -/** - * Instrumented test, which will execute on an Android device. - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -@RunWith(AndroidJUnit4::class) -class ExampleInstrumentedTest { - @Test - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("meghdad.remember", appContext.packageName) - } -} \ No newline at end of file diff --git a/app/src/androidTest/java/meghdad/remember/LaunchTest.kt b/app/src/androidTest/java/meghdad/remember/LaunchTest.kt new file mode 100644 index 0000000..3c2fb0e --- /dev/null +++ b/app/src/androidTest/java/meghdad/remember/LaunchTest.kt @@ -0,0 +1,30 @@ +package meghdad.remember + +import android.content.Intent +import android.widget.Button +import android.view.View +import android.view.ViewGroup +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 +import org.junit.Test +import org.junit.runner.RunWith +import org.junit.Assert.* + +@RunWith(AndroidJUnit4::class) +class LaunchTest { + @Test fun homeLaunchesWithAccessibleRecordAndLibraryControls() { + val instrumentation = InstrumentationRegistry.getInstrumentation() + val activity = instrumentation.startActivitySync( + Intent(instrumentation.targetContext, MainActivity::class.java).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) + ) + try { + instrumentation.runOnMainSync { + fun descendants(view: View): List = listOf(view) + + if (view is ViewGroup) (0 until view.childCount).flatMap { descendants(view.getChildAt(it)) } else emptyList() + val buttons = descendants(activity.window.decorView).filterIsInstance