How to Update Android's Media Scanner / DB ?

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
PaulDaMacMan
Posts: 627
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

How to Update Android's Media Scanner / DB ?

Post by PaulDaMacMan » Fri May 13, 2016 1:01 am

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.
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: How to Update Android's Media Scanner / DB ?

Post by MaxV » Wed May 18, 2016 5:14 pm

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.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

PaulDaMacMan
Posts: 627
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: How to Update Android's Media Scanner / DB ?

Post by PaulDaMacMan » Wed Mar 29, 2017 4:41 pm

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.
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: How to Update Android's Media Scanner / DB ?

Post by MaxV » Fri Mar 31, 2017 12:42 am

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/.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Post Reply

Return to “Android Deployment”