Skip to content

pannya70/thoughts

Repository files navigation

Secure Note-Taking Android App

A beautiful, minimalistic note-taking application built with Kotlin and Jetpack Compose. Features encrypted local storage, Material 3 design, and gesture-based navigation.

Technology Stack

  • Language: Kotlin (Google's recommended language for Android development)
  • UI Framework: Jetpack Compose with Material 3
  • Database: Room with SQLCipher encryption
  • Architecture: MVVM (ViewModel + Repository)
  • Build System: Gradle
  • Min SDK: API 24 (Android 7.0 Nougat)
  • Target SDK: API 34 (Android 14)
  • IDE: Android Studio (recommended)

Features

  • Secure: All notes encrypted at rest using SQLCipher
  • Offline: Completely local, no internet connection required
  • Minimalistic: Clean, distraction-free UI with Material 3 design
  • Gesture Navigation: Triple-tap anywhere to toggle between note creation and note list
  • Full CRUD: Create, read, update, and delete notes
  • Timestamps: See when each note was created

Prerequisites

Before you begin, ensure you have the following installed:

  1. Android Studio - Download from developer.android.com/studio
  2. Java Development Kit (JDK) - JDK 17 or 21 REQUIRED (JDK 25 is not yet supported by Gradle)
    • On Arch Linux: sudo pacman -S jdk21-openjdk && sudo archlinux-java set java-21-openjdk
    • See JAVA_SETUP.md for detailed instructions
  3. Android SDK - Installed via Android Studio's SDK Manager
  4. An Android phone with USB debugging enabled

IMPORTANT: If you have Java 25 installed, you MUST switch to JDK 17 or 21 before building. See JAVA_SETUP.md for instructions.

Project Setup

1. Open Project in Android Studio

  1. Launch Android Studio
  2. Select File → Open
  3. Navigate to this project directory (HelloWorld)
  4. Click OK to open the project
  5. Android Studio will automatically sync Gradle files and download dependencies (this may take a few minutes on first run)

2. Install Gradle Wrapper (if needed)

If the Gradle wrapper JAR file is missing, Android Studio will prompt you to download it, or you can run:

./gradlew wrapper

Connecting Your Android Phone for Debugging

Follow these steps to connect your Android phone and run the app:

Step 1: Enable Developer Options on Your Phone

  1. Open Settings on your Android phone
  2. Scroll down and tap About phone (or About device)
  3. Find Build number (may be under Software information)
  4. Tap Build number 7 times rapidly
  5. You'll see a message saying "You are now a developer!"

Step 2: Enable USB Debugging

  1. Go back to Settings
  2. Find and tap Developer options (usually under System or Advanced)
  3. Toggle Developer options ON
  4. Scroll down and enable USB debugging
  5. If prompted, tap OK to confirm

Step 3: Install USB Drivers (if needed)

For Windows:

For Linux:

  • Usually no drivers needed, but you may need to configure udev rules
  • Run: sudo apt-get install android-tools-adb android-tools-fastboot (Debian/Ubuntu)
  • Or: sudo pacman -S android-tools (Arch Linux)

For macOS:

  • Usually works out of the box, no drivers needed

Step 4: Connect Your Phone

  1. Connect your Android phone to your computer using a USB cable
  2. On your phone, you may see a popup asking "Allow USB debugging?" - tap Allow (or OK)
  3. Check the box "Always allow from this computer" if you want to skip this prompt in the future
  4. Tap Allow

Step 5: Verify Connection

Using Android Studio:

  1. In Android Studio, look at the bottom toolbar
  2. Click on the Device Manager tab (or go to View → Tool Windows → Device Manager)
  3. Your phone should appear in the list of devices

Using Command Line (ADB):

  1. Open a terminal/command prompt
  2. Navigate to your Android SDK platform-tools directory (usually ~/Android/Sdk/platform-tools on Linux/Mac, or %LOCALAPPDATA%\Android\Sdk\platform-tools on Windows)
  3. Run: adb devices
  4. You should see your device listed, for example:
    List of devices attached
    ABC123XYZ    device
    

If you see "unauthorized", check your phone for the USB debugging authorization prompt.

Running the App

Method 1: Using Android Studio (Recommended)

  1. Make sure your phone is connected and visible in Device Manager
  2. In Android Studio, click the Run button (green play icon) in the toolbar
  3. Or press Shift + F10 (Windows/Linux) or Ctrl + R (Mac)
  4. Select your connected phone from the device list
  5. Click OK
  6. The app will build, install, and launch on your phone automatically

Method 2: Using Command Line

  1. Open a terminal in the project root directory
  2. Run:
    ./gradlew installDebug
    (On Windows: gradlew.bat installDebug)
  3. The app will be installed on your connected device
  4. Launch it manually from your phone's app drawer, or run:
    adb shell am start -n com.helloworld/.MainActivity

Troubleshooting

Phone Not Detected

  1. Check USB cable: Use a data-capable USB cable (not charging-only)
  2. Try different USB port: Some USB ports may not work properly
  3. Restart ADB:
    adb kill-server
    adb start-server
    adb devices
  4. Check USB connection mode: On your phone, when connected, pull down the notification shade and ensure it's set to "File Transfer" or "MTP" mode (not "Charging only")
  5. Re-enable USB debugging: Toggle USB debugging off and on again in Developer Options

"Device Unauthorized" Error

  1. Check your phone screen for the USB debugging authorization prompt
  2. Tap Allow or OK
  3. Check "Always allow from this computer" to avoid future prompts
  4. Run adb devices again to verify

Build Errors

  1. Gradle sync failed:

    • Go to File → Invalidate Caches / Restart in Android Studio
    • Click Invalidate and Restart
  2. SDK not found:

    • Open File → Project Structure (or File → Settings → Appearance & Behavior → System Settings → Android SDK)
    • Ensure Android SDK is properly configured
    • Install required SDK platforms via SDK Manager
  3. Kotlin version mismatch:

    • The project uses Kotlin 1.9.20
    • Android Studio should handle this automatically, but if issues occur, check build.gradle.kts files

App Crashes on Launch

  1. Check Logcat in Android Studio (bottom panel) for error messages
  2. Ensure your phone meets minimum requirements (Android 7.0 or higher)
  3. Try uninstalling and reinstalling the app:
    adb uninstall com.helloworld
    ./gradlew installDebug

Linux-Specific Issues

If you get "permission denied" errors for ADB:

  1. Create udev rules file:

    sudo nano /etc/udev/rules.d/51-android.rules
  2. Add this line (replace USERNAME with your username):

    SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"
    
  3. Add your user to plugdev group:

    sudo usermod -aG plugdev $USER
  4. Reload udev rules:

    sudo udevadm control --reload-rules
    sudo udevadm trigger
  5. Log out and log back in, or restart your computer

Project Structure

HelloWorld/
├── app/
│   ├── build.gradle.kts          # App-level build configuration
│   ├── src/
│   │   └── main/
│   │       ├── AndroidManifest.xml
│   │       ├── java/com/helloworld/
│   │       │   └── MainActivity.kt
│   │       └── res/
│   │           ├── layout/
│   │           │   └── activity_main.xml
│   │           └── values/
│   │               ├── strings.xml
│   │               └── colors.xml
├── build.gradle.kts               # Project-level build configuration
├── settings.gradle.kts            # Project settings
└── README.md                      # This file

Next Steps

Now that you have Hello World running:

  1. Modify the app: Edit MainActivity.kt or activity_main.xml to customize the UI
  2. Add features: Learn about Activities, Fragments, and Android components
  3. Explore Kotlin: Learn more about Kotlin syntax and Android development
  4. Read documentation: Visit developer.android.com for tutorials and guides

Resources

License

This is a simple Hello World project for learning purposes.


Happy Coding! 🚀

About

A simple note taking app for Android.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages