FORUMS
Remove All Ads from XDA

[XPOSED] Xposed Media Scanner Optimizer v. 1.3

239 posts
Thanks Meter: 327
 
By thomashofmann, Senior Member on 16th November 2014, 06:47 PM
Post Reply Email Thread
Let me introduce my new Xposed Module. It allows you to customize the way the media scanner works on Android.
It solves several problems that I have with the media scanner. As Xposed module developer one needs to reboot the device quite often. The media scanner runs on each reboot and eating much battery as the device stays awake while the scanner is running and doing lots of I/O.
For non developer the Xposed Media Scanner Optimizer also provides useful functionality.

First of all let me explain how the media scanner works on Android. Each time the device has bootet it runs and scans all volumes/storage. Depending on the size of the storage available on the device and the SD Card and the number of files this usually takes between 5 and 20 minutes. For each file and directory it finds it creates an entry in the so-called Android Media Store. For special file types like images, videos and music files it also scans for meta data like EXIF information for images and mp3 tags for music files. Applications may query the Media Store to find specific files bases on the file type or meta data. Well known applications that do so are the Gallery and the Music Player. Other applications may also do so.
The media scanner runs as a background service and is not visible to the user.

The Xposed Media Scanner Optimizer provides the following tweaks to the media scanner:
  • The service can be run as a foreground service allowing the user to see when and how long it runs. Foregound services are visible to the user via a notification.
  • When the scanner has finished details of how long each scan took are shown using a notification.
  • The scanner can be run in a mode where only specific directories will be scanned. This reduces scan times and thus saves battery. It also allows you to control what shows up in the Gallery or Music Player apps.
  • It is possible to tell the scanner that only specific file types (e.g. music files) should be scanned on a directory basis.
  • It is possible to prevent automatic scanning for the external volume. Only triggering the scanner form within the XMSO app will cause the media scanner to run.
  • It allows you to completely delete the contents of the media store.
  • It allows you to trigger a scan whenever you want to

On some Android phones the scanner is scheduled to run several times after a boot which is completely unnecessary and in my opinion is a bug. These repetitive scans can be prevented.
All files that will not be scanned will not show up in the Gallery or Music Player. I for myself use this feature to restrict what is shown in the Music Player for example. I only want to see music files from specific directories on my SD card to show up in the music player.
The directories that contain my music files also contain images for the album and the artist. These files would normally show up in the Gallery. There, I only want to see the contents of the directories where I keep my pictures. I don't want to have the gallery cluttered with album artwork or images of artists from the music directories.

The Xposed Media Scanner Optimizer settings application can be started from the launcher and allows you to configure the following settings:
  • Repetitive Scans: If this preference is checked repetitive scans at boot time will be prevented. Repetitive scans are not necessary and only cause greater battery drain. Depending on the Android version and vendor repetitive scans may occur and can be prevented by checking this preference.
  • Service Importance: When checked the media scanner will run as foreground service and its operation will be visible to the user via a notification.
  • Thread Priority: If checked the media scanner will be forced to run with background thread priority even if it is running as a foreground service. This is the suggested setting. If unchecked the thread priority depends on whether it runs as a foreground service or not.
  • Directories: If checked the media scanner will only scan directories that have a .scanMedia file (i.e. an empty file with a dot as first part of the name similar to the .noMedia file). Use a file explorer app to create this file. This file can be placed in a directory that may contain subdirectories. The subdirectories will be scanned as well. If unchecked all directories will be scanned (except for the ones containing a .noMedia file - this default behavior of the media scanner is not altered by the Xposed Media Scanner Optimizer).
  • Media Types: If checked only certain file types will be scanned. To define which file types the scanner will scan in a directory create the following files: .scanMusic, .scanVideo and .scanPictures. So for a directory containing a collection of music albums you would need to create a .scanMusic file at the directory that contains all albums if you only want the music files scanned. Images contained in the album directories would then be skipped.
  • Run automatically: If checked the media scanner will scan whenever it is told to do so by the system. If unchecked it only scans the external volume when triggered from the XMSO app. Requests for the scanning of single files still work in either case.
  • Result Notifications: If checked a notification will be shown when the scanner has finished including information about the scan time.
    Trigger Media Scanner: When touched a media scanner is triggered.
  • Delete Media Store Contents: When touched the contents of the media store are deleted. This will not delete the actual files on the storage. Trigger a scan or reboot to let the scanner populate the media store after deleting its contents. This is useful if the media stores already contains entries that you do not want like images from all directories in the Gallery. First check the preferences to restrict what will be scanned, empty the media store and trigger a rescan. After the rescan only what has been scanned depending on your preferences will appear in the Gallery.
  • Android Logging: If this preference is checked details of the media scanner and the Xposed module are written to the Android log. This is useful for development and to troubleshoot. For end users this should stay unchecked.
  • Xposed Log: If this preference is checked details will be written to the Xposed log. Since the Xposed log is persisted this is also useful for troubleshooting. For end users this should stay unchecked.

Depending on the number of files on your storage media scan times can be reduced significantly.

The Xposed module is available from the Xposed repository.

It should work on Android 4.1.2 (API 16) and up.

If you like the module feel free to donate
The Following 129 Users Say Thank You to thomashofmann For This Useful Post: [ View ] Gift thomashofmann Ad-Free
 
 
16th November 2014, 07:10 PM |#2  
Member
Thanks Meter: 19
 
More
Awesome! I was looking for an app or module like this without luck until today, gonna try it ASAP, thanks!

EDIT: it seems that the download isn't working I get the 404 Not found error :P

EDIT 2: it looks like is some problem related to the downloads from the server because I can't download other modules either :-/
The Following 2 Users Say Thank You to erikrh For This Useful Post: [ View ] Gift erikrh Ad-Free
16th November 2014, 07:29 PM |#3  
Senior Member
Thanks Meter: 419
 
More
possible alternate location to download this? looks like the Xposed downloads are all down even though Xposed Installer loads up new modules...
16th November 2014, 08:08 PM |#4  
HorstiG's Avatar
Senior Member
Flag Banja Luka RS
Thanks Meter: 2,387
 
More
Download not working

HGT - Galaxy S3 - S5 - Tesla TTL7 - any KK ROM
16th November 2014, 08:55 PM |#5  
Senior Member
Thanks Meter: 1,133
 
More
Hello,

Wondefull module!

Small question though: can i put .scanmedia and , let's say, .scanvideo together in a directory?
16th November 2014, 09:32 PM |#6  
HorstiG's Avatar
Senior Member
Flag Banja Luka RS
Thanks Meter: 2,387
 
More
Quote:
Originally Posted by Droidphilev

Hello,

Wondefull module!

Small question though: can i put .scanmedia and , let's say, .scanvideo together in a directory?

Where did you get the apk from?
16th November 2014, 10:41 PM |#7  
089man's Avatar
Senior Member
Thanks Meter: 1,365
 
More
Download in xpose not working? Where I can found the app?

I9100 Tapatalk 4, Spirit-Rom 4.4. 4
16th November 2014, 10:53 PM |#8  
OP Senior Member
Thanks Meter: 327
 
Donate to Me
More
Quote:
Originally Posted by Droidphilev

Hello,

Wondefull module!

Small question though: can i put .scanmedia and , let's say, .scanvideo together in a directory?

If you only create the .scanMedia file all media files considered as such by Media Scanner's default will be scanned. If you for example add a .scanPictures and a .scanVideo file images in that directory will not be scanned.
16th November 2014, 11:22 PM |#10  
Member
Thanks Meter: 14
 
More
It's not just this module... Several modules are reporting 404 error... So the Xposed repository server may be experiencing some kind of problem!
The Following User Says Thank You to mitushorizon For This Useful Post: [ View ] Gift mitushorizon Ad-Free
17th November 2014, 12:31 AM |#11  
souler456's Avatar
Senior Member
Flag Calamba, Laguna
Thanks Meter: 628
 
More
Holy freakin' glob! Finally! I am SO wanting to get this module on my phone ASAP!

Hope they fix the 404 Error quickly, cause I can't wait to get that module!


Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes