x


Android Music selection

I am in the process of making an application for android using unity and I would like to be able to get a user selected song from their own library of music on their android into my unity application. I was wondering what would be the best way to go about this.

Is there an android specific script call that can bring up a song picker or return to me a list of the music stored on the device?

If there isn't, is there a simple way to bring up a file viewer like finder or explorer so that the user can look for the songs themselves and I can just use the path to load the song.

Or do I have to write a small song picking application in java that gets called from Unity?

Or have I overlooked a really simple way to do this?

more ▼

asked Apr 11 '12 at 07:56 PM

georevilo gravatar image

georevilo
1 1 2 2

(comments are locked)
10|3000 characters needed characters left

2 answers: sort oldest

AFAIK for this kind of stuff you need the PRO version of unity. A custom Manifest file will be neccessary (you need full Memory access on the phone) and a java native plugin for unity to handle the file loading and stuff via Android Framework functions.

If you have Pro this is the way to go.

more ▼

answered Apr 12 '12 at 12:26 AM

captaincrunch80 gravatar image

captaincrunch80
240 1 3 4

What permission(s) would i need to set for that?

Apr 12 '12 at 10:08 PM georevilo
(comments are locked)
10|3000 characters needed characters left

Hi again,

ok I have taken a deeper look, it can be managed by Intend instead of scanning the USB storage yourself.

You can handle it with Intend ACTION GET CONTENT. Take a look here http://stackoverflow.com/questions/9577576/how-to-call-in-built-android-music-menu-in-my-development (The second answer looks good)

Check out this too http://unity3d.com/support/documentation/Manual/Android-Launch%20an%20Android%20Application%20from%20a%20Unity%20Application.html and set up your unity project in Eclipse.

Maybe you can do this without pro and I was wrong (I thought native java integration requires Pro, but if the AndroidJavaObject works it should be possible.). Give it a try!

Best of luck! Maybe you can report back if it works. Would be nice to know.

more ▼

answered Apr 12 '12 at 10:36 PM

captaincrunch80 gravatar image

captaincrunch80
240 1 3 4

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2459
x155
x74

asked: Apr 11 '12 at 07:56 PM

Seen: 768 times

Last Updated: Apr 12 '12 at 10:36 PM