Android Library to handle multiple Uri's(paths) received through Intents.

Overview

📚 Handle Path Oz

Android library written in Kotlin, but can be used in Java too. Built to handle a single or multiple Uri (paths) received through Intents.

When you retrieve a Uri through an intent, its path is defined in relation to the File Chooser used, which does not represent the actual path of the file, making it impossible to work with it. This library aims to retrieve the real path of any file in a simple way, and then it is possible to use it for its proper purpose.

Compatible with API version from 16.

💞 Support us

We are developing this structure in the open source community without financial planning. If you like this project and would like to help us, make a donation:

Check my Patreon Donate with Paypal Buy me a coffee

📝 Content

📱 Sample application

Sample App

🌱 Download release

You can download the sample application with the latest release here.

🌱 Install by GooglePlay

Check the Sample App on GooglePlay

Check HandlePathOz on Google Play

🛠️ Config

First check the latest version.

Gradle

In build.gradle(Module:app) within dependencies, implement:

    implementation 'com.github.onimur:handle-path-oz:1.0.7'

Maven


    <dependency>
      <groupId>com.github.onimur</groupId>
      <artifactId>handle-path-oz</artifactId>
      <version>1.0.7</version>
      <type>pom</type>
    </dependency>

Ivy


    <dependency org='com.github.onimur' name='handle-path-oz' rev='1.0.7'>
      <artifact name='handle-path-oz' ext='pom' ></artifact>
    </dependency>

💡 Getting start

Working with Multiple uri

The next steps are for working with multiple uri as well as for a single uri.

🎲 Kotlin

You can check in the wikipage, click here.

🎲 Java

You can check in the wikipage, click here.

Working with Single uri

The next steps only serve to work with a single uri.

🎲 Kotlin

You can check in the wikipage, click here.

🎲 Java

You can check in the wikipage, click here.

🚀 Projects using this library

Here's a wikipage list of projects.

If you've used this library, please let me know! Nothing makes me happier than seeing someone else take my work and go wild with it.

🔍 Main features

📐 Built with

🧩 Contributing

This project is open-source, so feel free to fork, or to share your ideas and changes to improve the project, check with more details below.

📃 License

Copyright (c) 2020, HandlePathOz.

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.
You might also like...
Android Ptrace Inject for all ABIs and all APIs. Help you inject Shared Library on Android.

Android Ptrace Inject 中文可以参考我的注释内容进行理解 我写的注释相对来说比较全面了 How to build Make sure you have CMake and Ninja in your PATH Edit CMakeLists.txt. Set ANDROID_ND

YouTube Player library for Android and Chromecast, stable and customizable.
YouTube Player library for Android and Chromecast, stable and customizable.

android-youtube-player android-youtube-player is a stable and customizable open source YouTube player for Android. It provides a simple View that can

A highly customizable calendar library for Android, powered by RecyclerView.
A highly customizable calendar library for Android, powered by RecyclerView.

CalendarView A highly customizable calendar library for Android, powered by RecyclerView. With this library, your calendar will look however you want

View
View "injection" library for Android.

Kotter Knife Deprecated: This was a terrible idea because it allocates an object for every view reference. Do not use, and do not use anything like it

Android library that creates app shortcuts from annotations
Android library that creates app shortcuts from annotations

Shortbread Android library that generates app shortcuts for activities and methods annotated with @Shortcut. No need to touch the manifest, create XML

Kotlin library for Android
Kotlin library for Android

KAndroid Kotlin library for Android providing useful extensions to eliminate boilerplate code in Android SDK and focus on productivity. Download Downl

Events Calendar is a user-friendly library that helps you achieve a cool Calendar UI with events mapping. You can customise every pixel of the calendar as per your wish and still achieve in implementing all the functionalities of the native android calendar in addition with adding dots to the calendar which represents the presence of an event on the respective dates. It can be done easily, you are just a few steps away from implementing your own badass looking Calendar for your very own project! A Lightweight PDF Viewer Android library which only occupies around 125kb while most of the Pdf viewer occupies up to 16MB space.
A Lightweight PDF Viewer Android library which only occupies around 125kb while most of the Pdf viewer occupies up to 16MB space.

Pdf Viewer For Android A Simple PDF Viewer library which only occupies around 125kb while most of the Pdf viewer occupies upto 16MB space. How to inte

[Android Library] Get easy access to device information super fast, real quick
[Android Library] Get easy access to device information super fast, real quick

DeviceInfo-Sample Simple, single class wrapper to get device information from an android device. This library provides an easy way to access all the d

Comments
  • Single file Uri without list

    Single file Uri without list

    Thank you for this library. Your documentation and sample app seem to only make reference to multiple files (list). I will love to see how you recommend I implement this for a file picker than will only pick one file.

    enhancement 
    opened by buildbro 6
  • [ENHANCEMENT] Ability to handle directories

    [ENHANCEMENT] Ability to handle directories

    Is your feature request related to a problem? Please describe. 🚀

    Hi, I tried this library and I was not able to convert directory URIs to paths. Would it be possible that this library can also handle directories? I can understand if the library wasn't made for that though, so instead is there a way I can derive the path myself?

    I've set up following the wiki instructions. I launched the directory chooser

                Intent directoryChooser = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
                startActivityForResult(directoryChooser, 55);
    

    And this was the result that came back

    021-09-14 18:57:43.140 6066-6066/com.mendhak.gpslogger E/HandlePathOz: StandaloneCoroutine - java.lang.UnsupportedOperationException: Unsupported Uri content://com.android.externalstorage.documents/tree/primary%3AGPSLogger - Unsupported Uri content://com.android.externalstorage.documents/tree/primary%3AGPSLogger
    2021-09-14 18:57:43.140 6066-6066/com.mendhak.gpslogger D/LoggingSettingsFragment: onRequestHandlePathOz:292 - The real path is: 
         The type is: 
    2021-09-14 18:57:43.140 6066-6066/com.mendhak.gpslogger E/LoggingSettingsFragment: onRequestHandlePathOz:296 - Unsupported Uri content://com.android.externalstorage.documents/tree/primary%3AGPSLogger
    2021-09-14 18:57:43.140 6066-6066/com.mendhak.gpslogger D/HandlePathOz: StandaloneCoroutine - MainScope isActive: true
        This Scope isActive: true
        Job isNew: false
        Job isCompleting: true
        Job isCancelling: false
        Job wasCancelled: false
        Job wasCompleted: false
    

    Describe the solution you'd like:

    Would be good if I could get the real path of a directory. But I can see the problem with handling cloud content providers, there's nothing you can 'copy' locally, so this library probably isn't meant for directories?

    enhancement 
    opened by mendhak 1
  • How can i get uri of selected file in onRequestHandlePathOz method. [ENHANCEMENT]

    How can i get uri of selected file in onRequestHandlePathOz method. [ENHANCEMENT]

    Hello Thank you for this wonder full library. it helps a lot.

    I wanted to know that how can i get the uri of selected file in onRequestHandlePathOz method. Currently i can see that only type and path is return in this method.

    enhancement 
    opened by Pradeepkumar2091 1
  • [BUG] Incorrect path for files in sub-folder

    [BUG] Incorrect path for files in sub-folder

    Describe the bug 🐛: First of all, thank you for your great library! Been using this for almost a year and it's been really helpful! But while testing I realized that there's a bug for the files in a sub folder. No issue with files that are not in a folder.

    To Reproduce:

    1. I added "Test.doc" in Download/testing
    2. handlePath OZ returned an incorrect path: /storage/emulated/0/Download/Test.doc

    Expected behavior: Returned path should be: /storage/emulated/0/Download/testing/Test.doc

    Screenshots: image

    Smartphone (please complete the following information):

    • OS: Samsung s22+, Android 12, Target SDK: 32
    • HandlePath OZ version: 1.0.7

    Additional context: Note that there's no issue with local files that are not in any sub-folder. Cloud files work fine too. I think have something to do with "msf". Underlined in red have the issue, the rest are working fine: image

    bug 
    opened by adefiesta 0
Releases(1.0.7)
Owner
Murillo Comino
Murillo Comino
Extension functions over Android's callback-based APIs which allows writing them in a sequential way within coroutines or observe multiple callbacks through kotlin flow.

callback-ktx A lightweight Android library that wraps Android's callback-based APIs into suspending extension functions which allow writing them in a

Sagar Viradiya 171 Oct 31, 2022
A simple way to handle remote image in Kotlin.

Parrot A kotlin extension to load easily remote images in your ImageView. Install Add to gradle in allprojects maven { url 'https://jitpack.io' } the

Matteo Crippa 22 Oct 3, 2022
💫 Small microservice to handle state changes of Kubernetes pods and post them to Instatus or Statuspages

?? Kanata Small microservice to handle state changes of Kubernetes pods and post them to Instatus or Statuspages ?? Why? I don't really want to implem

Noel 4 Mar 4, 2022
Movie app that receives popular movies and allows the user to search for the specific movie through the Rest API with help of retrofit library &MVVM architecture.

MovieClue Millions of movies, TV shows and people to discover. Explore now Movie app that recieves popular movies and allow the user to search for spe

Shubham Tomar 6 Mar 31, 2022
A light weight Compose Animation library to choreograph low level Animation API through Kotlin DSL.

Koreography Choreograph your Compose Animation ?? ?? A lightweight Compose Animation utility library to choreograph low-level Animation API (https://d

Sagar Viradiya 107 Jan 8, 2023
An android application developed in Kotlin that provides lists and tables of soccer leagues through api consumption

An android application developed in Kotlin that provides lists and tables of soccer leagues through api consumption

Paulo César 4 May 16, 2022
Simple MVVM app to get photos through https://unsplash.com api

MyPhotoLoaderApp Simple photo loading app powered by Unsplash.com which implements MVVM architecture using Hilt, Navigation Component, Retrofit, Pagin

Behnam Banaei 10 Oct 6, 2022
LiveData 数据倒灌:别问,问就是不可预期 - Perfect alternative to SingleLiveEvent, supporting multiple observers.

前言 大家好,我是《Jetpack MVVM Best Practice》作者 KunMinX。 今天提到的 “数据倒灌” 一词,缘于我为了方便理解和记忆 “页面在 ‘二进宫’ 时收到旧数据推送” 的情况,而在 2019 年 自创并在网上传播的 关于此类现象的概括。 它主要发生在:通过 Shared

KunMinX 924 Jan 5, 2023
[Android Library] A SharedPreferences helper library to save and fetch the values easily.

Preference Helper A SharedPreferences helper library to save and fetch the values easily. Featured in Use in your project Add this to your module's bu

Naveen T P 13 Apr 4, 2020
Oratio Library for Android Studio helps you simplify your Android TTS codes

Oratio Oratio is a library for Android Studio. This library is useful to a number of developers who are currently making apps using android TTS(Text-T

Jacob Lim 1 Oct 28, 2021