When i migrated all my image- and mp3-files from inside myapplication to Firebase then the performance changed alot. Loading mp3-files takes alot of time and it is not because of my internet (i have 200/200mb down/up speed).
Im also using the Glide library to resize my huge images.
This is how i use Glide to place my images to the layout:
Glide.with(getActivity()).load(song.getArtistImg()).into(artistImg);
Glide.with(getActivity()).load(song.getArtistImg()).into(artistImgBG);
This is how i retrieve my mp3-file from firebase:
mediaPlayer = MediaPlayer.create(getActivity(), Uri.parse(getSong));
I use my viewmodel to set
and get
my objects
I've set logs
on every step of my code to see exactly where it takes so long to and i found out that when creating my MediaPlayer
object it is taking a while. I've searched about it but did not find anything that solved my problem.
How can i increase the time it takes to create the MediaPlayer
object?