Android: Want camera in your app?

So why not use the camera that already exists in your Android Phone!

First put the following in AndroidManifest.xml before the <application…></application> tag

Then go to the MainActivity class or wherever you want to call “Camera opening function”. Add the following function:

  1. Here, startCamera is a function called when a button is pressed.
  2. The default camera app of your phone opens and you will have all the advanced features without any work.
  3. Done 😀

 

Liked it? Take a second to support codeonion on Patreon!

Leave a Reply

Your email address will not be published.