Page 1 of 1
How to Update Android's Media Scanner / DB ?
Posted: Fri May 13, 2016 1:01 am
by PaulDaMacMan
Apparently some apps like "Gallery" only show files that have been scanned by Android's media scanning function and added to some database. This happens automatically when the device is first booted. So the problem is, if you built an App that generates a media file like a picture, video, audio, or (in my case ) a MIDI file from scratch, some other apps might not see the file until you reboot your device. For example, I've made a little piano-roll style Drum beat creator (uses Android's basic MIDI synth for playback), It exports beats as ".mid" standard MIDI files to the root of the SD card, I open up Samsung's awesome mobile DAW SoundCamp and go to import the beat into my project and it's not in the list. I reboot my phone and try again and there it is and imports fine. My understanding is that there are Java routines for updating this mechanism on the fly, is there anyway to do it from LiveCode script? It seems like it would be an import thing for a lot of different apps.
Re: How to Update Android's Media Scanner / DB ?
Posted: Wed May 18, 2016 5:14 pm
by MaxV
The problem is of the gallery apps.
When you stop using an app without closing it, the app froze.
So when you start to use again the app, the app thinks that nothing happened.
If you really close the app using the clean button (botton right button and then the sweeper), when you launch again the app it rescans folders. No need to reboot.
This is a gallery app problem, not a Livecode problem.
Some filemanager or good gallery every n seconds rescan the current folder or folders.
Re: How to Update Android's Media Scanner / DB ?
Posted: Wed Mar 29, 2017 4:41 pm
by PaulDaMacMan
I know this is an old thread now but...
No it's not just a gallery app problem. I'm not even working with image data. I'm generating MIDI files from LiveCode and then trying to use them with Samsung's SoundCamp Mobile DAW. The SoundCamp app doesn't see them until reboot because media scanner doesn't rescan unless told to by an app, except for when the device first boots.
Re: How to Update Android's Media Scanner / DB ?
Posted: Fri Mar 31, 2017 12:42 am
by MaxV
The file exists and every app can reach it using the path.
Try to use the phone file manager, go to the file, click it and select SoundCamp Mobile DAW to open it.
For example if you save on SDCARD, the path is /mnt/sdcard/.