File: Use_MediaScannerConnection_on_Android.mdwn

package info (click to toggle)
git-annex 8.20210223-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 68,764 kB
  • sloc: haskell: 70,359; javascript: 9,103; sh: 1,304; makefile: 212; perl: 136; ansic: 44
file content (7 lines) | stat: -rw-r--r-- 647 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
Currently if photos or videos are copied into the Camera/DCIM directory on an Android device, or deleted the Gallery doesn't notice the changes.

It is necessary to call MediaScannerConnection - http://developer.android.com/reference/android/media/MediaScannerConnection.html - to notify the system of the change.

More info, and some sample Java code: http://stackoverflow.com/questions/13270789/how-to-run-media-scanner-in-android

It'd be awesome if the assistant did this on files it has changed.  Possibly just under Camera/DCIM, but perhaps it should be configurable. MediaScannerConnection is also used to notify and index new music files.