Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to search files presnt on the SD Card?

 
Prajkti Khadse
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

 
Prajkti Khadse
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much Monu.....
 
Pratik Goswami
Ranch Hand
Posts: 136
Android Chrome Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Prajkti Khadse
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 136
Android Chrome Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 136
Android Chrome Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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

Thanks & Regards
Pratik Goswami
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic