I have to create functionality for an application where I have to take pictures and save it to a SQLite database. I have implemented the camera for now using the camera intent in android, but the image gets saved to the gallery. I have read the Camer2 and CamerX API documentation and the image still gets saved to a device folder. Is there any way to avoid this?
You can checkout https://stackoverflow.com/a/64651558/277368 on how to get in-memory image with CameraX. Then you need to serialize the image and save it to SQLite on your own.
Related
i am using the cordova camera plugin and saving images to the gallery/photos so they don't delete as prior to this my photos would be saved to the cache and delete quickly enough.
I attach the images i take and save with camera plugin to an email.
What i do is save the ImageURI from the camera function to localstorage to be called again if i resend the email at a later date.
This method works in the short-term and images attach successfully but not after a few hours.
The imageURI of captured images is usually on the format of cdv_photo_001.jpg for example.
However, the images are saved in photos/gallery and the filenames tend to be normal "IMG_0001.JPG" format and don't attach to the email.
is there a way i can get the actual gallery name while taking a picture.
Ive tried to save the image persistently using some guides but i could never get the moveTo to work.
Anyone any ideas?
Thanks
Actually I am developing an android application to to store images after capturing the images from camera intent and need to display those saved images from the database?I stored the images in Blob format...
It's not recomended to save images into the database. The Blob format is good for storing amorphous data, but you need to do some serious tricks to convert it back into a Image format.
However, might we suggest instead to save the image on the local storage and store in the database only the identifier for the image?
I am working on an Android app where I have customized the camera. Now I want to delete all the images from the gallery that have been clicked once they have been uploaded in the server. This has been done successfully. However I am not sure whether they are retained in Android's own database. Can anyone please tell me how to see if the image data are saved anywhere in Android's own database once they have been deleted from the picture gallery as I need to take care of this as well.
The device is Samsung Galaxy III. I developed an APP to run the camera activity and capture an image. After analyzing the image, I print out some text information. Right now every captured image is saved at gallery. I don't need the image to be saved in gallery or SD card. I think either of the following two solutions will work for me, but I don't know how to program it:
avoid saving pictures to gallery.
delete the picture somewhere in the APP.
Any comments are appreciated.
Read Android Camera tutorial.
...
Storage - Are the images or videos your application generates intended to be only visible to your application or shared so that other applications such as Gallery or other media and social apps can use them? Do you want the pictures and videos to be available even if your application is uninstalled? Check out the Saving Media Files section to see how to implement these options.
or see this one: How to save image captured with camera in specific folder.
In the Camera intent when starting, add this:
intent.putExtra(MediaStore.EXTRA_OUTPUT,Uri.fromFile(getTempFile(context)));
I solved my problem with following two steps:
as '#auselen' pointed, save all the images to a specific folder. How to save image captured with camera in specific folder.
delete all the images in that folder somewhere in the APP. How to Delete Image From SDCard in Android
use this for delete a pic
ImgPhoto1.setImageBitmap(null);
for my android application,I need to take a photo with the built-in camera and save it to a database in a blob field.
I can take a photo and save it to a blob field, but the device also saves the photo local. To avoid the device filling with photos, I don't want to save the photo local on the device, only in the db.
I'm using Android 2.3.3, my test device is a Samsung Galaxy S II with default photo-application.
How can I do this?
Thanx,
Robby
You could write an own Activity to take the pictures.
http://developer.android.com/reference/android/hardware/Camera.html
As I read you don't have to save your pictures there.
After capturing photo using camera you can store the image in database using blob file. After storing in database is done you can delete the photo from that path.
Thanks
Deepak