Repeating taking a photo automatically

I looking to write a simple app that is when the user button that does the following:

  1. Has a simple button marked “Start”
  2. Camera in preview mode - no button required to take picture
  3. UI to allow adjustment of camera options i,e, focus, white balance

When the user presses the Start button the following loop happens

  1. Set n=1
  2. Take photo and save locallyas “pic - n”
  3. Perform other processing actions
  4. Go to (2) and repeat loop 20 times
  5. Save photos to cloud provider

Can anyone give me guidance on how to do the camera part?