B4A Library [Lib] MediaBrowser

Informatix

Expert
Licensed User
Longtime User
Are these images in the MediaStore? If yes, then filter the results to keep only the wanted path. If no, you have to reboot your phone or call ScanNewMedia before browsing the MediaStore.
 

Alisson

Active Member
Licensed User
Informatix, if you use the function:

Sub ScanNewMedia("/storage/emulated/0/Android/cache/folder/" As String)

End Sub

How get the all images?
 

Alberto Iglesias

Well-Known Member
Licensed User
Longtime User
Hey Informatix,

I have a specific problem with your library and Samsung devices:

When I take a picture in landscape with a Samsung S6, in default gallery app, appears OK, the thumbnail is perfect oriented, but with the library appears in portrait rotated, in this method:

B4X:
Dim bThumb As Bitmap
bThumb = MB.GetImgThumbnailByID(ImgData.ID,  True)

Questions:

Can I know the picture orientation with the library?
Can you try in a samsung devices?

Thanks
Alberto Iglesias
 

Flosch

Member
Licensed User
Longtime User
Hi I have a problem whith the mediabrowser and the external SD card.
On some phones the "Location" entry is wrong. It looks like: /storage/9016-4EF8/MP3/song.mp3
If I want to use the location to get infos using the GetAudioFileInfo (Path AsString, File AsString) methode the song could not be found at this location.
Any idea what's going wrong?

Thanks for your help
 
Last edited:

Informatix

Expert
Licensed User
Longtime User
These paths are the ones that the OS stores in its database. I have no control on them.
 

Flosch

Member
Licensed User
Longtime User
Thanks for the answer.
The path seams to be "correct" - the file.exist function will return true.
But the GetAudioFileInfo methode will return 0. So I didn't get any information.
Is there a workaround to get the right path?
I create a playlist - with the path the 'location' information will provide me.
Later I will use the GetAudioFileInfo methode to get the informaiton I need to play it.
 
Last edited:

Informatix

Expert
Licensed User
Longtime User
Did you try to pass the path with all letters converted to lower case? e.g. "/storage/9016-4ef8/mp3/"
 

Flosch

Member
Licensed User
Longtime User
Did you try to pass the path with all letters converted to lower case? e.g. "/storage/9016-4ef8/mp3/"

I tried both upper and lower case in any possible combination for path and filename but GetAudioFileInfo will allways return 0x00.
 

hbhb

Member
After upgrading to the API 30, I got the following error: The library works perfectly on all APIs<30.
It is similar for both Audio and Video, which use "GetExtVideoFileInfo."

B4X:
java.lang.IllegalArgumentException: Invalid token 15 - Test.mp4
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…