All Projects → Turtlebody → android-doc-picker

Turtlebody / android-doc-picker

Licence: MIT license
A simple and easy to use documents Picker android library. Choose any documents like pdf, ppt, text, word or media files from your device

Programming Languages

kotlin
9241 projects
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to android-doc-picker

Contentmanager
Android library for getting photo or video from a device gallery, cloud or camera. Working with samsung devices. Made by Stfalcon
Stars: ✭ 108 (+191.89%)
Mutual labels:  files, images, videos
Filegator
Powerful Multi-User File Manager
Stars: ✭ 587 (+1486.49%)
Mutual labels:  files, file-manager
Filemasta
A search application to explore, discover and share online files
Stars: ✭ 571 (+1443.24%)
Mutual labels:  files, videos
Qtfm
Qt File Manager
Stars: ✭ 73 (+97.3%)
Mutual labels:  files, file-manager
Vanilla Lazyload
LazyLoad is a lightweight, flexible script that speeds up your website by deferring the loading of your below-the-fold images, backgrounds, videos, iframes and scripts to when they will enter the viewport. Written in plain "vanilla" JavaScript, it leverages IntersectionObserver, supports responsive images and enables native lazy loading.
Stars: ✭ 6,596 (+17727.03%)
Mutual labels:  images, videos
Exiftool Vendored.js
Fast, cross-platform Node.js access to ExifTool
Stars: ✭ 200 (+440.54%)
Mutual labels:  images, videos
Files
A modern file manager that pushes the boundaries of the platform.
Stars: ✭ 15,198 (+40975.68%)
Mutual labels:  files, file-manager
Alchemy
🔮 File conversion, all from the menu bar
Stars: ✭ 815 (+2102.7%)
Mutual labels:  files, images
Uploadcare Widget
Uploadcare Widget, an ultimate tool for HTML5 file upload supporting multiple file upload, drag&drop, validation by file size/file extension/MIME file type, progress bar for file uploads, image preview.
Stars: ✭ 183 (+394.59%)
Mutual labels:  files, images
Ultracopier
Ultracopier acts as a replacement for files copy dialogs. Features: play/pause, speed limitation, on-error resume, error/collision management ...
Stars: ✭ 220 (+494.59%)
Mutual labels:  files, file-manager
MediaSliderView
Pure java based, highly customizable media slider gallery supporting both images and videos for android.
Stars: ✭ 85 (+129.73%)
Mutual labels:  images, videos
gettyimages-api nodejs
Getty Images API SDK for Node.js
Stars: ✭ 17 (-54.05%)
Mutual labels:  images, videos
Lassi-Android
All in 1 picker library for android.
Stars: ✭ 108 (+191.89%)
Mutual labels:  images, videos
Awesome Deepfakes Materials
A curated list of awesome Deepfakes materials
Stars: ✭ 219 (+491.89%)
Mutual labels:  images, videos
cloudinary-api
Shorter and lighter APIs for Cloudinary
Stars: ✭ 41 (+10.81%)
Mutual labels:  images, videos
react-butterfiles
🦋 Component for building file fields - from basic file inputs to drag and drop image galleries.
Stars: ✭ 44 (+18.92%)
Mutual labels:  files, images
RAImagePicker
📸 iMessage-like, Image Picker Controller Provides custom features.
Stars: ✭ 14 (-62.16%)
Mutual labels:  images, videos
insomnia-plugin-documents-br
O plugin tem a finalidade de gerar documentos e alguns dados mais usados, o foco é para dados do Brasil.
Stars: ✭ 21 (-43.24%)
Mutual labels:  documents
tensorflow-bicubic-downsample
tf.image.resize_images has aliasing when downsampling and does not have gradients for bicubic mode. This implementation fixes those problems.
Stars: ✭ 23 (-37.84%)
Mutual labels:  images
WWDCNotes
WWDCNotes.com content
Stars: ✭ 343 (+827.03%)
Mutual labels:  videos

This is deprecated. Please use other library like:


API Download

Demo:

Get it on Google Play

DocPicker Library for Android (AndroidX)

A Doc Picker library for Android for selecting single/multiple files of any type.

Setup

Step 1: Add the dependency

dependencies {
    ...
    /*Doc picker */
    implementation 'com.greentoad.turtlebody.docpicker:doc-picker:$latestVersion'

    /*for rxjava support*/
    implementation 'io.reactivex.rxjava2:rxjava:2.2.5'
    implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
}

Usage

Step 1: Declare and Initialize DocPicker.

Java

ArrayList<String> docs = new ArrayList<>();
docs.add(DocPicker.DocTypes.PDF);
docs.add(DocPicker.DocTypes.MS_POWERPOINT);
docs.add(DocPicker.DocTypes.MS_EXCEL);
docs.add(DocPicker.DocTypes.TEXT);


DocPickerConfig pickerConfig = new DocPickerConfig()
        .setAllowMultiSelection(false)
        .setShowConfirmationDialog(true)
        .setExtArgs(docs);

DocPicker.with(this)
        .setConfig(pickerConfig)
        .onResult()
        .subscribe(new Observer<ArrayList<Uri>>() {
            @Override
            public void onSubscribe(Disposable d) { }

            @Override
            public void onNext(ArrayList<Uri> uris) {
                //uris: list of uri
            }

            @Override
            public void onError(Throwable e) { }

            @Override
            public void onComplete() { }
        });

Kotlin

val docs = arrayListOf<String>(
    DocPicker.DocTypes.PDF,
    DocPicker.DocTypes.MS_WORD,
    DocPicker.DocTypes.MS_POWERPOINT,
    DocPicker.DocTypes.MS_EXCEL,
    DocPicker.DocTypes.TEXT)

val pickerConfig = DocPickerConfig()
    .setShowConfirmationDialog(true)
    .setAllowMultiSelection(false)
    .setExtArgs(docs)

DocPicker.with(this)
    .setConfig(pickerConfig)
    .onResult()
    .subscribe({
        println ( "here is the list: $it" )
    },{
        println ( "error: ${it.printStackTrace()}")
    })

Explanation:

1. DocPickerConfig:

It is use to set the configuration.

  1. .setAllowMultiSelection(booleanValue): tells whether to select single file or multiple file.
  2. .setShowConfirmationDialog(booleanValue): tells whether to show confirmation dialog on selecting the file(only work in single file selection).
  3. .setExtArgs(stringArrayValue): this will help in filtering the docs base on these speficied extentions(values in stringArray).

eg.

//Pick single file with confirmation dialog and set extentions arguments
ArrayList<String> docs = new ArrayList<String>();
docs.add(DocPicker.DocTypes.PDF);
docs.add(DocPicker.DocTypes.MS_POWERPOINT);
docs.add(DocPicker.DocTypes.MS_EXCEL);
docs.add(DocPicker.DocTypes.TEXT);


DocPickerConfig pickerConfig = new DocPickerConfig()
        .setAllowMultiSelection(false)
        .setShowConfirmationDialog(true)
        .setExtArgs(docs);

URI:

We will be returning the list of Uri after selecting the files. That's why it is better to know about Uri first.

A Uniform Resource Identifier (URI) is a compact sequence of characters that identifies an abstract or physical resource.

In Android, Content providers manage access to a structured set of data. They encapsulate the data, and provide mechanisms for defining data security. Content providers are the standard interface that connects data in one process with code running in another process. You can get almost all information from uri.

URI usages:

  1. Get file from uri:
File file = new File(uri.getPath());
  1. Get mime from uri:
String mimeType = getContentResolver().getType(uri);
  1. Used in Glide:
Glide.with(context)
     .load(uri)
     .into(imageView);

Quick Links

Demos

Developers


To pick media files(audio,image,video) you can use Turtlebody Media Picker library.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].