The Uri object is a wrapper of the picture file path. So you should tell the camera app the folder path by using a Uri object. The camera app is responsible for saving the pictures in the above folder.How To Save Those Pictures In Above Folder. All the temporary camera-taken pictures will be saved in this folder. So the app-specific cache folder will be /storage/41B7-12F1/Android/data//cache. But for some Android devices such as Hua Wei mate 8, the root directory ( /sdcard) has been linked to ( /storage/sdcard1) and then link to /storage/41B7-12F1, we can see it in the Android Device Monitor -> Devices ( left side) -> File Explorer tab window (right side). But generally external storage root folder is /sdcard, /mnt or /storage. Different Android devices may use different root folders.Environment.getExternalStorageDirectory() You can use the below code to get the android device external storage root folder.We save all the pictures in the app external storage cache folder in this example.If you run this example in the android emulator, you will find below exception be thrown.Ī: No Activity found to handle Intent 2.Before you can run it on a physical device, you need to enable USB debugging mode in the physical device, Please read the article How To Enable USB Debugging Mode On Android Device to learn more.You need a physical android device that has a camera. You can not run this example in the android emulator.You can take several images, then when you click one image, it will show the next image in the camera taken images list. When you close the camera, the picture will be displayed in the image view object under the button.When you click the button, the android camera app will pop up, then you can take pictures with it. There is one Button and one ImageView on the screen. If you can not watch the above video, you can see it on the youtube URL
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |