Best way to monitor for new photos in gallery?

2019-04-15 05:37发布

I have checked other similar question and answers but not yet satisfied. I have a need where my app need to be notify whenever new photos arrive in the gallery so that it can process that new photo. I know apps like ES file explorer are using service for constantly monitoring the change in files and I am also doing the same.

What I am doing : Using intent service and AlarmManager to check every 30 minutes by querying MediaStore and send broadcast if any new photo is found since last scan.

What is required : Instead of firing intentService every 30 minutes I need to find a way where I can listen to new photos and send broadcast as soon as new photo is detected in device. I am not allowed to overburden device battery and give support all the way back from api level 11.

Can you suggest any way to achieve this ?

0条回答
登录 后发表回答