Monday, June 4, 2012

List root folders in J2ME/Blackberry


The following code list/check all the folders that existed in SD card, which is inserted in J2ME or Blackberry running OS. Please remember to import necessarily packages (in eclipse based, us Ctrl + Shift + O)

String root = null;
Enumeration e = FileSystemRegistry.listRoots();
while (e.hasMoreElements()) {
root = (String) e.nextElement(); // device has a microSD
        if (root.equalsIgnoreCase("store")) {
          System.out.println("okies man - store/ is available");
        } else {
  System.out.println(root);
        }
}

1 comment:


  1. Your website is very good.This is a very good article.
    Thank you for providing this information...

    I really gained knowledge that benefited all.

    Visit Us

    ReplyDelete