Giter Club home page Giter Club logo

android-multipicker-library's Introduction

Android Multipicker Library (Images, Videos, Files, Audios, Contacts)


Makes it easy and simple to integrate "Attach that file" feature into your android apps.

Don't worry about various devices/OS variations.

Don't worry about out-of-memory errors.

Don't worry about creating thumbnails to show a preview.

Picking up any file for your app, and it's details.

Picking up audio files.

Code less for capturing images/videos/files
  • Choose images from device or take a photo
  • Choose videos from device or record one
  • Choose files available on your device
  • Choose audio files available on your device
  • Choose a contact from the phonebook
  • Works with almost all content providers
  • Get all metadata about the media that you would probably need
  • Similar code base to implement irrespective of Android version of device.
Gradle
implementation 'com.kbeanie:multipicker:1.6.2@aar'
Maven
<dependency>
    <groupId>com.kbeanie</groupId>
    <artifactId>multipicker</artifactId>
    <version>1.6.2</version>
</dependency>

See Wiki Pages for code snippets.

Try out the sample app if you want to test it out first.

Get it on Google Play
Recent changes
Version 1.6.2
  • Issue #180: Crash "FileProvider" metadata not found
Version 1.6.1
  • Issue #180: use of "requestLegacyExternalStorage"
Version 1.6
  • Issue #120: Image selection issue in Android 8.0
  • Other minor bug fixes.
Version 1.5
  • Issue #126: UPT: Made picker classes non final
  • Issue #47: Add quality/compression level property
  • Issue #130: android.database.CursorIndexOutOfBoundsException
  • Issue #121: CursorIndexOutOfBoundsException
Version 1.3
  • Updated build tools and min SDK version
  • Issue #86: Added equals and hashcode methods
License

Copyright 2018 Kumar Bibek

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.


android-multipicker-library's People

Contributors

benoitletondor avatar coomar2841 avatar drewcarlson avatar liaowng avatar livotov avatar ogero avatar wingsafari5 avatar xhunter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-multipicker-library's Issues

Exif issue

Code :

            mCameraImagePicker = new CameraImagePicker(activity);
            mCameraImagePicker.shouldGenerateMetadata(true);
            mCameraImagePicker.shouldGenerateThumbnails(false);
            mCameraImagePicker.ensureMaxSize(1920, 1920);
            mCameraImagePicker.setImagePickerCallback(this);

This line in particular :

            mCameraImagePicker.ensureMaxSize(1920, 1920);

has an issue : I think it doesn't copy the exif params into the reiszed file. All your resized file don't have exif (or change orientation before saving).
So, Glide can't orientate it correctly

To help : http://stackoverflow.com/questions/13596500/android-image-resizing-and-preserving-exif-data-orientation-rotation-etc

We also do something which can help you :

public static Bitmap getResizedBitmap(Bitmap bm, int newWidth, int newHeight) {
        int width = bm.getWidth();
        int height = bm.getHeight();
        float scaleWidth = ((float) newWidth) / width;
        float scaleHeight = ((float) newHeight) / height;
        // CREATE A MATRIX FOR THE MANIPULATION
        Matrix matrix = new Matrix();
        // RESIZE THE BIT MAP
        matrix.postScale(scaleWidth, scaleHeight);

        // RECREATE THE NEW BITMAP
        Bitmap resizedBitmap;
        try {
            resizedBitmap = Bitmap.createBitmap(
                    bm, 0, 0, width, height, matrix, false);
        } catch (OutOfMemoryError error) {
            // do something
        }
        return resizedBitmap;
    }```

allowMultiple() is not working

After setting allowMultiple(), it just allows to select single image. Not get anything in log too.
code for imagepicker is as follows:

imagePicker = new ImagePicker(MainActivity.this);
imagePickerCallback = new ImagePickerCallback() {
@OverRide
public void onImagesChosen(List images) {
}

        @Override
        public void onError(String message) {
        }
    };
    imagePicker.setImagePickerCallback(imagePickerCallback);
    imagePicker.allowMultiple();

Provider Conflict

com.android.server.pm.PackageManagerException: Can't install because provider name com.kbeanie.multipicker (in package package.name.A) is already used by package.name.B

Using com.kbeanie:multipicker:1.1.2-beta@aar

Compatibility Doubt

First of all, I'm sorry for creating this as an issue, but I couldn't find better way to do it.

So, I will use this lib on my project, I liked a lot! But I have one question:
Does anyone have a list of compatible devices for the camera and gallery feature?

It would be great for my tests documentation if there is a list.

Thanks in advance

How to set limit?

Code is working fine but could you please tell me how to set the limit to choose the items.??

Nexus 5 (Android 6.0.1) Video Recording -> postProcessVideo: Error generating metadata

I got the errors below when I am trying to record video for Nexus 5 with Android 6.0.1. I have tested with the following camera apps:
Camera - Version 3.2.042 (2770680-30)
CameraMX - Version 3.5.003

04-29 12:02:34.258 5233-5233/com.kbeanie.multipicker.sample D/VideoPickerImpl: Temp Path for Camera capture: /storage/emulated/0/And Multipicker Demo/And Multipicker Demo Movies/f1a3c14b-a0e0-4f2c-887e-fb7cc0edcccb.mp4
04-29 12:02:34.527 5233-5233/com.kbeanie.multipicker.sample I/Ads: Scheduling ad refresh 60000 milliseconds from now.
04-29 12:02:34.532 5233-5233/com.kbeanie.multipicker.sample I/Ads: Ad finished loading.
04-29 12:02:42.531 5233-5233/com.kbeanie.multipicker.sample D/VideoPickerImpl: handleCameraData: /storage/emulated/0/And Multipicker Demo/And Multipicker Demo Movies/f1a3c14b-a0e0-4f2c-887e-fb7cc0edcccb.mp4
04-29 12:02:42.558 5233-6522/com.kbeanie.multipicker.sample D/FileProcessorThread: processFile: Before: Type: video, QueryUri: file:///storage/emulated/0/And%20Multipicker%20Demo/And%20Multipicker%20Demo%20Movies/f1a3c14b-a0e0-4f2c-887e-fb7cc0edcccb.mp4, Original Path: null, MimeType: null, Size: 0 B
04-29 12:02:42.561 5233-6522/com.kbeanie.multipicker.sample D/FileProcessorThread: processFile: Final Path: Type: video, QueryUri: file:///storage/emulated/0/And%20Multipicker%20Demo/And%20Multipicker%20Demo%20Movies/f1a3c14b-a0e0-4f2c-887e-fb7cc0edcccb.mp4, Original Path: /storage/emulated/0/And Multipicker Demo/And Multipicker Demo Movies/f1a3c14b-a0e0-4f2c-887e-fb7cc0edcccb.mp4, MimeType: video/mp4, Size: 0 B
04-29 12:02:42.563 5233-6522/com.kbeanie.multipicker.sample D/VideoProcessorThread: postProcessVideo: Error generating metadata
04-29 12:02:42.563 5233-6522/com.kbeanie.multipicker.sample W/System.err: java.lang.IllegalArgumentException
04-29 12:02:42.565 5233-6522/com.kbeanie.multipicker.sample W/System.err:     at android.media.MediaMetadataRetriever.setDataSource(MediaMetadataRetriever.java:73)
04-29 12:02:42.565 5233-6522/com.kbeanie.multipicker.sample W/System.err:     at com.kbeanie.multipicker.core.threads.VideoProcessorThread.postProcessVideo(VideoProcessorThread.java:66)
04-29 12:02:42.565 5233-6522/com.kbeanie.multipicker.sample W/System.err:     at com.kbeanie.multipicker.core.threads.VideoProcessorThread.postProcessVideos(VideoProcessorThread.java:53)
04-29 12:02:42.565 5233-6522/com.kbeanie.multipicker.sample W/System.err:     at com.kbeanie.multipicker.core.threads.VideoProcessorThread.run(VideoProcessorThread.java:45)
04-29 12:02:42.577 5233-6522/com.kbeanie.multipicker.sample W/System.err: com.kbeanie.multipicker.api.exceptions.PickerException: Error while generating thumbnail: 1 null
04-29 12:02:42.577 5233-6522/com.kbeanie.multipicker.sample W/System.err:     at com.kbeanie.multipicker.core.threads.FileProcessorThread.downScaleAndSaveImage(FileProcessorThread.java:729)
04-29 12:02:42.577 5233-6522/com.kbeanie.multipicker.sample W/System.err:     at com.kbeanie.multipicker.core.threads.VideoProcessorThread.postProcessVideo(VideoProcessorThread.java:106)
04-29 12:02:42.577 5233-6522/com.kbeanie.multipicker.sample W/System.err:     at com.kbeanie.multipicker.core.threads.VideoProcessorThread.postProcessVideos(VideoProcessorThread.java:53)
04-29 12:02:42.577 5233-6522/com.kbeanie.multipicker.sample W/System.err:     at com.kbeanie.multipicker.core.threads.VideoProcessorThread.run(VideoProcessorThread.java:45)
04-29 12:02:42.618 5233-5233/com.kbeanie.multipicker.sample D/MediaResultsAdapter: getView: 1
04-29 12:02:42.661 5233-5233/com.kbeanie.multipicker.sample D/MediaResultsAdapter: getView: 1
04-29 12:02:50.313 5233-5241/com.kbeanie.multipicker.sample E/System: Uncaught exception thrown by finalizer
04-29 12:02:50.313 5233-5241/com.kbeanie.multipicker.sample E/System: java.lang.NullPointerException: Attempt to invoke virtual method 'void dalvik.system.CloseGuard.close()' on a null object reference
                                                                          at java.io.FileInputStream.close(FileInputStream.java:113)
                                                                          at java.io.FileInputStream.finalize(FileInputStream.java:140)
                                                                          at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:202)
                                                                          at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:185)
                                                                          at java.lang.Thread.run(Thread.java:818)

Open camera app directly

Hi,

First, congrats for the library! It is very complete and helpfull!
My question is if it is possible to bypass the camera app selection intent and open it directly if the camera picker has been selected. Just like Telegram and Whatsapp do.

Thanks!

Problem selecting image from Amazon, Picasa or Dropbox

Hello,

when i try to select image from amazon. i got nullex and app crashed.

Could you please check it

`05-30 12:29:31.419 8919-8919/com.harmankaya.otokolik D/ImagePickerImpl: handleGalleryData: content://com.amazon.drive.fileprovider/original/v9c8Y9AJQqyabGWWKe5HZw/32f7eec06a5e30158153e817927f131f/IMG_9998.jpg

05-30 12:29:31.424 8919-16067/com.harmankaya.otokolik D/FileProcessorThread: processFile: Before: Type: image, QueryUri: content://com.amazon.drive.fileprovider/original/v9c8Y9AJQqyabGWWKe5HZw/32f7eec06a5e30158153e817927f131f/IMG_9998.jpg, Original Path: null, MimeType: null, Size: 0 B Height: 0, Width: 0, Orientation: UNDEFINED

05-30 12:29:31.449 8919-16067/com.harmankaya.otokolik D/FileProcessorThread: processFile: Path: null

05-30 12:29:31.449 8919-16067/com.harmankaya.otokolik W/System.err: java.lang.IllegalArgumentException: column 'mime_type' does not exist

05-30 12:29:31.454 8919-16067/com.harmankaya.otokolik W/System.err:     at android.database.AbstractCursor.getColumnIndexOrThrow(AbstractCursor.java:303)

05-30 12:29:31.454 8919-16067/com.harmankaya.otokolik W/System.err:     at android.database.CursorWrapper.getColumnIndexOrThrow(CursorWrapper.java:78)

05-30 12:29:31.454 8919-16067/com.harmankaya.otokolik W/System.err:     at com.kbeanie.multipicker.core.threads.FileProcessorThread.getAbsolutePathIfAvailable(FileProcessorThread.java:325)

05-30 12:29:31.454 8919-16067/com.harmankaya.otokolik W/System.err:     at com.kbeanie.multipicker.core.threads.FileProcessorThread.processFile(FileProcessorThread.java:168)

05-30 12:29:31.454 8919-16067/com.harmankaya.otokolik W/System.err:     at com.kbeanie.multipicker.core.threads.FileProcessorThread.processFiles(FileProcessorThread.java:104)

05-30 12:29:31.454 8919-16067/com.harmankaya.otokolik W/System.err:     at com.kbeanie.multipicker.core.threads.FileProcessorThread.run(FileProcessorThread.java:78)

05-30 12:29:31.454 8919-16067/com.harmankaya.otokolik W/System.err:     at com.kbeanie.multipicker.core.threads.ImageProcessorThread.run(ImageProcessorThread.java:41)

05-30 12:29:31.504 8919-8919/com.harmankaya.otokolik I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@39102373 time:475973932

05-30 12:29:31.629 8919-16067/com.harmankaya.otokolik D/FileProcessorThread: copyFileToFolder: folder: Pictures

05-30 12:29:31.629 8919-16067/com.harmankaya.otokolik D/FileProcessorThread: copyFileToFolder: extension: null

05-30 12:29:31.629 8919-16067/com.harmankaya.otokolik D/FileProcessorThread: copyFileToFolder: mimeType: null

05-30 12:29:31.629 8919-16067/com.harmankaya.otokolik D/FileProcessorThread: copyFileToFolder: type: image

05-30 12:29:31.634 8919-16067/com.harmankaya.otokolik D/FileProcessorThread: copyFileToFolder: Out Path: /storage/emulated/0/Otodyo!/Otodyo! Pictures/IMG_9998.jpg

05-30 12:29:31.634 8919-16067/com.harmankaya.otokolik D/FileProcessorThread: processFile: Final Path: Type: image, QueryUri: content://com.amazon.drive.fileprovider/original/v9c8Y9AJQqyabGWWKe5HZw/32f7eec06a5e30158153e817927f131f/IMG_9998.jpg, Original Path: /storage/emulated/0/Otodyo!/Otodyo! Pictures/IMG_9998.jpg, MimeType: null, Size: 4.7 MB Height: 0, Width: 0, Orientation: UNDEFINED

05-30 12:29:31.634 8919-16067/com.harmankaya.otokolik D/ImageProcessorThread: postProcessImage: null

05-30 12:29:32.269 8919-16067/com.harmankaya.otokolik D/ImageProcessorThread: postProcessImage: Type: image, QueryUri: content://com.amazon.drive.fileprovider/original/v9c8Y9AJQqyabGWWKe5HZw/32f7eec06a5e30158153e817927f131f/IMG_9998.jpg, Original Path: /storage/emulated/0/Otodyo!/Otodyo! Pictures/IMG_9998.jpg, MimeType: null, Size: 4.7 MB Height: 2848, Width: 4272, Orientation: NORMAL

05-30 12:29:32.274 8919-8919/com.harmankaya.otokolik D/MainActivity: FILEPATH: null`

java.lang.OutOfMemoryError

Using a Motorola E2, O.S. v5.0.2, downloading a big file (i.e. a nasa file), then selecting it with the picker, and setting the options

imagePicker.ensureMaxSize(1090, 1090);

It however crashes on line 587 of FileProcessorThread on the method:
protected ChosenImage ensureMaxWidthAndHeight(int maxWidth, int maxHeight, ChosenImage image)
line:
bitmap = BitmapFactory.decodeStream(scaledInputStream, (Rect)null, e);
with an outOfMemoryException, is this the expected behaviour?

Configuration to auto correct orientation?

Is it possible to configure the picker to return the image with orientation already corrected? I tried loading the same files with the test app and all of them is showing the orientation correctly, but when I load it in my app it is showing the incorrect orientation (compare to opening it in gallery). Do we have to rotate them manually using the exif information provided? How did the test app do that?

Thanks.

Photo directory

Showing directory containing image with scaled with original image.
app name/appname_pictures(path of directory).
cameraPickerProfile.shouldGenerateMetadata(false);
cameraPickerProfile.shouldGenerateThumbnails(false);
after setting above lines still generating folder .
Is there any another way to stop creating the folder.

Minimum SDK too high

Is it possible to change the minimum SDK to something a bit older? I would really love API 10! Thanks for everything

FileUriExposedException

When I use CameraImagePicker pickImage() on Android 7.0 (N) on Nexus 5x, with an app targeting/compiling SDK 24, I have

D/ImagePickerImpl: Temp Path for Camera capture: /storage/emulated/0/AppName/AppName Pictures/061aafec-0acd-488d-b8b0-c7d5fb8c152a.jpg
E/FileUpload: <AppNameFilesChooser.java:151> FileUriExposedException: android.os.FileUriExposedException: file:///storage/emulated/0/AppName/AppName%20Pictures/061aafec-0acd-488d-b8b0-c7d5fb8c152a.jpg exposed beyond app through ClipData.Item.getUri()
W/System.err:     at android.os.StrictMode.onFileUriExposed(StrictMode.java:1799)
W/System.err:     at android.net.Uri.checkFileUriExposed(Uri.java:2346)
W/System.err:     at android.content.ClipData.prepareToLeaveProcess(ClipData.java:832)
W/System.err:     at android.content.Intent.prepareToLeaveProcess(Intent.java:8909)
W/System.err:     at android.content.Intent.prepareToLeaveProcess(Intent.java:8894)
W/System.err:     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1517)
W/System.err:     at android.app.Activity.startActivityForResult(Activity.java:4224)
W/System.err:     at android.support.v4.app.BaseFragmentActivityJB.startActivityForResult(BaseFragmentActivityJB.java:48)
W/System.err:     at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:75)
W/System.err:     at android.app.Activity.startActivityForResult(Activity.java:4183)
W/System.err:     at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:871)
W/System.err:     at com.kbeanie.multipicker.core.PickerManager.pickInternal(PickerManager.java:147)
W/System.err:     at com.kbeanie.multipicker.core.ImagePickerImpl.takePictureWithCamera(ImagePickerImpl.java:145)
W/System.err:     at com.kbeanie.multipicker.core.ImagePickerImpl.pick(ImagePickerImpl.java:118)
W/System.err:     at com.kbeanie.multipicker.api.CameraImagePicker.pickImage(CameraImagePicker.java:74)
...

CameraImagePicker returns 1 image when exit

CameraImagePicker cameraPicker;
cameraPicker = new CameraImagePicker(this);
cameraPicker.shouldGenerateMetadata(false);
cameraPicker.shouldGenerateThumbnails(false);
cameraPicker.setCacheLocation(CacheLocation.EXTERNAL_STORAGE_APP_DIR);
cameraPicker.setImagePickerCallback(imagePickerCallback);
pickerPath = cameraPicker.pickImage();
private ImagePickerCallback imagePickerCallback = new ImagePickerCallback() {
        @Override
        public void onImagesChosen(List<com.kbeanie.multipicker.api.entity.ChosenImage> list) {
            if (list.size() > 1) {
                for (com.kbeanie.multipicker.api.entity.ChosenImage chosenImage : list) {
                    mFilePath = chosenImage.getOriginalPath();
                    // do something
                }
            } else if (list.size() == 1) {
                // do something with 1 image
            }
        }

        @Override
        public void onError(String s) {
            Log.e(TAG, "ImagePickerCallback onError: " + s);
        }
    };

Once the camera activity is started, clicking the Back button will still get a file path. (list.size() == 1)

Duplicate images

When use CameraImagePicker, create 3 files with different names like:
.jpg
-1.jpg
-1-1.jpg

I think the problem is on generateFileName function

How to submit data inside DialogPreference

Hello,

I really like the multipicker library and tried to use it inside a custom DialogPreference. Unfortunately after selecting a photo I found out that the ImagePickerCallback is never triggered. On the wiki page I read that one need to submit data to imagePicker in onActivityResult().

This method is not available inside DialogPreference. What can I do about this? Is there a workaround or is it not usable inside DialogPreference? Maybe an interface method which can be implemented?

Thank you very much in advance.

Mike

Fatal Exception: java.lang.RuntimeException: Unable to resume activity

I don't shure exactly, maybe it's problem in my code, but in method
onActivityResult(int requestCode, int resultCode, Intent data) data = null and application crash with exception
Fatal Exception: java.lang.RuntimeException
Unable to resume activity {com.olodroid.meme/com.olodroid.meme.MainActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=68647, result=-1, data=Intent { act=com.htc.HTCAlbum.action.ITEM_PICKER_FROM_COLLECTIONS dat=content: typ=image/jpeg (has extras) }} to activity {com.olodroid.meme/com.olodroid.meme.MainActivity}: java.lang.NullPointerException

Full log:
Fatal Exception: java.lang.RuntimeException: Unable to resume activity {com.olodroid.meme/com.olodroid.meme.MainActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=68647, result=-1, data=Intent { act=com.htc.HTCAlbum.action.ITEM_PICKER_FROM_COLLECTIONS dat=content: typ=image/jpeg (has extras) }} to activity {com.olodroid.meme/com.olodroid.meme.MainActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3321)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3359)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2658)
at android.app.ActivityThread.access$800(ActivityThread.java:156)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1355)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5872)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:674)
at dalvik.system.NativeStart.main(NativeStart.java)
Caused by java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=68647, result=-1, data=Intent { act=com.htc.HTCAlbum.action.ITEM_PICKER_FROM_COLLECTIONS dat=content: typ=image/jpeg (has extras) }} to activity {com.olodroid.meme/com.olodroid.meme.MainActivity}: java.lang.NullPointerException
at android.app.ActivityThread.deliverResults(ActivityThread.java:3942)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3295)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3359)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2658)
at android.app.ActivityThread.access$800(ActivityThread.java:156)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1355)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5872)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:674)
at dalvik.system.NativeStart.main(NativeStart.java)
Caused by java.lang.NullPointerException
at com.olodroid.meme.fragments.FragmentUserTemplate.onActivityResult(FragmentUserTemplate.java:184)
at android.support.v4.app.FragmentActivity.onActivityResult(FragmentActivity.java:176)
at android.app.Activity.dispatchActivityResult(Activity.java:5535)
at android.app.ActivityThread.deliverResults(ActivityThread.java:3938)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3295)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3359)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2658)
at android.app.ActivityThread.access$800(ActivityThread.java:156)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1355)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5872)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:674)
at dalvik.system.NativeStart.main(NativeStart.java)

com.olodroid.meme.fragments.FragmentUserTemplate.onActivityResult(FragmentUserTemplate.java:184)
in code
picker.submit(data);

The error occur when file name contain (+) character

The error occur when file name contain (+) character after the selection of file

The original file name is Capture+_2016-03.png

Unable to decode stream: java.io.FileNotFoundException: /
storage/emulated/0/TestApp/TestApp-Pictures/Capture _2016-03.png: open failed: ENOENT (No such file or directory)

Custom request code for Intent

Hi,
I have an Activity with three buttons I just want to handle captured events for each button.
But am anot able to set request code. And am getting request code same for every click though I have created seperate ImagePicker and their callback. So how can I handle seperate three imagePicker callback.

Thanks

NullPointerException

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()' on a null object reference at com.kbeanie.multipicker.utils.FileUtils.getAppName(FileUtils.java:55) at com.kbeanie.multipicker.utils.FileUtils.getExternalFilesDirectory(FileUtils.java:37) at com.kbeanie.multipicker.core.threads.FileProcessorThread.getTargetDirectory(FileProcessorThread.java:490) at com.kbeanie.multipicker.core.threads.FileProcessorThread.getTargetLocationToCopy(FileProcessorThread.java:553) at com.kbeanie.multipicker.core.threads.FileProcessorThread.copyFileToFolder(FileProcessorThread.java:143) at com.kbeanie.multipicker.core.threads.FileProcessorThread.postProcess(FileProcessorThread.java:130) at com.kbeanie.multipicker.core.threads.FileProcessorThread.processFiles(FileProcessorThread.java:106) at com.kbeanie.multipicker.core.threads.FileProcessorThread.run(FileProcessorThread.java:79) at com.kbeanie.multipicker.core.threads.ImageProcessorThread.run(ImageProcessorThread.java:41)

Duplication

it is duplicating file with .mpeg extension and chosen file also get a .mpeg extension

Image File Name

The filename used for saving images into new folder is based on the image name. Problem arises when two different images of the same name from two different folders gets saved into the folder. It will override the old image.
Another problem is if we use any image loader with caching mechanism, it will show old image instead of the new image.
I suggest to use timestamp as the name of the new image to prevent this problem.

PDF

How can I have a picker for mime type: PDF on all APIs. I'm using application/pdf and it works on api 21+. What about pr-lollipop? is it supported at all?

Pick Image from gallery

Custom request code with camera picker works fine. but
setting custom request code for gallery pick am not getting that request code in onActivityResult.

ImagePickerFragment CameraPicker

Referring to ImagePickerFragment:

public void takePicture() {
        cameraPicker = new CameraImagePicker(this);
        cameraPicker.shouldGenerateMetadata(true);
        cameraPicker.shouldGenerateThumbnails(true);
        pickerPath = cameraPicker.pickImage();
    }

Missing
cameraPicker.setImagePickerCallback(this);

Crash when selecting photo ( Android 6.0.1 Samsung Note 4)

Here the error stacktrace.

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'char[] java.lang.String.toCharArray()' on a null object reference at java.io.File.fixSlashes(File.java:183) at java.io.File.<init>(File.java:130) at com.omnom.fragments.pages.PageTakeMedia.onImagesChosen(PageTakeMedia.java:422) at com.kbeanie.multipicker.core.threads.ImageProcessorThread$1.run(ImageProcessorThread.java:52) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:158) at android.app.ActivityThread.main(ActivityThread.java:7225) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

i am using plugin version
compile 'com.kbeanie:multipicker:1.1.0@aar'

android.os.NetworkOnMainThreadException

When load image from Picassa gallery on android 4.1.2 application crash wit error:
android.os.NetworkOnMainThreadException
at com.kbeanie.multipicker.core.threads.ImageProcessorThread$1.run(ImageProcessorThread.java:49)
Uri returned in onActivityResult - content://com.sec.android.gallery3d.provider/picasa/item/5545697766928513266

I get resource not found while it tries to fetch App Name

I get Resource not found after picking the pic from gallery!!!
on further debugging i found the library was crashing on a very simple thing , which was when it was trying to fetch app name from ApplicationInfo ,
funny part was ur sample app works seamlessly on my phone and blue stacks
but ur library integrated crashes...!!
wat is the best solution u propose ..!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.