I read the developer docs on how to use existing Camera software on the device to take a picture and return to the app here and I was confused by the fact that when simply grabbing a thumbnail, they use the following intent code
startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE);
however, when taking a picture and saving the full file, they use:
startActivityForResult(takePictureIntent, REQUEST_TAKE_PHOTO);
At least for me, REQUEST_TAKE_PHOTO can not be resolved, and I cant find any reference to it anywhere. Anyone know what the differences are between the two?
There is nothing extra which you need to do to capture burst shots. Whichever smartphone you are using, just open the in-built camera app. -- Open the camera app, press and keep holding the shutter button. -- This automatically activates the Burst Mode and clicks multiple photos until you release the button.
Run the application on an Android phone. Selecting "Take photo" will open your camera. Finally, the image clicked will be displayed in the ImageView. Selecting "Choose from Gallery" will open your gallery (note that the image captured earlier has been added to the phone gallery).
The Android Camera application encodes the photo in the return Intent delivered to onActivityResult() as a small Bitmap in the extras, under the key "data" . The following code retrieves this image and displays it in an ImageView . Note: This thumbnail image from "data" might be good for an icon, but not a lot more.
REQUEST_TAKE_PHOTO can not be resolved
While they have a typo in their source, they do show where they define that integer. Scroll down to the last code snippet in the "Save the Full-Size Photo" section.
Anyone know what the differences are between the two?
In the code presented on that page, there is no difference between the two, as they are both defined to be 1
. This is sloppy example. :-(
In general, if one activity calls startActivityForResult()
for two or more distinct requests, you will want to use different numeric values for the requestCode
. Both results will be delivered to the same onActivityResult()
method implementation, and you use the requestCode
to distinguish one result from another.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With