How to list all media in Android? - android

I'm building a specialized media player for android and need a way to select a song from the device. I like how the builtin music player groups everything by artist/album, is that something I would have to write or is there something I can just plug in to get that functionality for free?
What is the easiest way to list music files on the phone with some basic grouping by the idtag info?

Use the MediaStore content provider.

You'll probably just have to write a method that scans the entire phone (or at least the music directory), for all of the media files that the phone can handle, and then store that data in a database yourself (using a content provider).
Either way though, you can find the source for the android Music app here:
https://android.googlesource.com/platform/packages/apps/Music

Related

Encrypt large files on flutter and access them only through in-app

I am developing a digital media app using Google's flutter framework which contains songs, movies and etc. The main focus is, these media content should be accessible only through the app and not by outside methods (eg: media players, file browsers).
Eg: A music file which was downloaded through the app should only be played within the app and not by any media player. In that case, there should be an encryption method which should be used to lock these files from outside world.
In this case, bigger files such as Movies should also be taken into consideration. The size of a file can be anywhere between few kbs to 2-3 GBs.
What should be the better approach when solving this problem?
Is it to
Store everything in a database after encrypting the bytes?
Encrypt the entire file and still keep them in the form of "file"?
The downloaded data should also be able to be consumed quickly once the user requested for it. And once the consume is done, the file should be locked again from the rest of the world.
I am not sure if this topic is too broad but somehow I would appreciate it if anyone could provide me with something to start off.
Thank you.

Create protection scheme for android audio player

everyone!
Me and my team are developing some audio books that we will sell through our android application and our users will also listen them using the in-app mp3 player. We want to find a method (paid or free) to be able to protect our mp3's so the user cannot copy them and play with their own player.
I am aware that someone that is determined can crack anything, but our user targets are not computer geeks, but regular people that want a product that works and occasionally might try to cheat the system
Do you know any system that is easy to implement and can meet our objectives ?
Thank you in advance.
Do you know any system that is easy to implement and can meet our objectives ?
Stream the files from your server (e.g., using RTSP), or store them in internal storage on the device. Those will stop "regular people that want a product that works and occasionally might try to cheat the system" from being able to access MP3 files, which you can then play back using MediaPlayer within your own app ("in-app mp3 player").

Android IMEI binding with music file

Is there any possibility to develop an application that binds the IMEI with the music file and should not play that music file if IMEI is not registered.
The core idea is to protect the licensed file from transferring to other devices.
If you're using popular file formats like MP3, WAV etc, then any such protection you implement will only work in your app. The user will still be able to transfer the music file and play it using another music player.
However, you could develop a custom format that stores the IMEI as a part of the file (though you should store a hash of it, instead of the raw number, both for security and privacy reasons). This format will have to be structured in a way that no media player but yours can read the data from it. Naturally, you'll have to develop a parser for this format as well, as Android's built in media classes won't be able to play this.
Also, keep in mind that there are many Android devices that don't have an IMEI, so you might want to go with Bluetooth/WiFi MAC addresses. Also, your users may switch devices, and all of a sudden their music won't play anymore.

Phonegap Android App - Display Store MP3 Media

I've been following this blog to help me make a simple music player function with an Android app (http://simonmacdonald.blogspot.com/2011/05/using-media-class-in-phonegap.html).
All works well - but I would like some way to extract a list of all music media stored on the phone so the user can click a file and play it. Does anyone know if this is possible via phone gap? I'd need to access track name/artist etc and a link to the track.
Cheers
Paul
Prognosis is not good.... PhoneGap does not have an API for accessing the media library. So, you would have to fall back to the File API to locate music files, and then... you would have to read the binary data in the actual files to extract out the track/artist metadata. Ouch. Seems pretty impractical.
[EDIT]
By the way, PhoneGap is not the only game in town. Appcelerator seems to solve the same problem, and apparently has a richer API, which includes
access to media metadata

Is it possible to use the standard Music application to select an audio file?

in my application, I want to be able to select an audio file which is on the device to be used. The standard audio player in Android 2.3 "Music" offers everything I need to fullfill the requirements. Is it possible to send an Intent to open the Music app, select a song and give back the audio file id as result to my application?
thanks in advance!
greets,
Andi
Have you tried using the INTENT_ACTION_MEDIA_SEARCH? It seems to do what you are looking for..

Categories

Resources