Skip to content

leonadoor/SPTest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

SPTest - Intelligent Time Manager

SPTest is an advanced Android time management application with AI-powered scheduling, Chinese natural language processing, and continuous learning capabilities.

About the Project

This is a testing project developed using Claude code and Superpowers plugin. Intended to explore the workflow of Superpowers, through brainstorming, creating a git worktree, writing plans, executing plans, subagent driven developing, and completing development work after multiple rounds of TDD. There is a significant improvement in the accuracy and practicality of agent development.

๐Ÿš€ Key Features

๐Ÿง  Learning System

  • Continuous Improvement: Learns from user feedback (1-5 star ratings)
  • Pattern Recognition: Identifies optimal time slots for different task categories
  • Adaptive Scheduling: Improves task duration predictions based on historical data
  • Performance Analytics: Tracks system learning progress and scheduling success rates

๐Ÿ—ฃ๏ธ Voice Recognition

  • Chinese Speech-to-Text: Full voice input support with Chinese language model
  • Real-time Processing: Instant voice result processing
  • Permission Handling: Runtime audio permission requests
  • Fallback Support: Seamlessly switches to text input if voice unavailable

๐Ÿ“ Chinese Natural Language Processing

  • Time Expression Parsing: Supports both specific ("9็‚นๅˆฐ11็‚น") and general ("ๅ‘จไธ€ๆ™šไธŠ") time expressions
  • Smart Duration Calculation: Automatically calculates task duration from time ranges
  • Category Detection: Identifies task types (meeting, coding, social, exercise, study)
  • Priority Recognition: Understands Chinese priority keywords (็ดงๆ€ฅ, ้‡่ฆ, ไธ€่ˆฌ)
  • Tag Extraction: Automatically extracts Chinese nouns as task tags

๐Ÿ“‹ Task Management

  • Dual Task Lists: Separate views for Current and Completed tasks
  • Long Press Delete: Task deletion with confirmation dialog
  • Auto-Completion: Time-based task status updates
  • Smart Scheduling: AI-powered optimal time slot suggestions

๐ŸŽจ User Interface

  • Professional Layout: Two ScrollView sections with proper weight distribution
  • Task Cards: Formatted display with all task details
  • Visual Status: Different backgrounds for task states
  • Number Rating: Intuitive 1-5 number button rating system
  • Toast Messages: User-friendly feedback

๐Ÿ› ๏ธ Technology Stack

Android Development

  • Kotlin: Primary programming language
  • Jetpack Components: AppCompat, Room, WorkManager, Lifecycle
  • Material Design: Modern UI/UX components
  • Data Binding: Efficient view binding

AI & Machine Learning

  • Custom Learning Algorithm: Bayesian-based feedback analysis
  • Moving Average Updates: Smooth learning curve with 10% learning rate
  • Pattern Recognition: Category-based task pattern learning
  • Performance Tracking: Real-time system performance metrics

Data Processing

  • JSON Storage: Efficient file-based data persistence
  • Gson Serialization: Object serialization/deserialization
  • User Preferences: Comprehensive settings management
  • Learning Data: Historical feedback and performance tracking

NLP & Speech

  • Custom Chinese Parser: Regex-based time expression parsing
  • Android SpeechRecognizer: Built-in speech recognition API
  • Flexible Time Understanding: Support for vague time expressions

๐Ÿ“ฑ Installation & Setup

Prerequisites

  • Android Studio: Hedgehog or later
  • JDK: 17 or later
  • Android SDK: API 34 (Android 14.0)
  • Gradle: 8.7 or later

Building the Project

  1. Clone the repository:

    git clone <repository-url>
    cd SPTest
  2. Sync Gradle dependencies:

    • Open project in Android Studio
    • Wait for Gradle sync to complete
  3. Build the APK:

    ./gradlew.bat assembleDebug
  4. Run on device/emulator:

    • Connect Android device or start emulator
    • Run app from Android Studio or install APK manually

๐ŸŽฏ Usage Guide

Adding Tasks

Text Input:

  • Type task description: "ๅ‘จไบ”ไธŠๅˆ9็‚นๅˆฐ11็‚นๅผ€ไผš"
  • Press "ๆทปๅŠ ไปปๅŠก" button
  • Task is parsed and added to Current Tasks list

Voice Input:

  • Press microphone button
  • Speak task in Chinese: "ๅ’Œๆœ‹ๅ‹่š้คๆ˜Žๅคฉๆ™šไธŠ"
  • Recognition result fills the input field
  • Press "ๆทปๅŠ ไปปๅŠก" to create task

Task Examples

  • "ๅ‘จไบ”ไธŠๅˆ9็‚นๅˆฐ11็‚นๅผ€ไผš" โ†’ Meeting scheduled for Friday 9-11 AM (120 minutes)
  • "็ดงๆ€ฅ๏ผšๅฎŒๆˆๆŠฅๅ‘Šๅคงๆฆ‚2ๅฐๆ—ถ" โ†’ High priority task with 2-hour duration
  • "ๅ‘จๆœซๆธธๆณณ" โ†’ Exercise task scheduled for weekend morning
  • "ๅ‘จไธ€ๆ™šไธŠๅ’Œๆœ‹ๅ‹่š้ค" โ†’ Social task for Monday evening

Managing Tasks

Long Press Delete:

  • Long press any task card
  • Confirmation dialog appears
  • Tap "ๅˆ ้™ค" to remove task

Auto-Completion:

  • Tasks automatically move to Completed list when time expires
  • Expired tasks are marked as "COMPLETED"

Feedback Rating:

  • Tap completed task to rate scheduling quality
  • Select 1-5 stars (implemented as number buttons)
  • Rating is saved and used to improve future scheduling

Smart Features

Flexible Time Handling:

  • "่ฟ™ไธชๅ‘จๆœซ" โ†’ This weekend based on task category
  • "ไธ‹ๅ‘จ" โ†’ Next week during preferred hours
  • "ๆœˆๅบ•" โ†’ End of month during work hours
  • "ๆ‰พไธชๆ—ถ้—ด" โ†’ Tomorrow during optimal slot

AI Learning:

  • System learns from each feedback rating
  • Adjusts preferred times for task categories
  • Improves duration predictions
  • Tracks scheduling success rates

๐Ÿ—๏ธ Architecture

Project Structure

app/src/main/java/com/example/sptest/
โ”œโ”€โ”€ MainActivity.kt              # Main UI and controller
โ”œโ”€โ”€ TimeManagerApp.kt            # Application class
โ”œโ”€โ”€ data/
โ”‚   โ”œโ”€โ”€ LearningManager.kt       # AI learning algorithm
โ”‚   โ”œโ”€โ”€ StorageManager.kt        # Data persistence system
โ”‚   โ”œโ”€โ”€ Task.kt                  # Task data model
โ”‚   โ”œโ”€โ”€ UserPreferences.kt       # User settings and patterns
โ”‚   โ””โ”€โ”€ Schedule.kt              # Schedule management
โ””โ”€โ”€ nlp/
    โ”œโ”€โ”€ ChineseTaskParser.kt     # NLP engine
    โ””โ”€โ”€ SimpleChineseTaskParser.kt # Simplified parser

Data Models

Task Model:

data class Task(
    val id: String,
    val title: String,
    val priority: Priority,
    val duration: Int, // minutes
    val category: String,
    val scheduledTime: TimeSlot?,
    val feedbackRating: Int,
    // ... other fields
)

User Preferences:

data class UserPreferences(
    val workHours: WorkHours,
    val taskPatterns: Map<String, TaskPattern>,
    val learningData: LearningData
)

Learning Algorithm

Feedback Analysis:

  1. Stores each feedback entry with task context
  2. Updates success rate based on recent 20 entries
  3. Adjusts task patterns for each category
  4. Learns optimal time slots based on ratings

Pattern Updates:

  • Learning Rate: 10% per feedback entry
  • Moving Average: Smooth adaptation to prevent overfitting
  • Category-Specific: Each task type learns independently
  • Time Slot Optimization: Learns preferred times from successful schedules

๐Ÿ”ง Configuration

Build Configuration

build.gradle.kts:

plugins {
    alias(libs.plugins.android.application)
    id("org.jetbrains.kotlin.android") version "1.9.22"
    id("org.jetbrains.kotlin.plugin.serialization") version "1.9.22"
    id("com.google.devtools.ksp") version "1.9.22-1.0.17"
}

android {
    compileSdk = 34
    defaultConfig {
        minSdk = 24
        targetSdk = 34
    }
}

AndroidManifest.xml

<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<application
    android:name=".TimeManagerApp"
    android:theme="@style/Theme.SPTest">
    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

๐Ÿ“Š Performance Metrics

The system tracks key performance indicators:

  • Average Rating: User satisfaction (1-5 scale)
  • Completion Rate: Task completion success percentage
  • Schedule Success Rate: AI scheduling accuracy
  • Total Feedback: Number of feedback entries collected

These metrics are displayed in toast messages after each feedback submission.

๐ŸŒŸ Future Enhancements

Potential improvements:

  • Cloud Sync: Backup and sync across devices
  • Calendar Integration: Export tasks to system calendar
  • Reminder Notifications: Push notifications for upcoming tasks
  • Advanced NLP: Support for more complex Chinese expressions
  • Multi-language Support: English and other languages
  • Dark Mode: Enhanced theme support

๐Ÿค Contributing

Contributions are welcome! Please feel free to:

  • Report issues
  • Suggest features
  • Submit pull requests
  • Improve documentation

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Android Jetpack: For modern Android development components
  • Gson: For JSON serialization
  • Java Time API: For accurate date/time calculations
  • Chinese Language Processing Community: For inspiration on NLP techniques

SPTest combines traditional time management with cutting-edge AI to create an intelligent, learning-enabled scheduling system that understands Chinese natural language and continuously improves based on user feedback.

For questions, issues, or feature requests, please visit the project repository.

About

a test project developed by claude code and superpowers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors