4

I am writing code to auto backup sdcard photos to the cloud (the project is on the github) When click backup button, the app will load all photos on sdcard and upload them to the cloud. But after that if user take new photos by camera, the app takes no action because it does not notified. So my question is does android broadcast when taking photos using camera?

Below is the requirement:

  1. When user take new photos, backup the new photos immediately

  2. if the app closed and user take new photos after, when restarts the app, detect the new photos and backup

any advice or solutions or material to help to implement the function will be appreciated.

Logan Guo
  • 865
  • 4
  • 17
  • 35
  • To resolve question 1, I plan to user android system broadcast if it supports. To resolve question 2, I plan to user a container to hold all backup photos info, and every time restart the app, check the container, if the photo info does not exist, it is the new photo you want to upload immediately. – Logan Guo Aug 26 '14 at 03:50
  • Have a look at http://stackoverflow.com/questions/4389427/android-broadcastreceiver-intent-to-detect-camera-photo-taken and http://stackoverflow.com/questions/7275466/listen-to-photo-taken-event – tar Aug 26 '14 at 04:03

1 Answers1

0

Android doesnt broadcast when taking photos by camera

  1. a database to hold all backup photos info, and every time restart the app, check the database, if the photo info does not exist, it is the new photo you want to upload immediately. After that also add the uploaded photos info to the database to make sure it is updated.

But the solution has some problems, it may cost extra battery power, cpu etc.

  1. actually I already solved the problem, click to see detailed answer and the whole project source code
Community
  • 1
  • 1
Logan Guo
  • 865
  • 4
  • 17
  • 35
  • This answer ist not correct - android does broadcast a picture taken message (depending on your camera app). – m02ph3u5 Jan 16 '15 at 14:21