• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Android, Navigate and Folder

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay I made a folder on my android phone.
I made a cars.txt in it, and I made a program to read and find the text files.
It works on my PC, it works fine.
Can I use "File" to get the file on the android?

I don't thing I can use "/Starage/sdcard0/Cars/" to find my folder on android.
When i use "My Files"(its on samsung) on my phone i get this. and i made a falder named Cars.
/Starage/sdcard0/Cars/

how can i get ther if its not "/Starage/sdcard0/Cars/"? or is it?!?

Example

Downloads
Pictures
Cars <---
Music

File folder = new File("/Starage/sdcard0/Cars/"); <---- i dont no how to navigate on android.
File[] listOfFiles = folder.listFiles(new FilenameFilter() {
public boolean accept(File dir, String name) {
return name.toLowerCase().endsWith(".txt");
}

Thanks for reading and helping out.



 
Rancher
Posts: 43081
77
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On Android you shouldn't construct the entire path directly. As described in http://developer.android.com/guide/topics/data/data-storage.html, use the API methods to access either internal or external storage.
 
Anton Sigurdsson
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks, the link was greet.
reply
    Bookmark Topic Watch Topic
  • New Topic