Tuesday, July 14, 2009

Get mobile directories/roots using J2ME

//try this code

Enumeration roots = FileSystemRegistry.listRoots();
while(roots.hasMoreElements()){
//here you can do your actions on the roots-
//use 'roots.nextElement()' to get the root/directory
//for eg you can add these directories into a choice group.
//To get the string value of the diectory use
//'String=roots.nextElement().toString();'
}

java cellphone software developers cochin

website hosting development cochin kerala

2 comments:

  1. can anyone hep me the code to create a new folder in mobile using j2me

    ReplyDelete
  2. You will get the desired location from previous post and then

    // browseLocation = yourlocation/directoryname(eg:file:///e:/Media Files/xyz)
    tempconnection = (FileConnection) Connector.open(browseLocation);
    if (!tempconnection.exists()) {
    tempconnection.mkdir();
    //this will create a directory in the specified location
    }

    ReplyDelete

LinkWithin

Related Posts with Thumbnails