I'm having problem saving jpg and png images on internal memory on Android Lollipop. I'm using a simple application that download (directly or asynchronously) an image from URL an show it on imageview and than it's possible to save it in the internal memory previous create an album on image gallery. The problem is that download the image, after it show it inside imageview but it does not save in the internal memory. It show that it save a file with the right name inside the new album but the file has 0.00 bytes. The app work fine in kit kat. I'm trying with this sample because I'm running the same problem in another app that, as the sample do, works fine in kit kat and does not in lollipop.
Related
I am working on something which includes image upload loading. User can set the image or document size in bytes from the web end and then user can upload any image or document up to that particular size.
For testing purpose I have set the limit "39000" bytes on web end and downloaded a sample image from internet size 39kb(39000) on my Android phone , Emulator and on system (Windows).
When I upload that image from web it gets successfully uploaded but from Android Mobile and Emulator I get the error that image size limit is exceed.
I have checked image details on all the platform. I don't understand when the image of 39Kb is downloaded on emulator or on android device why its size gets increased.
I am attaching the screenshot sizes along with the link of image.
https://sample-videos.com/download-sample-jpg-image.php
I am working on android app which capture Images and send it to server when internet available then delete these images
every thing works fine but when when capture image app size increase and when delete it app size still same
to understand me
suppose that app size when install it is 9MB
then I capture Image with size 5MB
then app size Increase to 14MB
then delete Image
then app Size should be 9MB Again
but that not happened it still 14
and when take another image size increase and increase ..
Any Help How to maintain app Size ?
You should delete cache files ..
Because if you're uploading to server , then you must delete the catch file also along with the original file .
Please check the below link , for how to clean cache files .
Clear Cache in Android Application programmatically
I have a multi platform app - iOS and Android.
One of the features in the app is to capture images. I have a toggle switch in the app settings which allows the user to save the image to the device picture album if the switch is enabled.
This is an issue I can only produce in Android. Even without the toggle switch enabled, the captured photos still save to the device. I have tested this on Android 4.4.2 and 6.0
It does not do this in iOS.
There is nothing in my code to suggest that the photo should still be saved, I have checked it over and over.
Has anyone else come across this? If so what can be done to rectify the issue?
Thanks,
This is simply how FireMonkey captures images on Android. It saves a captured image to a file before handing the pixel data to you. And it does not provide access to the captured image's filename so you can remove the file afterwards.
FireMonkey has an IFMXCameraService interface with a TakePhoto() method, which accepts a NeedSaveToAlbum option:
Taking Pictures Using FireMonkey Interfaces
However, it is currently broken on Android:
RSP-13118: [Android] TTakePhotoFromCameraAction saves Image on Disk unexpectedly
RSP-15820: IFMXCameraService TakePhoto , NeedSaveToAlbum False not working
Until that is fixed, you could use JNI to access Android's camera APIs directly, then you can do whatever you want with the images.
I'm following this tutorial http://developer.android.com/training/camera/photobasics.html
to capture photos and save them to the external storage.
Images are captured and saved successfully but the image size file is zero bytes.
The strange thing is that I can still open the file with the stock gallery app, but when copying the image file to the PC, I can't open it with any image viewer.
What can be wrong here? I'm testing on a Samsung Galaxy Nexus.
Change the directory to save the captured images and copy the saved image and paste it in another directory in mobile itself.
OK, found what was wrong. I left the phone for a couple of hours and returned to check the files and surprisingly I found them with their proper files.
Not sure what's the reason for this, I tested the same code on a Samsung S3 and it worked fine, maybe this happens on slow old phones like the Galaxy Nexus.
Is there a way to save an image to the camera roll directory directly? I was using CameraRoll.addBitmapData() call but that converts the bitmapData to a JPEG and all transparency is lost. And also, the image is being heavily compressed. So I would like to save a PNG with transparency to the camera roll directory.
I'm using Adobe AIR 3.6 and testing on Android 4.latest on a Google Nexus 7.
So I'm able to save an image to the camera roll successfully! The problem now is the native Android Image Gallery app doesn't recognize any images I put there except if I restart the device. It also has a problem with thumbnails (they show a different image or are simply a black background).
Here's what I found:
DCIM – This folder is for Photos and contains another folder named Camera which contains all of the photos and videos taken by the phone’s camera (Created by the OS)
Download – Will be automatically create as needed for downloaded files. Source
Pictures - Not sure.
What doesn't work
Image Gallery doesn't reflect new images added to the directory until the device is restarted. The thumbnails are also incorrect as I stated above.
I've noticed in the Camera directory there is a .ds_store type of file and another directory for thumbnails. Other directories besides DCIM / Camera do not appear to have this file.
UPDATE
I found out that it's a known issue that the camera roll does not refresh! If it is an AIR only problem or not I don't know. But there is an extension to refresh the image gallery after you add the image. http://extensionsforair.com/extensions/refresh-gallery/. I haven't tried it.
Other posts...