I am completely new to Android studio, but I would really like to create a music player that plays downloaded songs on android. My problem is that if I have a lot of songs they use up a lot of space and my question is if there is a way to compress the files in a way that they use up less space, but still get unpacked fast enough to not cause big lags between one song and the other.
The idea behind this is that when a song is selected it gets unpacked, then gets played and when it finishes it gets packed again. I don't know if that's the best way to do it, and if you have a better idea please let me know.
This is not possible. MP3 files (mentioned in tag) are already effectively compressed. The only way to make it significantly smaller is to re-encode it with lower bitrate which would be lossy compression. It would seem that external storage/hosting and loading the necessary files on the go is the only way to save device storage. To have no lag, keep "one song in advance from the playlist".