The following is the first few sections of a chapter from The Busy Coder's Guide to Android Development, plus headings for the remaining major sections, to give you an idea about the content of the chapter.
Letting third-party apps take the pictures and videos for you is all well and good, but there will be times where you need more control than that. It is possible for you to work directly with the device cameras. However, doing is exceptionally complicated.
Part of that complexity is because Android presently has three separate APIs for working with the camera:
android.hardware.Camerafor taking still photos
android.hardware.camera2for taking still photos on Android 5.0+ devices
MediaRecorderfor recording videos
This chapter will attempt to outline the basic steps for using these APIs.
This chapter assumes that you have read the previous chapter
Intent-based uses of the camera and
the chapter on audio recording.
The code snippets shown in this chapter are here purely to illustrate how to call certain APIs. They are not from any particular sample project, as a sample project small enough to fit in a book would be riddled with bugs and limitations.
The preview of this section is en route to Mars.
The preview of this section is unavailable right now, but if you leave your name and number at the sound of the tone, it might get back to you (BEEEEEEEEEEEEP!).
The preview of this section was the victim of a MITM ('Martian in the middle') attack.
The preview of this section was lost in the sofa cushions.