Android create hidden picture activity using timer ,background save to sd card - android

I know using intent you can save jpeg from camera to sd card .
I need assistance :
I want to create a Timer that saves appends a jpeg from the camera at a certain specified interval to sd card .
I also want to create a function that automatically uploads the jpeg on new append to my webserver..
any assistance will be really appreciated basic idea is to . capture jpg on intervals and every pic saved to be auto uploaded to webserver.

Related

Cordova camera changes filename after saving to gallery on iOS

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

Tracking an image after adding to media scanner (when an user selects it from the gallery)

I have an app that allows users to take images from their camera that get saved to the SD card and I run the media scanner on it so they are visible in the gallery. Users can also add images from the gallery.
I do some compression on the image before saving to SD card. So, when a user selects an image from gallery, if it was an image that was compressed and written by my app, I want to avoid it from getting compressed again. I was thinking of checking the image path to figure out if the image was from my app, but with URIs, I get strings like content://com.android.providers.media.documents/document/image%3A38691 and uri.getPath() doesn't seem to have the path.
What are my options to figure out if this image was from my app? Here are the things I can think of:
1) Uri uri = Uri.fromFile(file): This seems to be giving a value of file:///storage/emulated/0/Pictures/MyApp/image.jpg
2) Store a checksum of the data when I write to the SD card and check against this when I see the new image.
3) Somehow get the URI when the media scanner is run. Haven't figured out how to do this yet.
UPDATE: for option (3), looks like I can use a MediaScannerConnectionClient. Is this the best option? Store the path to URI mapping in a DB and refer to that each time the user adds a new image to my app from the gallery.

capture camera image but not save a file

Is it possible to capture a camera image and use it in my code, but not have the image saved on the device? I need the image for sending to an API, but I have no need for the user to have the file afterwards. Can this be done?
This is not a good idea, as there is too much overhead when handling the full size image in RAM.
I would personally just create a scaled down preview to put in UI(if needed), then upload original(saved on SD) image and delete afterwards.
Some devices will force the images into the gallery.
This will help you with said problem
Here is my edited answer in regard to how i would do it.
Save image to disk and ensure it is encoded correctly for the API you are using.
Start upload service when network connection is available (if necessary).
Either delete image from service or schedule an Alarm to start service and deal with it later
if u r using native camera activity
capture the image on file
get the bitmap of the image from the file
delete the file
(u can save the image in hidden directory {{its name should start with dot .hidden_dir/myimg.jpg }} )

How to update images or save new images in web in Android

I am getting data from server, it works fine.Image successfully getting display with application. But, Now I want to take new photo from camera or from SD card and update that images which is getting from web.Here , Image must be save on server and replace old web images to new photo that is take from camera or SD card.
I did not have much more idea behind this trick, could you please give me basic idea.How to update current images to new images.

How to avoid saving picture at gallery or delete it automatically in Android?

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);

Categories

Resources