I want to ask whether the built-in camera to take photos and change the name in a specific folder.
Usually, we call this code to start built-in camera.
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE );
startActivityForResult( intent, 0 );
At onActivityResult(), we get the bitmap we just take and save it under a specific photo. As i know, it works for a single photo. However, if user takes many photos, can i get a list of these photo name??
Thanks all.
Each time a user takes a photo you must save it (under "onActivityResult()") with a different name so the last capture does now overwrite the previous. One easy solution is to concatenate in the photo name a timestamp so the photo name will become unique and it will be saved as a new photo.
If you want to get the list of those photos saved, you can use this example "android-coding.blogspot.gr/2011/10/list-filesdirectory-in-android.html"
Related
I have a class with a variable named Photo. The user is using the PhotoChooserTask to select the photo, and it is being displayed in an Image control. This part of the application, the chooser and display, works fine.
I would like to save either the location/path of the chosen photo or the actual photo so that it will be available for display into an Image control when the user ran the application later.
The whole class is saved using serialization, and I don't know how to save/serialize the photo (or the photo path) that way.
The photo should be still available to the user through the Camera Roll as well.
Any help, link or code, would be greatly appreciated.
If you're using a PhotoChooserTask you will will get a PhotoResult instance from the PhotoChooserTask.Completed event.
You can then PhotoResult.ChosenPhoto stream and save the content to a byte array (easy serialization) or a file in Isolated Storage.
I have created FB app in that i need Camera option. of course i want 3 buttons, one to take a picture and 2nd to save and Main thing is 3rd button that is to directly upload images to facebook without saving to specified location im Mobile. I searched a lot but cant get like this.So please help me out. Thanks in Advance
Is there a way to launch the camera app programmatically, from my own app? I know that you can use one of the tasks to launch it, allowing the user to take a single photo, but I want the user to be able to take multiple photos. The user could then just hit the back button to go back into the app. I could then track which ones were new by the date/time they were taken.
Jeffrey, you can use CameraCaptureTask class to launch the camera application. More info here
With this class you can take advantage of the camera, to take multiple pictures or something else. You need to manipulate the Completed event.
Hope it helps :)
There is great article here that guides you to the entire process of adding a camera to your app. It even allows you to take multiple images, rename them and saves them to the Camera Roll of your phone.
You could then use the DateTime class to add the date and time of the photo to the photo name (along with the name of your app), thus allowing you to better track the images taken.
I am using Instagram API and I need to get the original click date of the photo. Currently Instagram API give me the date the photo was uploaded to Instagram, but not the original click date. This an issue since it changes the meaning of the actual context of the photo.
Is there a way I can get the original date on which the photo was taken?
Isn't it the original click date and uploaded date same when then photo is clicked from inside the app? And if you are allowing a feature to add photos from gallery then there is no original photo only its instagrammed version exists.
ie: The original photo is stored in gallery location and the new photo after editing is stored in instagram folder or app folder.
The is no relation between the original and edited photo. So getting the date of creation of one file from another unrelated file is impossible.
You can not get the date date the photo was taken :-(
Instagram does not expose it via their api.
In my opinion this is short sited from instagram.
The date taken is stored in the image.
It can not be that difficult the save the correct date from the image, all the info is there.
I`m geting the following problem.
Using graph api I can create an album (exactly photo album of my app). There is no problem also to upload photo to already created album (I have aid of this album as result of previous operation). After uploading photo I get also pid of the photo.
The problem starts now at the moment when I would like to get photos of the album. Graph API returns an empty array. Also I don't see any new album when I go to app page. However if I go to wall of my app page, I see this photo on "last added photos" list. I can enlarge uploaded photo, and I even see info that it's located in the proper album. There is another wird thing. If I choose this album, Facebook notice me that it`s an empty album.
I doesn't mean those operations are not done well, because if I request for a particular photo using pid (which I know from upload photo operation) I get a proper result - photo exist. Unfortunately it's really uncomfortable to store all pids of album in data base and perform separated request to each of it.
If the Facebook App is in "sandbox" mode, the images will only be visible to the admin/developers/tester users. Public users will not see the images.
Turning sandbox mode off fixed this issue for me.