I tried this. Perfect work on almost devices.
But doesn't work at Samsung Galaxy 3.
On normal device i have something like content://media/external/images/media/1 in intent.getData() and after using getContentResolver() i have /mnt/sdcard/Android/data/package/.../file.jpg
But on Samsung Galaxy 3 in intent.getData() i have content://com.sec.android.gallery3d.provider/picasa/item/5624862738518543714 and https://lh5.googleusercontent.com/-22xcQIWrlT4/Tg-G29-6jWI/AAAAAAAAAJA/i_FUO3pN1Sc/I/%2525D0%252597%2525D0%2525B0_%2525D0%2525B5%2525D0%2525B4%2525D1%252583.jpg after using Resolver.
What should i do to get normal path on Samsung Galaxy 3?
UPD: i see, in gallery there is available to pick pictures from my Google+ shared pictures. Hm...
So, i think, i will show message for users in this case to pick only local files.
Related
Installed expo-image-picker, calling launchImageLibraryAsync. This works completely fine on Emulator.
On a real android device (Samsung A3, API 24), and picking images from the Library, I sometimes get an error Uri lacks 'file' scheme: content://com.android.provider.media.documents/documents/<imagename..>.
My understanding is that it's images which have been saved NOT by the device camera, e.g. whatsapp, other apps using the camera. Images which were taken on the device camera work OK and have a local path.
Is there a known way to deal with this? I can't seem to stop the user seeing/picking these images, and can't pass in any options to ignore this error (or fail gracefully if multiple images are selected and only 1 fails). Currently we just catch and give a generic error which is a bit mmm.
Ive got a problem with react native app on android. It's like a gallery, so i need to show many images. First i'm fetching data about urls of images, then i`m trying to render them. Almost all images are downloading, but not all of them. How can i solve this problem? Thanks.
Some images are pretty big, but summary size of them less than 1 gb.
Before asking I was trying to launche app on my Samsung Galaxy s4 and emulated Galaxy s6. On emulated device situation is even more bad.
Okay so here's a problem I have.
setRotation() should rotate a captured JPEG image. It works fine on most phones, but somehow doesn't work on Samsung Galaxy S3 and S4.
Here's a question with a proposed soluton:
setRotation(90) to take picture in portrait mode does not work on samsung devices
It involves manipulating the EXIF data, however, the ExifInterface() being used, requires the image to be saved to the phone, and then it uses the absolute file path.
However, I don't want to save the image to the phone, that's one of my main criteria. Any idea, on how to go about this issue?
I have code that gives me back a path to store my video file which basically produces a path that looks like this:
/storage/sdcard0/Pictures/MyApp/MyApp20130816_144111_1131938614.mp4
When I try to capture the video on my S2, I take the video and press stop the camera my camera app does not display the normal save screen, it just puts itself back into the beginning of capture mode and onActivityResult is never called. I've found that if I do not pass a path to MediaStore.EXTRA_OUTPUT it functions correctly.
I've tested my code on Note II, GS3, GS4, Nexus and they all seem to be able to capture the video and save it to the correct path with no problems. Why would the S2 be behaving this way?
Something about the galaxy s2 doesn't like /storage/ maybe?
Never hardcode paths. Always use methods like Environment.getExternalStoragePublicDirectory() to get the root of where to store files on external storage. Different devices, and even different users on the same device (Android 4.2+ tablets) will have different paths for external storage.
However, the point in my initial comment still holds. You as a developer are not "using the default camera app as installed on the galaxy devices". You as a user may be using that particular app. There are nearly a billion Android device users; you are not all of them. They are welcome to use whatever camera app they want to, including third-party ones. And, they will be using thousands of Android device models. None of them will necessarily honor your request to take a picture. It's certainly worthwhile for you to do testing to try to work more faithfully on more devices (such as not hardcoding paths), but you need to bear in mind that any time you ask another developer's app to do work for you, the other developer is control of what happens, much more than you are.
I am trying to modify image loaded from system gallery and save new version of that image on SD card.
Problem is that saved image is placed at the end of gallery (tested on branded Galaxy Ace 2 and CyanogenMod 7 on Galaxy Ace).
Any idea what is responsible for position of newly saved image?
I've tried even get code from CyanogenMod, but it didn't work.