This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java Micro Edition and the fly likes Getting root folder name in J2ME Midlet application 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 » Java Micro Edition
Bookmark "Getting root folder name in J2ME Midlet application" Watch "Getting root folder name in J2ME Midlet application" New topic
Author

Getting root folder name in J2ME Midlet application

Vijay Java
Greenhorn

Joined: Oct 20, 2008
Posts: 1
Hi,

I am having problem to get the root folder name of a mobile (working with device (Nokia-5800)). The value I am getting is "null".

The same code when run on the emulator (Nokia-6350), I am getting correct root folder (/root1/) which is under "/DefaultColorPhone/filesystem/".

Please let me know, how can i get the root folder name for any mobile device in a J2ME Midlet application.

The code i tried and i got the value as null is shown below:

*****************************************************************************************************
Enumeration roots = FileSystemRegistry.listRoots();
String rootFolderName = (String)roots.nextElement();
Alert splashScreen = null;

if (rootFolderName != null){
splashScreen = new Alert(null, "Root folder is not null: "+rootFolderName, null, AlertType.INFO);

}
else{
splashScreen = new Alert(null, "Root folder not found", null, AlertType.INFO);
}
splashScreen.setTimeout(3000);
Display.getDisplay(this).setCurrent(splashScreen);
*****************************************************************************************************

The output i am getting for this is Alert Screen Mentioning "Root Folder not found".


Is there some other way where we can get the root folder name? Please assist....


Thanks and Regards,
Vijay
 
Consider Paul's rocket mass heater.
 
subject: Getting root folder name in J2ME Midlet application
 
Similar Threads
Alert not display on mobile.
Bluetooth Connection Problem
Open a word file from a midlet
System.getProperty("fileconn.dir.photos") returns null
J2ME-WEBSERVICE