From 4b6d348f74ad152092c634546eefa327e101cbe4 Mon Sep 17 00:00:00 2001 From: osphvdhwj <150425690+osphvdhwj@users.noreply.github.com> Date: Thu, 13 Nov 2025 18:22:06 +0530 Subject: [PATCH 01/29] Initial deep-research and planning: open-source Android file manager with PDF, Office (DOCX, XLSX, PPTX), archive (RAR/ZIP/7z) integration using open-source libraries. Outlines architecture, proposed apps/libs, intended feature set, and next steps. --- docs/RESEARCH_AND_PLAN.md | 58 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 docs/RESEARCH_AND_PLAN.md diff --git a/docs/RESEARCH_AND_PLAN.md b/docs/RESEARCH_AND_PLAN.md new file mode 100644 index 0000000..b9fa567 --- /dev/null +++ b/docs/RESEARCH_AND_PLAN.md @@ -0,0 +1,58 @@ +# AllDocs-FileManager: Deep Research & Initial Planning + +## Overview +AllDocs-FileManager aims to be a highly customizable, open-source Android file manager with integrated document viewing for PDF, Office (DOCX, XLSX, PPTX), and compressed archive (RAR/ZIP/7z) formats—without supporting videos/music—to serve as the foundation for a modern alldocumentreader.office.viewer.filereader-style utility. + +## Core Requirements +- **File Explorer**: Modern file/folder navigation, search, and permissions handling for Android. +- **PDF Viewing**: Render and interact with PDFs natively. +- **Office Document Viewing**: Read/display DOCX, XLSX, PPTX files (basic formatting adequate). +- **Archive Viewing**: Open/extract RAR, ZIP, 7z, etc., inspect contents, and decompress on demand. +- **All-in-one UX**: Centralized interface—one tap to view any supported document or archive in place. +- **No video/music playback.** + +## Chosen Tech Stack +- **Platform**: Android (Java/Kotlin) +- **File Core**: Jetpack Compose/AndroidX for UI, SAF for file access +- **PDF Viewer**: [AndroidPdfViewer](https://github.com/barteksc/AndroidPdfViewer) (Apache 2.0, ~8k stars) +- **DOCX/XLSX/PPTX**: [Andropen Office](https://play.google.com/store/apps/details?id=com.andropenoffice.editor) for reference; [docx4j-Android](https://github.com/plutext/docx4j-android) (for DOCX), [Apache POI Android port](https://github.com/Abubakr077/apachepoiandroid) +- **PPT(X) Viewer**: Custom view using Apache POI for parsing, with basic slide rendering +- **RAR/ZIP/7z Support**: [ZArchiver APK](https://www.zarchiver.pro/) (GPL, for reference), [UnRar Tool (Android)](https://github.com/mahmoudgalal/UnRar-Tool-Android), [SevenZipJBinding] for 7z +- **Other**: Markdown/EPUB reader based on Okular/other FOSS projects for extensibility + +## Library Shortlist +- **PDF**: + - AndroidPdfViewer (supported, maintained, works on local/remote files) + - afreakyelf/Pdf-Viewer (lightweight alt) +- **Office**: + - Apache POI (best for spreadsheets, basic for DOCX/PPTX on Android) + - docx4j-Android (DOCX) +- **Archive**: + - UnRar Tool for RAR + - java.util.zip / commons-compress for ZIP + - SevenZipJBinding for 7z + +## Architecture Plan +- Modular document/format detectors +- Intents/activities for each supported type +- Pluggable viewer components +- Respect Android storage permissions, SAF + +## Next Steps +1. Prototype integration: PDF and DOCX (POI/docx4j) +2. Implement archive browsing and basic extraction +3. Smooth in-app document switching (tab, view pager, etc.) +4. Performance optimization: async file IO, caching, large file handling +5. UI/UX: Single-click open in-place, modern Compose UI, error fallback for unsupported types +6. Licensing audit for compliance (Apache 2.0/GPL/MIT) + +## References & Inspiration +- AndroidPdfViewer, afreakyelf/Pdf-Viewer, docx4j-Android, Apache POI, UnRar Tool-Android, ZArchiver, Okular +- Andropen Office, All Document Reader, Office Documents Viewer, Open / LibreOffice, WPS Office (for feature reference only) + +## Target Audience +- Developers who want a documented, upgradable open-source base for file/document managers on Android with out-of-the box support for PDF, Office, RAR/ZIP/7z, Markdown, and more. + +--- +*Created: 2025-11-13* +*Author: AI Research on request* From 4ffd634884893dd3c4e40b3188f7ff5c379caead Mon Sep 17 00:00:00 2001 From: osphvdhwj <150425690+osphvdhwj@users.noreply.github.com> Date: Thu, 13 Nov 2025 18:22:29 +0530 Subject: [PATCH 02/29] Add detailed library & feature component shortlist. Includes core library choices and existing apps for architectural and UI reference. Complements planning doc. --- docs/COMPONENTS.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 docs/COMPONENTS.md diff --git a/docs/COMPONENTS.md b/docs/COMPONENTS.md new file mode 100644 index 0000000..79d62e9 --- /dev/null +++ b/docs/COMPONENTS.md @@ -0,0 +1,24 @@ +# Core Libraries & Features + +## PDF Viewing +- **AndroidPdfViewer** (https://github.com/barteksc/AndroidPdfViewer) - Most popular, maintained, feature-rich. MIT License. +- **afreakyelf/Pdf-Viewer** - Extremely lightweight, MIT License. + +## Office Document Viewing +- **Apache POI (Android port)**: Only for parsing and extracting text/data from DOCX/XLSX/PPTX. For PPTX rendering, minimal formatting. Not a full visual fidelity library. +- **docx4j-Android**: For DOCX handling. +- **Andropen Office** (reference only): FOSS Office suite on Android. + +## Archive Formats +- **UnRar Tool (Android)** (https://github.com/mahmoudgalal/UnRar-Tool-Android) - Efficient RAR extraction and info. +- **ZArchiver** (reference, GPL): Broad archive support on Android. +- **java.util.zip, commons-compress**: Core archive support in Java. +- **SevenZipJBinding**: 7z files. + +## General Document/Markdown/EPUB +- **Okular**: Multi-format universal viewer for long-term extensibility or desktop builds. + +## Existing Apps for Reference +- **Office Documents Viewer** (https://play.google.com/store/apps/details?id=at.tomtasche.reader) +- **All Document Reader** (https://play.google.com/store/apps/details?id=com.document.officereader.docs.viewer) +- **Andropen Office** (https://play.google.com/store/apps/details?id=com.andropenoffice.editor) From 0c9921883248fdfc3d6af00cbb0a15dffd6be3c1 Mon Sep 17 00:00:00 2001 From: osphvdhwj <150425690+osphvdhwj@users.noreply.github.com> Date: Thu, 13 Nov 2025 18:23:37 +0530 Subject: [PATCH 03/29] Expand initial README in AllDocs-FileManager with features, library choices, getting started, credits, and documentation pointers. Reference core planning docs and goals for new and contributing developers. --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index f98f5cc..8615022 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,28 @@ # AllDocs-FileManager A customizable open-source Android file manager with integrated PDF, document (Office), and archive (e.g., RAR) viewer capabilities, suitable for extension as an alldocumentreader-style app. Features centralized file browsing with support for multiple formats using modern open-source libraries. + +## Core Features +- Clean file/folder browsing interface +- Open and view: + - PDF documents (AndroidPdfViewer, afreakyelf/Pdf-Viewer) + - Microsoft Office: DOCX/XLSX/PPTX (Apache POI, Andropen Office, docx4j) + - Compressed archives: RAR/ZIP/7z (UnRar Tool, SevenZipJBinding, ZArchiver for reference) + - Markdown and simple ebooks (Okular base/extension) +- No music/video media playback—docs/archives focus only +- Simple, user-focused UI (Compose) +- Extensible and developer-friendly codebase + +## Getting Started +1. Clone this repo +2. Open with Android Studio +3. Add dependencies listed in `docs/COMPONENTS.md` + +## License +Multi-license (component-specific): MIT/Apache/GPL. Review each library's license in `docs/COMPONENTS.md`. + +## Credits +- AndroidPdfViewer, afreakyelf/Pdf-Viewer, docx4j-Android, Apache POI, UnRar Tool-Android, ZArchiver (GPL), Okular +- Inspiration: All Document Reader, Andropen Office, WPS Office, Office Documents Viewer + +--- +Initial architecture, docs, and plans in `/docs/`. AI-generated repo starter by request. From 82a9c9bb6e2fc9394f3e6324dec982d2e05fe1d6 Mon Sep 17 00:00:00 2001 From: osphvdhwj <150425690+osphvdhwj@users.noreply.github.com> Date: Thu, 13 Nov 2025 18:24:24 +0530 Subject: [PATCH 04/29] Add docs/UI_UX_AND_LOGIC.md specifying user experience principles, planned screens, UX flow, app logic, and suggested architecture/folder structure for AllDocs-FileManager MVP. For review before app code scaffolding. --- docs/UI_UX_AND_LOGIC.md | 44 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 docs/UI_UX_AND_LOGIC.md diff --git a/docs/UI_UX_AND_LOGIC.md b/docs/UI_UX_AND_LOGIC.md new file mode 100644 index 0000000..3db683a --- /dev/null +++ b/docs/UI_UX_AND_LOGIC.md @@ -0,0 +1,44 @@ +# UI/UX and App Logic Design + +## User Experience Principles +- Simple, modern Compose UI focusing on fast browsing and clear file type icons +- Central home screen: folders, file search, recent files, quick shortcuts (Downloads, Documents, Archive, etc.) +- Each document format uses a custom activity/viewer for best UX +- File actions: Open, Rename, Delete, Share, Extract (archives only) +- Fast file preview by tapping file, with fallback to external apps if unsupported +- Smooth in-app navigation (tabbed or drawer UI for switching folders/types) +- Minimal onboarding, “how-to” dialog on first launch + +## Core Screens +- **Home**: Folder tree, quick actions, file search bar +- **Viewer**: Renders PDF/DOCX/PPTX/XLSX/Archive directly; toolbar: share, print, info, jump to page, basic annotation highlights for PDF +- **Archive**: List archive contents, extract single/multiple files, view archive info +- **Settings**: Theme, cache size, clear history, show/hide hidden files, file type associations + +## Workflow (Logic) +1. Launch: request SAF permissions per Android’s requirements; load storage structure +2. User can browse or search files/folders +3. On file click, detect format (by file extension > lightweight scan if needed) +4. Route to the correct viewer: PDF, Office, Archive, Markdown/Epub (future: plug in more) +5. Show loading dialog as files load; async and background workers handle large file IO; cancelable tasks +6. For archives, show file list with extract/download options, password prompt if protected +7. If a format is not natively supported, offer to open in external app +8. Caching for big files (thumbnails, last-viewed page, etc.) +9. Error handling: user-friendly dialogs and logs +10. All file/view state managed by ViewModel layer for robust reactivity + +## Folder Structure Proposal +- `app/` - Main Android project code +- `ui/` - Composables, screens, icon assets +- `core/` - File logic, type detection, archive/PDF helpers +- `docs/` - Architecture, research, changelogs +- `viewers/` - Integrations for PDF, Office, Archive + +## Design Notes +- Start with Material 3 and Android’s standard Compose navigation/components +- Built-in file icons for each format (PDF, DOCX, XLS, PPT, RAR, ZIP, etc.) +- Unified color palette for clean, professional look +- Extensive error handling and helpful tooltips for new users + +--- +This plan covers initial UX/UI and logic design structure, guiding prototype → MVP → extensible polished app ready for broad Android deployment. \ No newline at end of file From 9c32a0bcd1eff1ddec473b32089555d2291f3de0 Mon Sep 17 00:00:00 2001 From: osphvdhwj <150425690+osphvdhwj@users.noreply.github.com> Date: Thu, 13 Nov 2025 18:27:19 +0530 Subject: [PATCH 05/29] Add complete Android application structure: Gradle config, manifest, dependencies for PDF/Office/Archive viewing --- app/build.gradle.kts | 107 +++++++++++++++++++++++++++++++++++++++++++ build.gradle.kts | 5 ++ settings.gradle.kts | 19 ++++++++ 3 files changed, 131 insertions(+) create mode 100644 app/build.gradle.kts create mode 100644 build.gradle.kts create mode 100644 settings.gradle.kts diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 0000000..7896ac1 --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,107 @@ +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") + id("kotlin-kapt") +} + +android { + namespace = "com.alldocs.filemanager" + compileSdk = 34 + + defaultConfig { + applicationId = "com.alldocs.filemanager" + minSdk = 24 + targetSdk = 34 + versionCode = 1 + versionName = "1.0.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + vectorDrawables { + useSupportLibrary = true + } + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + kotlinOptions { + jvmTarget = "17" + } + + buildFeatures { + compose = true + } + + composeOptions { + kotlinCompilerExtensionVersion = "1.5.3" + } + + packaging { + resources { + excludes += "/META-INF/{AL2.0,LGPL2.1}" + } + } +} + +dependencies { + // Core Android + implementation("androidx.core:core-ktx:1.12.0") + implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2") + implementation("androidx.activity:activity-compose:1.8.0") + + // Compose + implementation(platform("androidx.compose:compose-bom:2023.10.01")) + implementation("androidx.compose.ui:ui") + implementation("androidx.compose.ui:ui-graphics") + implementation("androidx.compose.ui:ui-tooling-preview") + implementation("androidx.compose.material3:material3") + implementation("androidx.compose.material:material-icons-extended") + + // Navigation + implementation("androidx.navigation:navigation-compose:2.7.5") + + // ViewModel + implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.6.2") + + // Coroutines + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3") + + // PDF Viewer + implementation("com.github.barteksc:android-pdf-viewer:3.2.0-beta.1") + + // Apache POI for Office documents + implementation("org.apache.poi:poi:5.2.3") + implementation("org.apache.poi:poi-ooxml:5.2.3") + + // Archive support + implementation("org.apache.commons:commons-compress:1.24.0") + implementation("net.sf.sevenzipjbinding:sevenzipjbinding:16.02-2.01") + implementation("net.sf.sevenzipjbinding:sevenzipjbinding-all-platforms:16.02-2.01") + + // Document parsing + implementation("org.apache.xmlbeans:xmlbeans:5.1.1") + + // Coil for image loading + implementation("io.coil-kt:coil-compose:2.5.0") + + // Testing + testImplementation("junit:junit:4.13.2") + androidTestImplementation("androidx.test.ext:junit:1.1.5") + androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") + androidTestImplementation(platform("androidx.compose:compose-bom:2023.10.01")) + androidTestImplementation("androidx.compose.ui:ui-test-junit4") + debugImplementation("androidx.compose.ui:ui-tooling") + debugImplementation("androidx.compose.ui:ui-test-manifest") +} \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..847ea43 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,5 @@ +// Top-level build file +plugins { + id("com.android.application") version "8.1.2" apply false + id("org.jetbrains.kotlin.android") version "1.9.10" apply false +} \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..adda275 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,19 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + maven { url = uri("https://jitpack.io") } + } +} + +rootProject.name = "AllDocs-FileManager" +include(":app") \ No newline at end of file From 7d09f3e6dd4c60bde2f6112fd2df3045cf9ac3be Mon Sep 17 00:00:00 2001 From: osphvdhwj <150425690+osphvdhwj@users.noreply.github.com> Date: Thu, 13 Nov 2025 18:28:02 +0530 Subject: [PATCH 06/29] Add AndroidManifest with necessary permissions and main activity configuration --- app/src/main/AndroidManifest.xml | 59 +++++++++++++++++++ app/src/main/res/values/strings.xml | 20 +++++++ app/src/main/res/values/themes.xml | 4 ++ app/src/main/res/xml/backup_rules.xml | 5 ++ .../main/res/xml/data_extraction_rules.xml | 7 +++ app/src/main/res/xml/file_paths.xml | 6 ++ 6 files changed, 101 insertions(+) create mode 100644 app/src/main/AndroidManifest.xml create mode 100644 app/src/main/res/values/strings.xml create mode 100644 app/src/main/res/values/themes.xml create mode 100644 app/src/main/res/xml/backup_rules.xml create mode 100644 app/src/main/res/xml/data_extraction_rules.xml create mode 100644 app/src/main/res/xml/file_paths.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..a7ab7f6 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..4d74961 --- /dev/null +++ b/app/src/main/res/values/strings.xml @@ -0,0 +1,20 @@ + + + AllDocs FileManager + Browse Files + Recent Files + Settings + Search files… + No files found + Storage permission required + Grant Permission + Open + Delete + Rename + Share + Extract + File Info + Loading… + Error loading file + Unsupported file format + \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..2b8e815 --- /dev/null +++ b/app/src/main/res/values/themes.xml @@ -0,0 +1,4 @@ + + +