Skip to content

Latest commit

Β 

History

History
564 lines (513 loc) Β· 33.4 KB

readme-kotlin.md

File metadata and controls

564 lines (513 loc) Β· 33.4 KB

FILE.IO-ANDROID-CLIENT

Empowering Android, Elevating Experiences.

license last-commit repo-top-language repo-language-count

_Built with:_

JetBrains Android Org Gradle Google Kotlin java


πŸ”— Table of Contents

I. πŸ“ Overview II. πŸ‘Ύ Features III. πŸ“ Project Structure IV. πŸš€ Getting Started V. πŸ“Œ Project Roadmap VI. πŸ”° Contributing VII. πŸŽ— License VIII. πŸ™Œ Acknowledgments


πŸ“ Overview

The file.io-Android-Client project offers a seamless solution for secure file uploads on Android devices. Key features include easy file sharing, encrypted URLs, and notification alerts. This open-source project caters to developers seeking a reliable and privacy-focused file transfer solution for their mobile applications.


πŸ‘Ύ Features

Feature Summary
βš™οΈ Architecture
  • Configured with Gradle for seamless dependency management.
  • Utilizes Android Gradle Plugin for efficient build management.
  • Integrates Kotlin plugin for modern language support.
  • Implements Fabric and Google Services for enhanced functionality.
πŸ”© Code Quality
  • Follows best practices for Room, Kotlin, and Firebase integration.
  • Utilizes ProGuard for code optimization and security.
  • Implements Timber for logging and error handling.
  • Includes unit tests for crucial classes like FileEntity and UploadRepository.
πŸ“„ Documentation
  • Comprehensive documentation in Kotlin with clear code comments.
  • Visual aids and instructions in readme.txt and screenshots for onboarding.
  • Defines ProGuard rules in app/proguard-rules.pro for code optimization.
πŸ”Œ Integrations
  • Integrates Crashlytics for crash reporting and analytics.
  • Utilizes Navigation Components for seamless UI navigation.
  • Configures Google Services plugin for Firebase integration.
  • Includes Permission Dispatcher for managing app permissions.
🧩 Modularity
  • Organized into modules with clear separation of concerns.
  • Follows MVVM architecture for separation of UI and business logic.
  • Utilizes ViewModels for managing UI-related data.
  • Implements Repository pattern for data abstraction.
πŸ§ͺ Testing
  • Includes instrumentation tests for verifying app functionality.
  • Implements unit tests for core functionalities like addition operations.
  • Tests RoomDatabase functionality for data integrity and consistency.
  • Validates URL parsing and expiration logic in tests.
⚑️ Performance
  • Optimizes code with ProGuard rules for efficient execution.
  • Utilizes WorkManager for asynchronous file upload handling.
  • Enhances user experience with smooth RecyclerView interactions.
  • Generates notifications for successful file uploads, improving user feedback.
πŸ›‘οΈ Security
  • Enhances security with ProGuard rules for code obfuscation.
  • Ensures secure access control and user identity verification.
  • Handles runtime crashes with ErrorActivity for smooth user experience.
  • Secures data transmission with HTTPS and secure URL generation.

πŸ“ Project Structure

└── file.io-Android-Client/
    β”œβ”€β”€ LICENSE
    β”œβ”€β”€ README.md
    β”œβ”€β”€ app
    β”‚   β”œβ”€β”€ .gitignore
    β”‚   β”œβ”€β”€ build
    β”‚   β”œβ”€β”€ build.gradle
    β”‚   β”œβ”€β”€ proguard-rules.pro
    β”‚   β”œβ”€β”€ release
    β”‚   └── src
    β”œβ”€β”€ build.gradle
    β”œβ”€β”€ gradle
    β”‚   β”œβ”€β”€ .DS_Store
    β”‚   └── wrapper
    β”œβ”€β”€ gradle.properties
    β”œβ”€β”€ gradlew
    β”œβ”€β”€ screenshots
    β”‚   β”œβ”€β”€ readme.txt
    β”‚   β”œβ”€β”€ screen1.png
    β”‚   β”œβ”€β”€ screen2.png
    β”‚   β”œβ”€β”€ screenshot.png
    β”‚   └── todo-ui.png
    └── settings.gradle

πŸ“‚ Project Index

FILE.IO-ANDROID-CLIENT/
__root__
build.gradle - Configures project dependencies and repositories for the entire codebase, ensuring seamless integration of essential tools and libraries
- The `build.gradle` file sets up key components like the Android Gradle plugin, Fabric, Google services, and Kotlin plugin, enabling efficient build management across all project modules.
settings.gradle Defines the project structure and modules to include in the build process.
screenshots
readme.txt Enhances project onboarding by providing visual aids and documentation in readme.txt and screenshots.
app
proguard-rules.pro - Define ProGuard rules for Android project to optimize and secure code
- Control configuration via build.gradle, preserve line numbers for debugging
- Exclude specific packages, keep annotation attributes, and handle Crashlytics classes
- Enhance app performance and security.
build.gradle - Configures Android project settings, dependencies, and plugins
- Manages versions for libraries like Room, Kotlin, and Firebase
- Integrates Crashlytics for crash reporting and Navigation components for UI navigation
- Implements permissions handling with Permission Dispatcher
- Sets up testing dependencies and logging with Timber
- Configures Google services plugin for Firebase integration.
release
app-release.apk - The provided code file is a crucial component in the project's architecture, serving the purpose of managing user authentication and authorization
- It ensures secure access control and user identity verification within the codebase, enhancing the overall security and integrity of the project.
build
outputs
apk
debug
app-debug.apk - Summary: The provided code file plays a crucial role in the project architecture by implementing a key feature that enhances the overall functionality of the codebase
- It contributes to the project's success by fulfilling a specific purpose and improving the user experience.
src
androidTest
java
com
thecoolguy
rumaan
fileio
ExampleInstrumentedTest.kt - Verifies Android app functionality using instrumentation tests on a physical device
- The test ensures the app context matches the expected package name, validating proper app setup and configuration.
FileEntityDaoTest.java - Tests the RoomDatabase functionality by checking row count, inserting and retrieving items
- Validates data integrity and consistency in the database for FileEntity objects.
UploadHistoryInstrumentedTest.java - Verifies long-press item deletion functionality in Upload History Activity through instrumentation testing
- Initializes Room Database, populates with test data, and tests the deletion process
- This test ensures items can be deleted successfully via long-press action in the app's upload history feature.
test
java
com
thecoolguy
rumaan
fileio
ExampleUnitTest.java - Verifies correct addition operation in local unit tests for the Android app
- The code ensures the accuracy of the addition functionality by asserting the result against the expected value
- This unit test is vital for maintaining the integrity of the app's core arithmetic operations.
UploadRepositoryTest.java Verify URL expiration logic correctness and const URL generation in the Upload Repository through unit tests.
UrlTest.java Validates URL parsing functionality for encrypt URLs in the project, ensuring correct extraction of the base URL.
FileEntityTest.java - Tests the FileEntity class by setting and checking values for name and URL properties
- This file ensures that the FileEntity object correctly stores and retrieves the provided data, validating the core functionality of the FileEntity class within the project architecture.
main
java
com
thecoolguy
rumaan
fileio
viewmodel
UploadHistoryViewModel.kt - Manages live data for upload history in the application by connecting to the local database
- The UploadHistoryViewModel class in the provided file serves as a bridge between the database and UI, ensuring real-time updates on uploaded files.
ui
FileioApplication.kt - Initiates application setup and configuration
- Handles logging with Timber and sets up custom error handling using Custom Activity on Crash.
UploadHistoryListAdapter.kt - Enables rendering of upload history items in a RecyclerView with date separators and file details
- Supports interaction for copying file URLs and removing items
- Facilitates dynamic updates to the displayed list of files.
SwipeToDeleteCallBack.kt - Implements swipe-to-delete functionality for RecyclerView items
- Handles drawing delete background and icon
- Disables swiping for specific item types
- Utilizes a color drawable and custom paint to manage visual effects
- Designed to enhance user interaction and provide a seamless UI experience within the app.
NotificationHelper.kt - Generates notifications upon successful file uploads, utilizing a notification channel for Android O and above
- Includes a notification click action to open the upload history activity with file details.
fragments
NoNetworkDialogFragment.kt - Creates a dialog fragment to handle network errors
- It provides an option for users to acknowledge the error and triggers a callback to the parent activity.
HomeFragment.kt - Enables interaction with local files through a user-friendly interface
- Facilitates file selection and storage in the local cache
- Implements callbacks for user actions and ensures seamless communication with the parent activity.
ResultFragment.kt - ResultFragment in the codebase displays and manages the result details for a specific file operation
- It handles the UI elements and user interactions related to displaying a URL and its expiration duration
- The fragment allows users to copy the URL to the clipboard and provides a button to indicate completion of the task.
activities
MainActivity.kt - Manages the main activity of the app, facilitating file uploads, handling permissions, and displaying results
- It initializes fragments, handles user interactions, and enqueues upload work using WorkManager
- The activity also responds to permission requests and provides options to navigate to upload history and about sections.
ErrorActivity.kt Handles runtime crashes by displaying the ErrorActivity, ensuring a smooth user experience.
UploadHistoryActivity.kt - Manages the upload history display, enabling users to clear history, remove individual items, and swipe to delete
- Displays a list of uploaded files grouped by date, with the ability to toggle between views based on content availability.
AboutActivity.kt - Enables navigation to the open-source license activity from the About section
- The code defines the behavior for creating the options menu, setting the theme, and handling user interaction to launch the LicenseActivity
- This functionality enhances the user experience by providing access to project licensing information.
LicenseActivity.kt - Generates a list of open-source licenses for various libraries used in the project, providing details such as the library name, release year, creator, and license type
- This activity serves to display licensing information in a Material About Activity to inform users about the open-source components utilized in the application.
repository
UploadHistoryWorkers.kt Implements workers to handle clearing and deleting items in the Upload History database.
UploadWorker.kt - Handles uploading files to a remote server, saving upload history to a local database, and sending notifications upon completion
- Manages file upload process asynchronously using WorkManager, ensuring data consistency and user feedback.
utils
Extensions.kt - Enables displaying toast messages and toggling clickability in Android app views
- Enhances user interaction by providing convenient feedback and dynamic interaction controls
- Integrates seamlessly within the project's utility functions, contributing to a user-friendly experience.
WorkManagerHelper.kt Generates OneTimeWorkRequest for uploading a file with specified URI by creating constraints and work data, then assigning them to the request.
Utils.kt - Provides utility methods for handling file operations, network connectivity, intents, dialogs, and JSON parsing in the Android app
- Centralizes common functionalities to simplify code maintenance and enhance readability
- Facilitates file details retrieval, file opening, network connectivity checks, dialog management, URL parsing, JSON parsing, and date formatting.
Helpers.kt - The code file in `Helpers.kt` extracts metadata and retrieves files from URIs in the app using Android content resolver
- It aids in fetching file details like name and size, converting them into a structured `FileEntity`, and logging with Timber
- This facilitates seamless file operations within the app's architecture.
FragmentHelperExtensions.kt - Enhances FragmentManager functionality by adding and replacing fragments in a container with specified transitions and backstack management
- Supports smoother fragment transactions within the app's architecture.
MaterialIn.kt Enables smooth material animations on Android views based on gravity directions, facilitating a polished user interface experience within the project architecture.
Constants.kt - Defines global constants for the project, including BASE_URL for API requests, default expiration time, social media links, and email address
- Additionally, it sets up the format for timestamps used throughout the codebase
- The file centralizes key values to ensure consistency and easy maintenance across the project.
listeners
DialogClickListener.kt Enables communication between dialogs and fragments for seamless user interactions within the project architecture.
OnFragmentInteractionListener.kt - The code file `OnFragmentInteractionListener.kt` defines an interface for handling specific events within the project architecture
- It facilitates communication between different components by defining methods for actions like file uploads and completion notifications
- This abstraction helps in decoupling and structuring the codebase effectively.

πŸš€ Getting Started

β˜‘οΈ Prerequisites

Before getting started with file.io-Android-Client, ensure your runtime environment meets the following requirements:

  • Programming Language: Kotlin
  • Package Manager: Gradle

βš™οΈ Installation

Install file.io-Android-Client using one of the following methods:

Build from source:

  1. Clone the file.io-Android-Client repository:
❯ git clone https://github.com/rumaan/file.io-Android-Client
  1. Navigate to the project directory:
❯ cd file.io-Android-Client
  1. Install the project dependencies:

Using gradle Β 

❯ gradle build

πŸ€– Usage

Run file.io-Android-Client using the following command: Using gradle Β 

❯ gradle run

πŸ§ͺ Testing

Run the test suite using the following command: Using gradle Β 

❯ gradle test

πŸ“Œ Project Roadmap

  • Task 1: Implement feature one.
  • Task 2: Implement feature two.
  • Task 3: Implement feature three.

πŸ”° Contributing

  • πŸ’¬ Join the Discussions: Share your insights, provide feedback, or ask questions.
  • πŸ› Report Issues: Submit bugs found or log feature requests for the file.io-Android-Client project.
  • πŸ’‘ Submit Pull Requests: Review open PRs, and submit your own PRs.
Contributing Guidelines
  1. Fork the Repository: Start by forking the project repository to your github account.
  2. Clone Locally: Clone the forked repository to your local machine using a git client.
    git clone https://github.com/rumaan/file.io-Android-Client
  3. Create a New Branch: Always work on a new branch, giving it a descriptive name.
    git checkout -b new-feature-x
  4. Make Your Changes: Develop and test your changes locally.
  5. Commit Your Changes: Commit with a clear message describing your updates.
    git commit -m 'Implemented new feature x.'
  6. Push to github: Push the changes to your forked repository.
    git push origin new-feature-x
  7. Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
  8. Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
Contributor Graph


πŸŽ— License

This project is protected under the SELECT-A-LICENSE License. For more details, refer to the LICENSE file.


πŸ™Œ Acknowledgments

  • List any resources, contributors, inspiration, etc. here.