Meaningless Drivel is fun!*
The moose likes Android and the fly likes Android, Navigate and Folder Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Android, Navigate and Folder" Watch "Android, Navigate and Folder" New topic
Author

Android, Navigate and Folder

Anton Sigurdsson
Greenhorn

Joined: Sep 29, 2011
Posts: 13
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.



Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41133
    
  45
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.


Ping & DNS - my free Android networking tools app
Anton Sigurdsson
Greenhorn

Joined: Sep 29, 2011
Posts: 13
thanks, the link was greet.
 
 
subject: Android, Navigate and Folder
 
Similar Threads
Android Hope
How can i find apiKey and Where i use apiKey?
deploying app to android phone without signing?
How this app working?
Problem creating servlet for my android application in eclipse