Chapter 6. Capture and Share

We love to share the world we live in with others, so we will use our smartphones to take images or videos of all the things and all the people we care about. With Android, this is pretty easy.

In this chapter, you will learn about the following:

  • Capturing images the easy way
  • Image capturing using the Camera2 API
  • Image sharing
  • Orientation issues

Introduction

As a developer, you can just launch an intent, grab the data, and do with it whatever you want.

Things become a little bit more complicated if you want to handle image or video capturing yourself. So, why would someone want to do that in the first place? It gives us more flexibility in the way the camera is being previewed, filtered, or handled.

With Android Lollipop onwards, the old Camera API that we had been using has been replaced with the Camera2 API, which has turned out to be a huge improvement. Unfortunately, some orientation issues remain, mostly due to the large fragmentation of Android hardware and software. On some devices, captured images seem to be rotated 90 degrees. Why is that? You will find out in the last recipe in this chapter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset