File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Android and the fly likes How to search files presnt on the SD Card? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "How to search files presnt on the SD Card?" Watch "How to search files presnt on the SD Card?" New topic
Author

How to search files presnt on the SD Card?

Prajkti Khadse
Ranch Hand

Joined: Apr 02, 2009
Posts: 52
Hi all

i want to get list of all the files present on the SD Card along with their Absolute Paths...
just like the Search application in Windows....

Is it Possible with Android??? if Yes can Anybody Please tell me How...???
Monu Tripathi
Rancher

Joined: Oct 12, 2008
Posts: 1369
    
    1

Prajkti Khadse wrote:i want to get list of all the files present on the SD Card along with their Absolute Paths...


You can get a list of all the files on your SD card and their absolute paths using:


[List of FAQs] | [Android FAQ] | [Samuh Varta]
Prajkti Khadse
Ranch Hand

Joined: Apr 02, 2009
Posts: 52
Thank you so much Monu.....
Pratik Goswami
Ranch Hand

Joined: Mar 02, 2009
Posts: 136

Hi Prajakti,

I can have list of files those are stored in SD card.
Can you tell me how to delete a folder that is on SD card? I have made a folder using adb shell inside /sdcard. While deleting files from sdcard code omits that folder. Have you ever tried with folder?

Thanks & Regards
Pratik Goswami.


iOS * Android Developer
Prajkti Khadse
Ranch Hand

Joined: Apr 02, 2009
Posts: 52
Have you tried using delete() method of File class...

If it works with file then it should also work with directory because Directory is File too....

Check the read-Write permissions of the directory through DDMS..........
Pratik Goswami
Ranch Hand

Joined: Mar 02, 2009
Posts: 136

Hi Prajakti,

Thanks for your reply.

I have read/write permissions on created folder and I am using delete() method only to delete that folder but no success at all. Even in DDMS i am unable to delete that folder after once i created it ADB shell.

Thanks & Regards
Pratik Goswami.
Prajkti Khadse
Ranch Hand

Joined: Apr 02, 2009
Posts: 52
Then,ther's only one reason....... You can't delete System Folders........

It's obvious that, if you create a folder with adb shell, you can't delete it through Code.
You can remove it through adb shell only......

and if you at all want to delete the foldre through code only then you must have created the same through code only.......
Pratik Goswami
Ranch Hand

Joined: Mar 02, 2009
Posts: 136

Hi,

But there must be a solution to do it by programming, Anyways thanks for replaying.

Thanks & Regards
Pratik Goswami
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to search files presnt on the SD Card?