diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 0c1d3c4..0000000 --- a/.gitignore +++ /dev/null @@ -1,126 +0,0 @@ -# Built application files -*.apk -*.aab -*.ap_ -*.aab - -# Files for the ART/Dalvik VM -*.dex - -# Java class files -*.class - -# Generated files -bin/ -gen/ -out/ -release/ - -# Gradle files -.gradle/ -build/ -.gradle.kts - -# Local configuration file (sdk path, etc) -local.properties - -# Proguard folder generated by Eclipse -proguard/ - -# Log Files -*.log - -# Android Studio Navigation editor temp files -.navigation/ - -# Android Studio captures folder -captures/ - -# IntelliJ -*.iml -.idea/ -.idea/workspace.xml -.idea/tasks.xml -.idea/gradle.xml -.idea/assetWizardSettings.xml -.idea/dictionaries -.idea/libraries -.idea/jarRepositories.xml -.idea/androidTestResultsUserPreferences.xml -.idea/compiler.xml -.idea/libraries/ -.idea/modules.xml -.idea/navEditor.xml - -# Keystore files -# Uncomment the following lines if you do not want to check your keystore files in. -*.jks -*.keystore - -# External native build folder generated by Android Studio -.externalNativeBuild -.cxx/ - -# Google Services (e.g. APIs or Firebase) -google-services.json - -# Freeline -freeline.py -freeline/ -freeline_project_description.json - -# fastlane -fastlane/report.xml -fastlane/Preview.html -fastlane/screenshots -fastlane/test_output -fastlane/readme.md - -# Version control -vcs.xml - -# lint -lint/intermediates/ -lint/generated/ -lint/outputs/ -lint/tmp/ -# lint/reports/ - -# Android Profiling -*.hprof - -# Temporary files -*.tmp -*.temp -*.swp -*.swo -*~ - -# OS generated files -.DS_Store -.DS_Store? -._* -.Spotlight-V100 -.Trashes -ehthumbs.db -Thumbs.db - -# IDE specific files -.vscode/ -*.code-workspace - -# Snapshot files -.snapshots/ - -# Test results -test-results/ -reports/ - -# Gradle wrapper cache -gradle/wrapper/dists/ - -# Android build cache -.android/build-cache/ - -# Lock files -*.lock diff --git a/CLEANUP_SUMMARY.md b/CLEANUP_SUMMARY.md deleted file mode 100644 index dbb440b..0000000 --- a/CLEANUP_SUMMARY.md +++ /dev/null @@ -1,193 +0,0 @@ -# StudySuite Project Cleanup Summary - -## ๐งน What Was Cleaned - -### Removed Directories -- โ **`build/`** - Project build output directory -- โ **`app/build/`** - App-specific build output directory -- โ **`.gradle/`** - Gradle cache and daemon files -- โ **`.idea/`** - IntelliJ IDEA/Android Studio project files -- โ **`.vscode/`** - Visual Studio Code workspace files -- โ **`.snapshots/`** - Unnecessary snapshot files - -### Removed Cache Files -- โ **Gradle caches** - Build dependency caches -- โ **Android build cache** - Android-specific build artifacts -- โ **Temporary files** - `.tmp`, `.log`, `.lock` files -- โ **IDE caches** - Various IDE-generated cache files - -## ๐ Current Clean Project Structure - -``` -StudySuite/ -โโโ ๐ฑ app/ # Main application code -โ โโโ src/main/ -โ โ โโโ java/com/studysuite/app/ # Kotlin source code -โ โ โโโ cpp/ # Native C++ code -โ โ โโโ res/ # Android resources -โ โ โโโ AndroidManifest.xml # App manifest -โ โโโ build.gradle # App-level build config -โ โโโ CMakeLists.txt # Native build config -โโโ ๐ Documentation/ # Project documentation -โ โโโ README.md # Project overview -โ โโโ USER_GUIDE.md # User manual -โ โโโ TECHNICAL_DOCUMENTATION.md # Developer reference -โ โโโ DEVELOPMENT_SETUP.md # Setup guide -โโโ ๐ Build Files/ # Essential build configuration -โ โโโ build.gradle # Project-level build config -โ โโโ settings.gradle # Project settings -โ โโโ gradle.properties # Gradle properties -โ โโโ gradlew # Gradle wrapper (Unix) -โ โโโ gradlew.bat # Gradle wrapper (Windows) -โโโ ๐งน Cleanup Scripts/ # Maintenance scripts -โ โโโ clean.bat # Windows batch cleanup -โ โโโ clean.ps1 # PowerShell cleanup -โ โโโ CLEANUP_SUMMARY.md # This file -โโโ ๐ Configuration/ # Project configuration -โ โโโ .gitignore # Git ignore rules -โ โโโ local.properties # Local environment config -โโโ ๐ฆ Gradle/ # Gradle wrapper files - โโโ wrapper/ - โโโ gradle-wrapper.properties # Gradle version config -``` - -## ๐ How to Keep Your Project Clean - -### 1. **Regular Cleanup** -Run cleanup scripts before major changes: -```bash -# Windows (Command Prompt) -clean.bat - -# Windows (PowerShell) -.\clean.ps1 - -# Unix/Linux/macOS -./gradlew clean -``` - -### 2. **Before Committing Code** -```bash -# Clean build artifacts -./gradlew clean - -# Remove IDE files if they were regenerated -# (These are now in .gitignore) -``` - -### 3. **When Switching Branches** -```bash -# Clean everything to avoid conflicts -./gradlew clean -./gradlew cleanBuildCache -``` - -### 4. **After Dependency Updates** -```bash -# Clean and refresh dependencies -./gradlew clean -./gradlew --refresh-dependencies -``` - -## ๐ง Cleanup Scripts Explained - -### **clean.bat** (Windows Batch) -- Stops Gradle daemons -- Cleans project build directories -- Removes IDE-specific files -- Handles locked files gracefully - -### **clean.ps1** (PowerShell) -- More comprehensive cleanup -- Better error handling -- Colored output for better visibility -- Handles locked files with detailed feedback - -## ๐ Space Saved - -After cleanup, your project should be significantly smaller: -- **Before**: ~100MB+ (with caches and build files) -- **After**: ~10-20MB (source code only) -- **Space Saved**: 80-90% reduction - -## ๐จ Important Notes - -### **Files That Will Be Regenerated** -- `build/` directories (created during build) -- `.gradle/` cache (recreated as needed) -- `.idea/` files (recreated when opening in Android Studio) -- `local.properties` (contains your local SDK paths) - -### **Files That Should NOT Be Deleted** -- `app/src/` - Your source code -- `gradle/wrapper/` - Gradle wrapper files -- `*.gradle` files - Build configuration -- `AndroidManifest.xml` - App manifest -- Documentation files (`.md` files) - -## ๐ฏ Best Practices - -### **1. Version Control** -- Keep `.gitignore` updated -- Don't commit build artifacts -- Don't commit IDE-specific files -- Don't commit local configuration - -### **2. Build Process** -- Always clean before major changes -- Use `./gradlew clean` regularly -- Monitor build cache size -- Clean dependencies when updating - -### **3. IDE Usage** -- Let IDEs regenerate their files -- Don't manually edit `.idea/` files -- Use project-specific settings when possible -- Clean IDE caches if issues arise - -## ๐ When to Run Full Cleanup - -- **Before major refactoring** -- **After dependency updates** -- **When switching between branches** -- **If build issues occur** -- **Before releasing/deploying** -- **When IDE becomes slow** -- **After system updates** - -## ๐ Troubleshooting - -### **Build Issues After Cleanup** -```bash -# Sync project -./gradlew --refresh-dependencies - -# Clean and rebuild -./gradlew clean -./gradlew assembleDebug -``` - -### **IDE Issues After Cleanup** -- Restart your IDE -- Let it regenerate project files -- Sync Gradle project -- Invalidate caches and restart - -### **Locked Files** -- Some files may remain locked -- Restart your computer if needed -- Run cleanup scripts again -- Check for running processes - ---- - -## ๐ Benefits of Clean Project - -โ **Faster builds** - No unnecessary cache files -โ **Smaller project size** - Easier to manage and share -โ **Fewer conflicts** - Clean state for development -โ **Better performance** - Reduced IDE overhead -โ **Easier debugging** - No cache-related issues -โ **Professional appearance** - Clean project structure - -**Remember**: A clean project is a happy project! ๐ diff --git a/DEVELOPMENT_SETUP.md b/DEVELOPMENT_SETUP.md deleted file mode 100644 index 0d41107..0000000 --- a/DEVELOPMENT_SETUP.md +++ /dev/null @@ -1,438 +0,0 @@ -# StudySuite Development Setup Guide - -## ๐ Getting Started - -This guide will help you set up the StudySuite development environment on your machine. StudySuite is an Android application that combines Kotlin frontend with native C++ backend for optimal performance. - -## ๐ Prerequisites - -### Required Software -- **Android Studio** (Latest stable version) -- **Java Development Kit (JDK)** 8 or 11 -- **Android SDK** (API 26-34) -- **Android NDK** (Version 25.2.9519653) -- **CMake** (Version 3.18.1 or higher) -- **Git** (For version control) - -### System Requirements -- **Operating System**: Windows 10/11, macOS 10.15+, or Linux -- **RAM**: Minimum 8GB, Recommended 16GB+ -- **Storage**: At least 10GB free space -- **Processor**: Multi-core processor (Intel i5/AMD Ryzen 5 or better) - -## ๐ Installation Steps - -### 1. Install Android Studio -1. **Download Android Studio** from [developer.android.com](https://developer.android.com/studio) -2. **Run the installer** and follow the setup wizard -3. **Install Android SDK** during setup (API 26-34) -4. **Install Android Virtual Device (AVD)** for testing - -### 2. Install Java Development Kit -```bash -# For Windows (using Chocolatey) -choco install openjdk11 - -# For macOS (using Homebrew) -brew install openjdk@11 - -# For Linux (Ubuntu/Debian) -sudo apt update -sudo apt install openjdk-11-jdk - -# For Linux (CentOS/RHEL) -sudo yum install java-11-openjdk-devel -``` - -### 3. Install Android NDK -1. **Open Android Studio** -2. **Go to Tools โ SDK Manager** -3. **Click on SDK Tools tab** -4. **Check "NDK (Side by side)"** -5. **Click Apply and install NDK version 25.2.9519653** - -### 4. Install CMake -1. **In SDK Manager โ SDK Tools tab** -2. **Check "CMake"** -3. **Click Apply and install CMake 3.18.1** - -## ๐ง Environment Configuration - -### 1. Set Environment Variables - -#### Windows -```cmd -# Set JAVA_HOME -setx JAVA_HOME "C:\Program Files\Java\jdk-11" - -# Set ANDROID_HOME -setx ANDROID_HOME "%USERPROFILE%\AppData\Local\Android\Sdk" - -# Set ANDROID_NDK_HOME -setx ANDROID_NDK_HOME "%USERPROFILE%\AppData\Local\Android\Sdk\ndk\25.2.9519653" - -# Add to PATH -setx PATH "%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools" -``` - -#### macOS/Linux -```bash -# Add to ~/.bash_profile or ~/.zshrc -export JAVA_HOME=/Library/Java/JavaVirtualMachines/openjdk-11.jdk/Contents/Home -export ANDROID_HOME=$HOME/Library/Android/sdk -export ANDROID_NDK_HOME=$HOME/Library/Android/sdk/ndk/25.2.9519653 -export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools -``` - -### 2. Verify Installation -```bash -# Check Java version -java -version - -# Check Android SDK -sdkmanager --list - -# Check NDK -ls $ANDROID_NDK_HOME - -# Check CMake -cmake --version -``` - -## ๐ฑ Project Setup - -### 1. Clone the Repository -```bash -git clone https://github.com/yourusername/StudySuite.git -cd StudySuite -``` - -### 2. Open in Android Studio -1. **Launch Android Studio** -2. **Select "Open an existing Android Studio project"** -3. **Navigate to the StudySuite folder** -4. **Click "OK"** - -### 3. Sync Project -1. **Wait for initial sync to complete** -2. **If sync fails, click "Sync Now"** -3. **Resolve any dependency issues** - -### 4. Configure NDK Path -1. **Go to File โ Project Structure** -2. **Select "SDK Location"** -3. **Set NDK location to your installed NDK path** -4. **Click "OK"** - -## ๐จ Build Configuration - -### 1. Gradle Configuration -The project uses Gradle with the following configuration: - -```groovy -// Top-level build.gradle -plugins { - id 'com.android.application' version '8.1.4' apply false - id 'com.android.library' version '8.1.4' apply false - id 'org.jetbrains.kotlin.android' version '1.9.10' apply false -} -``` - -### 2. App-level Configuration -```groovy -// app/build.gradle -android { - namespace 'com.studysuite.app' - compileSdk 34 - - defaultConfig { - applicationId "com.studysuite.app" - minSdk 26 - targetSdk 34 - versionCode 1 - versionName "1.0" - - externalNativeBuild { - cmake { - cppFlags "-std=c++14" - arguments "-DANDROID_STL=c++_shared" - } - } - } - - externalNativeBuild { - cmake { - path file('CMakeLists.txt') - version '3.18.1' - } - } - - ndkVersion "25.2.9519653" -} -``` - -### 3. CMake Configuration -```cmake -# app/CMakeLists.txt -cmake_minimum_required(VERSION 3.18.1) -project("studysuite") - -set(CMAKE_CXX_STANDARD 14) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) - -add_library(studysuite SHARED src/main/cpp/studysuite.cpp) -find_library(log-lib log) -target_link_libraries(studysuite ${log-lib}) - -if(ANDROID) - set_target_properties(studysuite PROPERTIES - ANDROID_STL c++_shared - ANDROID_ARM_NEON TRUE - ) - - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") -endif() -``` - -## ๐ Building the Project - -### 1. Clean Build -```bash -# Clean previous builds -./gradlew clean - -# Clean build cache -./gradlew cleanBuildCache -``` - -### 2. Build Debug APK -```bash -# Build debug version -./gradlew assembleDebug - -# Build for specific ABI -./gradlew assembleDebug -PabiFilters=arm64-v8a -``` - -### 3. Build Release APK -```bash -# Build release version -./gradlew assembleRelease - -# Build with ProGuard -./gradlew assembleRelease -PminifyEnabled=true -``` - -### 4. Install on Device -```bash -# Install debug version -./gradlew installDebug - -# Install release version -./gradlew installRelease -``` - -## ๐งช Testing - -### 1. Unit Tests -```bash -# Run all unit tests -./gradlew test - -# Run specific test class -./gradlew test --tests "com.studysuite.app.StudySuiteActivityTest" -``` - -### 2. Instrumented Tests -```bash -# Run instrumented tests -./gradlew connectedAndroidTest - -# Run on specific device -./gradlew connectedAndroidTest -PdeviceId=emulator-5554 -``` - -### 3. Lint Checks -```bash -# Run lint analysis -./gradlew lint - -# Generate lint report -./gradlew lintDebug -``` - -## ๐ Debugging - -### 1. Native Code Debugging -1. **Enable native debugging in build.gradle** -```groovy -android { - buildTypes { - debug { - debuggable true - jniDebuggable true - } - } -} -``` - -2. **Set breakpoints in C++ code** -3. **Use Android Studio's native debugger** - -### 2. WebView Debugging -1. **Enable WebView debugging** -```kotlin -if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { - WebView.setWebContentsDebuggingEnabled(true) -} -``` - -2. **Use Chrome DevTools for WebView debugging** - -### 3. Logging -```kotlin -// Kotlin logging -Log.d("StudySuite", "Debug message") -Log.e("StudySuite", "Error message") - -// C++ logging -__android_log_print(ANDROID_LOG_INFO, "StudySuite", "Native log message"); -``` - -## ๐ Performance Analysis - -### 1. Profiling -1. **Use Android Studio Profiler** -2. **Monitor CPU, Memory, and Network usage** -3. **Analyze native code performance** - -### 2. Memory Analysis -```bash -# Generate memory dump -./gradlew dumpMemory - -# Analyze memory usage -./gradlew analyzeMemory -``` - -### 3. Performance Testing -```bash -# Run performance tests -./gradlew performanceTest - -# Generate performance report -./gradlew performanceReport -``` - -## ๐จ Troubleshooting - -### Common Issues - -#### Build Failures -```bash -# Clean and rebuild -./gradlew clean -./gradlew assembleDebug - -# Check Gradle daemon -./gradlew --stop -./gradlew assembleDebug -``` - -#### NDK Issues -```bash -# Verify NDK installation -ls $ANDROID_NDK_HOME - -# Check NDK version compatibility -./gradlew --version -``` - -#### CMake Issues -```bash -# Verify CMake installation -cmake --version - -# Check CMake path in build.gradle -``` - -#### Memory Issues -```bash -# Increase Gradle memory -echo 'org.gradle.jvmargs=-Xmx4096m' >> gradle.properties - -# Clean build cache -./gradlew cleanBuildCache -``` - -### Getting Help -1. **Check Android Studio logs** -2. **Review Gradle build output** -3. **Check CMake configuration** -4. **Verify environment variables** -5. **Consult Android NDK documentation** - -## ๐ Continuous Integration - -### 1. GitHub Actions -```yaml -# .github/workflows/android.yml -name: Android CI - -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 - with: - java-version: '11' - - uses: actions/setup-android@v2 - with: - ndk-version: '25.2.9519653' - - run: ./gradlew assembleDebug -``` - -### 2. Local CI -```bash -# Run all checks locally -./gradlew check -./gradlew test -./gradlew lint -./gradlew assembleDebug -``` - -## ๐ Additional Resources - -### Documentation -- [Android NDK Guide](https://developer.android.com/ndk/guides) -- [CMake Documentation](https://cmake.org/documentation/) -- [Kotlin Documentation](https://kotlinlang.org/docs/) -- [Android Developer Guide](https://developer.android.com/guide) - -### Tools -- [Android Studio](https://developer.android.com/studio) -- [Android NDK](https://developer.android.com/ndk) -- [CMake](https://cmake.org/) -- [Gradle](https://gradle.org/) - -### Community -- [Stack Overflow](https://stackoverflow.com/questions/tagged/android-ndk) -- [Android Developers Community](https://developer.android.com/community) -- [Kotlin Community](https://kotlinlang.org/community/) - ---- - -## ๐ฏ Next Steps - -1. **Explore the codebase** - Understand the project structure -2. **Run the app** - Test on device or emulator -3. **Make changes** - Start developing new features -4. **Write tests** - Ensure code quality -5. **Submit PRs** - Contribute to the project - -Happy coding! ๐ diff --git a/LICENSE b/LICENSE deleted file mode 100644 index e597319..0000000 --- a/LICENSE +++ /dev/null @@ -1,203 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based upon (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to use, reproduce, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Work, and to - permit persons to whom the Work 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 Work. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, trademark, patent, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright notice to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Support. You may choose to offer, - and to charge a fee for, warranty, support, indemnity or other - liability obligations and/or rights consistent with this License. - However, in accepting such obligations, You may act only on Your - own behalf and on Your sole responsibility, not on behalf of any - other Contributor, and only if You agree to indemnify, defend, and - hold each Contributor harmless for any liability incurred by, or - claims asserted against, such Contributor by reason of your - accepting any such warranty or additional support. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed by the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same page as the copyright notice for easier identification within - third-party archives. - - Copyright [2024] [StudySuite Contributors] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/README.md b/README.md deleted file mode 100644 index 24f24d5..0000000 --- a/README.md +++ /dev/null @@ -1,226 +0,0 @@ -# StudySuite - Advanced Study Companion App - -## Overview -StudySuite is a comprehensive Android application designed to enhance the learning experience through native C++ performance, modern WebView-based UI, and intelligent study algorithms. The app combines the power of native code for performance-critical operations with a rich, responsive web interface for an optimal user experience. - -## ๐ Key Features - -### 1. **Native C++ Performance Engine** -- **High-Performance Algorithms**: Core study algorithms implemented in C++ for maximum speed and efficiency -- **JNI Integration**: Seamless communication between Kotlin UI and C++ backend -- **Optimized Data Processing**: Advanced algorithms for study scoring, flashcard scheduling, and data optimization -- **Memory Efficient**: Native code handles resource-intensive operations without impacting UI responsiveness - -### 2. **Intelligent Study Scoring System** -- **Adaptive Scoring Algorithm**: - - Base score calculation based on study hours - - Task completion bonuses - - Consistency rewards for regular study patterns - - Maximum score cap at 100 points -- **Performance Analytics**: Real-time tracking of study effectiveness -- **Progress Monitoring**: Continuous assessment of learning outcomes - -### 3. **Advanced Flashcard Management** -- **SM-2 Algorithm Implementation**: - - Spaced repetition system for optimal learning intervals - - Quality-based interval adjustments - - Ease factor optimization - - Automatic review scheduling -- **Smart Scheduling**: Calculates optimal review times based on performance -- **Progress Tracking**: Monitors learning progress and retention rates - -### 4. **Comprehensive Study Modules** - -#### ๐ **Notes & Documents** -- **Rich Text Editor**: Full-featured note-taking interface -- **Auto-Save Functionality**: Automatic preservation of work -- **Organized Storage**: Structured note management system -- **Search & Retrieval**: Quick access to stored information -- **Export Capabilities**: Share and backup notes easily - -#### ๐ง **Flashcards** -- **Interactive Cards**: Click to reveal answers and hints -- **Performance Tracking**: Monitor learning progress -- **Due Today System**: Prioritize cards requiring review -- **Learning States**: Track cards in different learning phases -- **Statistics Dashboard**: View comprehensive learning metrics - -#### ๐ **Practice Tests** -- **Multiple Choice Questions**: Interactive test format -- **Progress Tracking**: Real-time progress visualization -- **Score Calculation**: Immediate performance feedback -- **Question Navigation**: Easy movement between questions -- **Results Summary**: Comprehensive test completion reports - -#### ๐ **Progress Analytics** -- **Weekly Study Charts**: Visual representation of study patterns -- **Goal Tracking**: Monitor progress against set objectives -- **Streak Counting**: Track consecutive study days -- **Performance Metrics**: Detailed analysis of learning outcomes -- **Trend Analysis**: Identify study pattern improvements - -#### ๐ฎ **Study Games** -- **Memory Match**: Concentration-based learning game -- **Quick Quiz**: Fast-paced question challenges -- **Word Search**: Vocabulary building exercises -- **Logic Puzzles**: Critical thinking development -- **Interactive Learning**: Gamified study experience - -### 5. **Smart Recommendation Engine** -- **Subject-Specific Advice**: Tailored recommendations based on study area -- **Performance Analysis**: Identify weak areas for improvement -- **Study Plan Optimization**: Suggest optimal study schedules -- **Resource Recommendations**: Guide users to relevant materials -- **Adaptive Learning**: Adjusts recommendations based on progress - -### 6. **Modern WebView Interface** -- **Responsive Design**: Adapts to different screen sizes -- **Dark Theme**: Eye-friendly interface for extended study sessions -- **Material Design**: Modern Android design principles -- **Smooth Animations**: Enhanced user experience -- **Cross-Platform Compatibility**: Web-based content works across devices - -### 7. **Data Processing & Optimization** -- **Text Processing**: Advanced algorithms for note analysis -- **Study Plan Optimization**: Mathematical optimization of study schedules -- **Efficiency Scoring**: Calculate study session effectiveness -- **Statistical Analysis**: Comprehensive data insights -- **Performance Metrics**: Track and optimize learning efficiency - -## ๐ Technical Architecture - -### **Frontend (Kotlin + WebView)** -- **StudySuiteActivity**: Main activity managing UI and navigation -- **WebView Integration**: Rich HTML/CSS/JavaScript interface -- **JavaScript Bridge**: Seamless communication between web and native code -- **Bottom Navigation**: Intuitive module switching -- **Material Design Components**: Modern Android UI elements - -### **Backend (C++ Native Library)** -- **Study Engine**: Core algorithm implementation -- **JNI Interface**: Native method declarations and implementations -- **Performance Optimization**: Efficient data structures and algorithms -- **Memory Management**: Optimized resource handling -- **Cross-Platform Compatibility**: Portable C++ codebase - -### **Build System** -- **Gradle Integration**: Modern Android build system -- **CMake Configuration**: Native library compilation -- **NDK Support**: Android Native Development Kit integration -- **Multi-ABI Support**: ARM, x86, and ARM64 architectures -- **Optimized Compilation**: Performance-focused build settings - -## ๐ฑ User Experience Features - -### **Intuitive Navigation** -- **Bottom Navigation Bar**: Quick access to all modules -- **Module Cards**: Visual representation of study tools -- **Dashboard Overview**: Centralized study statistics -- **Contextual Menus**: Relevant options based on current module - -### **Personalization** -- **Study Statistics**: Track individual progress -- **Customizable Interface**: Adapt to user preferences -- **Progress Tracking**: Monitor learning achievements -- **Goal Setting**: Define and track study objectives - -### **Accessibility** -- **Screen Reader Support**: Comprehensive accessibility features -- **High Contrast Mode**: Enhanced visibility options -- **Touch-Friendly Interface**: Optimized for mobile devices -- **Responsive Layout**: Adapts to different screen orientations - -## ๐ง Technical Specifications - -### **System Requirements** -- **Minimum SDK**: Android 8.0 (API 26) -- **Target SDK**: Android 14 (API 34) -- **Architecture**: ARM, x86, ARM64 -- **Memory**: Optimized for devices with 2GB+ RAM -- **Storage**: Minimal app size with efficient data management - -### **Performance Features** -- **Native C++ Algorithms**: Maximum computational efficiency -- **Optimized WebView**: Fast HTML rendering and JavaScript execution -- **Memory Management**: Efficient resource utilization -- **Background Processing**: Non-blocking UI operations -- **Cache Optimization**: Intelligent data caching strategies - -### **Security Features** -- **Permission Management**: Minimal required permissions -- **Data Isolation**: Secure data handling -- **WebView Security**: Safe JavaScript execution -- **Input Validation**: Secure user input processing - -## ๐ Getting Started - -### **Installation** -1. Build the project using Android Studio or command line -2. Install the APK on your Android device -3. Grant necessary permissions (Internet, Vibration) -4. Start studying with the intuitive interface - -### **First Steps** -1. **Dashboard Overview**: Review your study statistics -2. **Module Selection**: Choose your preferred study tool -3. **Content Creation**: Start taking notes or creating flashcards -4. **Progress Tracking**: Monitor your learning journey -5. **Game Integration**: Engage with interactive learning games - -## ๐ฎ Future Enhancements - -### **Planned Features** -- **Cloud Synchronization**: Cross-device data sync -- **Advanced Analytics**: Machine learning-based insights -- **Social Features**: Study group collaboration -- **Content Library**: Pre-built study materials -- **Offline Mode**: Full functionality without internet - -### **Performance Improvements** -- **Enhanced Algorithms**: More sophisticated study algorithms -- **Better Caching**: Improved data retrieval performance -- **UI Optimizations**: Smoother animations and transitions -- **Memory Optimization**: Reduced resource consumption - -## ๐ Performance Metrics - -### **Study Efficiency** -- **Algorithm Speed**: Sub-millisecond response times for calculations -- **Memory Usage**: Optimized for mobile devices -- **Battery Efficiency**: Minimal impact on device battery -- **Storage Optimization**: Efficient data compression and storage - -### **User Engagement** -- **Interactive Elements**: Engaging study experience -- **Progress Visualization**: Clear feedback on achievements -- **Gamification**: Rewards and achievements system -- **Personalization**: Tailored learning experience - -## ๐ค Contributing - -### **Development Setup** -1. Clone the repository -2. Install Android Studio with NDK support -3. Configure CMake and NDK paths -4. Build and run the project - -### **Code Standards** -- **Kotlin**: Follow official Kotlin coding conventions -- **C++**: Use modern C++14 standards -- **Documentation**: Comprehensive code documentation -- **Testing**: Unit tests for all critical functions - -## ๐ License - -This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details. - -## ๐ Acknowledgments - -- **Android NDK Team**: For native development support -- **Material Design**: For UI/UX guidelines -- **Open Source Community**: For various libraries and tools -- **Study Method Researchers**: For educational algorithm insights - ---- - -**StudySuite** - Empowering learners through intelligent technology and optimized performance. diff --git a/TECHNICAL_DOCUMENTATION.md b/TECHNICAL_DOCUMENTATION.md deleted file mode 100644 index 88320ad..0000000 --- a/TECHNICAL_DOCUMENTATION.md +++ /dev/null @@ -1,484 +0,0 @@ -# StudySuite Technical Documentation - -## Table of Contents -1. [Architecture Overview](#architecture-overview) -2. [Native C++ Implementation](#native-c-implementation) -3. [Kotlin Frontend Architecture](#kotlin-frontend-architecture) -4. [WebView Integration](#webview-integration) -5. [JNI Interface](#jni-interface) -6. [Build Configuration](#build-configuration) -7. [Performance Optimization](#performance-optimization) -8. [Security Considerations](#security-considerations) -9. [Testing Strategy](#testing-strategy) -10. [Deployment Guide](#deployment-guide) - -## Architecture Overview - -### System Architecture -``` -โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ -โ Android Application โ -โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค -โ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ -โ โ Kotlin UI โ โ WebView Interface โ โ -โ โ Layer โโโโโบโ (HTML/CSS/JavaScript) โ โ -โ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ -โ โ โ โ -โ โผ โผ โ -โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ -โ โ JNI Bridge Layer โ โ -โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ -โ โ โ -โ โผ โ -โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ -โ โ Native C++ Library โ โ -โ โ (Study Algorithms & Data Processing) โ โ -โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ -โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ -``` - -### Component Responsibilities -- **Kotlin UI Layer**: Activity management, navigation, system integration -- **WebView Interface**: Rich content display, user interactions -- **JNI Bridge**: Communication between Kotlin and C++ -- **Native Library**: Performance-critical algorithms and data processing - -## Native C++ Implementation - -### Core Algorithms - -#### 1. Study Scoring Algorithm -```cpp -JNIEXPORT jdouble JNICALL -Java_com_studysuite_app_StudySuiteActivity_calculateStudyScore( - JNIEnv *env, jobject thiz, jdouble hours, jint tasks) { - - // Base score calculation (0-100 scale) - double baseScore = hours * 10.0; - - // Task completion bonus - double taskBonus = tasks * 2.5; - - // Consistency bonus (max 5 points) - double consistencyBonus = std::min(hours / 2.0, 5.0); - - // Calculate total score with cap at 100 - double totalScore = baseScore + taskBonus + consistencyBonus; - return std::min(totalScore, 100.0); -} -``` - -**Algorithm Features:** -- **Base Score**: 10 points per study hour -- **Task Bonus**: 2.5 points per completed task -- **Consistency Bonus**: Up to 5 points for regular study patterns -- **Score Cap**: Maximum score limited to 100 points - -#### 2. SM-2 Flashcard Algorithm -```cpp -JNIEXPORT jdouble JNICALL -Java_com_studysuite_app_StudySuiteActivity_calculateNextReviewInterval( - JNIEnv *env, jobject thiz, jint quality, jdouble interval, - jdouble easeFactor) { - - if (quality < 3) { - // Reset interval for poor performance - return 1.0; - } - - // Calculate new ease factor - double newEaseFactor = easeFactor + - (0.1 - (5.0 - quality) * (0.08 + (5.0 - quality) * 0.02)); - - // Ensure minimum ease factor - if (newEaseFactor < 1.3) { - newEaseFactor = 1.3; - } - - // Calculate new interval - double newInterval = interval * newEaseFactor; - - return newInterval; -} -``` - -**SM-2 Algorithm Features:** -- **Quality Assessment**: 1-5 scale for answer quality -- **Ease Factor**: Dynamic adjustment based on performance -- **Interval Calculation**: Exponential spacing for optimal retention -- **Reset Mechanism**: Poor performance resets to daily review - -#### 3. Study Plan Optimization -```cpp -JNIEXPORT jdouble JNICALL -Java_com_studysuite_app_StudySuiteActivity_optimizeStudyPlan( - JNIEnv *env, jobject thiz, jdoubleArray studyHours) { - - jsize length = env->GetArrayLength(studyHours); - jdouble *hours = env->GetDoubleArrayElements(studyHours, nullptr); - - // Calculate statistical measures - double totalHours = 0; - for (int i = 0; i < length; i++) { - totalHours += hours[i]; - } - - double average = totalHours / length; - double variance = 0; - - for (int i = 0; i < length; i++) { - variance += (hours[i] - average) * (hours[i] - average); - } - variance /= length; - double stdDev = sqrt(variance); - - env->ReleaseDoubleArrayElements(studyHours, hours, 0); - - // Return efficiency score (0-100) - return std::min(100.0, (100.0 - (stdDev * 10.0))); -} -``` - -**Optimization Features:** -- **Statistical Analysis**: Mean, variance, and standard deviation -- **Efficiency Scoring**: 0-100 scale based on consistency -- **Memory Management**: Proper JNI array handling -- **Performance Metrics**: Quantitative study plan assessment - -### Memory Management -- **JNI String Handling**: Proper UTF-8 string management -- **Array Management**: Safe array access and release -- **Resource Cleanup**: Automatic cleanup of native resources -- **Memory Leak Prevention**: Strict resource lifecycle management - -## Kotlin Frontend Architecture - -### Main Activity Structure -```kotlin -class StudySuiteActivity : AppCompatActivity() { - private lateinit var webView: WebView - private lateinit var bottomNav: BottomNavigationView - private lateinit var toolbar: Toolbar - - // Native method declarations - external fun initializeStudyEngine(): Boolean - external fun processStudyData(data: String): String - external fun calculateStudyScore(hours: Double, tasks: Int): Double - external fun getOptimizedRecommendations(subject: String): String -} -``` - -### Module Management System -```kotlin -private fun loadModuleInternal(module: String) { - val htmlContent = when (module) { - "notes" -> generateNotesHTML() - "flashcards" -> generateFlashcardsHTML() - "tests" -> generateTestsHTML() - "progress" -> generateProgressHTML() - "games" -> generateGamesHTML() - else -> generateDashboardHTML() - } - webView.loadDataWithBaseURL(null, htmlContent, "text/html", "UTF-8", null) -} -``` - -### JavaScript Interface Bridge -```kotlin -inner class StudyJavaScriptInterface { - @android.webkit.JavascriptInterface - fun loadModule(module: String) { - runOnUiThread { - loadModuleInternal(module) - } - } - - @android.webkit.JavascriptInterface - fun saveNote(title: String, content: String) { - runOnUiThread { - // Save note logic - android.util.Log.d("StudySuite", "Note saved: $title") - } - } -} -``` - -## WebView Integration - -### Security Configuration -```kotlin -webView.settings.apply { - javaScriptEnabled = true - domStorageEnabled = true - loadWithOverviewMode = true - useWideViewPort = true - builtInZoomControls = true - displayZoomControls = false - - // Security settings - allowFileAccess = false - allowContentAccess = false - - // Performance settings - cacheMode = android.webkit.WebSettings.LOAD_DEFAULT -} -``` - -### Custom WebView Client -```kotlin -open class StudyWebViewClient : WebViewClient() { - override fun onPageFinished(view: WebView?, url: String?) { - super.onPageFinished(view, url) - - // Inject JavaScript interface - view?.evaluateJavascript(""" - class AndroidInterface { - loadModule(module) { - console.log('Loading module: ' + module); - } - } - window.Android = new AndroidInterface(); - """.trimIndent(), null) - } -} -``` - -### HTML Content Generation -```kotlin -private fun generateDashboardHTML(): String { - return """ - - -
- - - - - // ... HTML content - - - """.trimIndent() -} -``` - -## JNI Interface - -### Native Method Declarations -```kotlin -// Native methods declaration -external fun initializeStudyEngine(): Boolean -external fun processStudyData(data: String): String -external fun calculateStudyScore(hours: Double, tasks: Int): Double -external fun getOptimizedRecommendations(subject: String): String -``` - -### Library Loading -```kotlin -companion object { - init { - System.loadLibrary("studysuite") - } -} -``` - -### Error Handling -```kotlin -private fun initializeNativeEngine() { - try { - val initialized = initializeStudyEngine() - if (initialized) { - Toast.makeText(this, "Study Engine Initialized", Toast.LENGTH_SHORT).show() - } - } catch (e: UnsatisfiedLinkError) { - Toast.makeText(this, "Native library not loaded", Toast.LENGTH_LONG).show() - } -} -``` - -## Build Configuration - -### Gradle Configuration -```groovy -android { - namespace 'com.studysuite.app' - compileSdk 34 - - defaultConfig { - applicationId "com.studysuite.app" - minSdk 26 - targetSdk 34 - versionCode 1 - versionName "1.0" - - externalNativeBuild { - cmake { - cppFlags "-std=c++14" - arguments "-DANDROID_STL=c++_shared" - } - } - } - - externalNativeBuild { - cmake { - path file('CMakeLists.txt') - version '3.18.1' - } - } - - ndkVersion "25.2.9519653" -} -``` - -### CMake Configuration -```cmake -cmake_minimum_required(VERSION 3.18.1) -project("studysuite") - -# Set C++ standard -set(CMAKE_CXX_STANDARD 14) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -# Set Android-specific variables -set(CMAKE_POSITION_INDEPENDENT_CODE ON) - -# Add library -add_library(studysuite SHARED src/main/cpp/studysuite.cpp) - -# Find required libraries -find_library(log-lib log) - -# Link libraries -target_link_libraries(studysuite ${log-lib}) - -# Android-specific properties -if(ANDROID) - set_target_properties(studysuite PROPERTIES - ANDROID_STL c++_shared - ANDROID_ARM_NEON TRUE - ) - - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") - - if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -fno-exceptions") - endif() -endif() -``` - -### Dependencies -```groovy -dependencies { - implementation 'androidx.core:core-ktx:1.8.0' - implementation 'androidx.appcompat:appcompat:1.6.0' - implementation 'com.google.android.material:material:1.8.0' - implementation 'androidx.constraintlayout:constraintlayout:2.1.3' - implementation 'androidx.webkit:webkit:1.6.0' - testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.5' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0' -} -``` - -## Performance Optimization - -### Native Code Optimization -- **C++14 Standard**: Modern language features for better performance -- **Position Independent Code**: Optimized for Android loading -- **ARM NEON Support**: Hardware acceleration for ARM devices -- **Memory Alignment**: Optimized data structure alignment -- **Compiler Flags**: Performance-focused compilation settings - -### WebView Optimization -- **JavaScript Optimization**: Efficient JavaScript execution -- **CSS Optimization**: Optimized styling and animations -- **Memory Management**: Efficient WebView memory usage -- **Cache Strategy**: Intelligent content caching -- **Resource Loading**: Optimized resource loading patterns - -### UI Performance -- **View Binding**: Efficient view access -- **Background Processing**: Non-blocking UI operations -- **Memory Efficient**: Minimal memory footprint -- **Smooth Animations**: Hardware-accelerated animations -- **Responsive Design**: Fast response to user interactions - -## Security Considerations - -### Permission Management -```xml -