x


Search for files on android

I'm trying to get a list of the paths of all mp3 files on the device to access them ingame by using the WWW class. I would like to search the device once, populate the list and save it for later use.

How can I scan through all directories (even on external sd card) and retrieve the corresponding file paths?

I only got access to the standard unity version and not pro if that makes a difference.

Thanks in advance del

more ▼

asked Apr 14 '12 at 12:52 PM

delstrega gravatar image

delstrega
840 5 8 12

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

1 answer: sort voted first

You can only search the directory of your app and the SD-Card.

It's not possible to look into the data directories of the OS or other Apps installed on the device, due to security reasons. Each app runs in it's own sandbox with a certain userId. This userId is unique per App (or per signature, depending on what the developer decided).

You can use C#/.NET IO Methods to query directories and sub directories.

Take a look at MSDN http://support.microsoft.com/kb/303974

The SD card should be by default be mounted as /sdcard

more ▼

answered Apr 14 '12 at 12:57 PM

Tseng gravatar image

Tseng
1.5k 6 8 23

I just downloaded Winamp for Android and the app found the music I add on my phone (Galaxy_S2), so it is possible to find and list all the (music) file of a device. Unfortunatly, I haven't found how yet

Oct 05 '12 at 03:52 PM BazLevelUp
(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:

x2612
x249
x97
x46
x26

asked: Apr 14 '12 at 12:52 PM

Seen: 1112 times

Last Updated: Oct 05 '12 at 03:52 PM