I am trying to get notified of a new picture or video added to the phone gallery. I would need to obtain the new media's URI. The purpose is so i can automatically back it up. So i need a register that is set in the background to continuously listen or check for new media added to the gallery, and captures the Uri. This used to be done with a broadcast receiver such as:
<receiver
android:name=".receivers.CameraEventReceiver"
android:label="CameraEventReceiver">
<intent-filter>
<!-- <action android:name="com.android.camera.NEW_PICTURE" /> -->
<action android:name="android.hardware.action.NEW_PICTURE" />
<data android:mimeType="image/*" />
</intent-filter>
</receiver>
However this was deprecated in API level 24. I target API 21-26. Can someone show me how to do this with JobSchedulers like android docs say too?