Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Contributor
Posts: 5
Registered: ‎04-16-2012
My Device: Curve 9300
My Carrier: Personal - Argentina

SDCard not listed as a Mounted root. (FileSystemRegistry.listRoots())

I am new to BB and I'm running this piece of code (List Mounted Roots) trying to reach SDcard memory, but I only get "store/".

 

I am using Eclipse plugin 1.5.0 (Windows 7), BlackBerry JRE 5.0, Emulator Curve 9300. I configured the SDcard Memory on the Eclipse" run configurations" section, Simulator tab, Memory tab, and selected "Use PC File system for SD Card Files. Also tried changing SDcard on the Simulator, but I only get "store/".

 

But the Media card is present on the emulator and I can see it using the "Files" Application on the emulator. 

 

 

the code:

 

import java.util.Enumeration;
import javax.microedition.io.file.FileSystemRegistry;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.container.MainScreen;


public class ListMountedRoots extends UiApplication
{
public static void main(String[] args)
{
ListMountedRoots app = new ListMountedRoots();
app.enterEventDispatcher();
}

public ListMountedRoots()
{
pushScreen(new HomeScreen());
}
}

class HomeScreen extends MainScreen
{
public HomeScreen()
{
String msg = "The mounted roots are:\n";
Enumeration e = FileSystemRegistry.listRoots();
while (e.hasMoreElements())
{
String rootName = (String)e.nextElement();
msg += rootName + "\n";
}
add(new LabelField(msg));
}
}

 

I would appreciate any help.

 

thanks

 

Hugo



Developer
Posts: 254
Registered: ‎03-15-2011
My Device: simulator
My Carrier: simulator

Re: SDCard not listed as a Mounted root. (FileSystemRegistry.listRoots())

I used the same code and i am able to view the SDCard listed in the resultant screen..

 

Try to clean your simulator and run it again. Or test with real device for the exact result.

------------------------------------------------------------------------------------------------
Click "Accept as Solution" if post was what you needed. Give kudos if you feel response is helpful.

New Contributor
Posts: 5
Registered: ‎04-16-2012
My Device: Curve 9300
My Carrier: Personal - Argentina

Re: SDCard not listed as a Mounted root. (FileSystemRegistry.listRoots())

sheeluwiki:

 

Are you testing the code with the same environment as I have described? I say, Eclipse plugin 1.5, Blackberry JRE 5.0, BB 9300 emulator? Because using JRE 4.5 , JRE 6.0 and JRE 7.0 works. My problem is with JRE 5.0 and BB 9300 emulator. Just "store/" is listed as a Mounted roots.

 

Thanks in advance

 

Hugo

Developer
Posts: 254
Registered: ‎03-15-2011
My Device: simulator
My Carrier: simulator

Re: SDCard not listed as a Mounted root. (FileSystemRegistry.listRoots())

I tested in Eclipse , BB JRE 5.0 and BB  simulator 9550

------------------------------------------------------------------------------------------------
Click "Accept as Solution" if post was what you needed. Give kudos if you feel response is helpful.

New Contributor
Posts: 5
Registered: ‎04-16-2012
My Device: Curve 9300
My Carrier: Personal - Argentina

Re: SDCard not listed as a Mounted root. (FileSystemRegistry.listRoots())

Well, the problem is not the code. The problem is that the emulartor does not recognize the SDCard is inserted. I have tried to simulate to change the SDCard and also configured the emulator from Eclipse "Run Configurations" settings to simulate a SDCard Memory using a PC File system. But no way

 

I have spent DAYS trying to run the SQLiteDemo, but nothing. I uninstalled Eclipse and the plugin, emulators, everythig, and re-installed again. I downloaded a fresh copy of the eclipse installation package with the BB eclipse plugin v 1.5 (Version: 1.5.0.201112201607), the BB SDK 5.0 (versiion 5.0.0.36) and I have Eclipse Indigo (Version: 3.7.2.v20120207).

Emulators Socks!

 

Does anybody at RIM Development Team know about that? I think there must been thousands of people who download the IDE plugins and emulators packages and finally QUIT. Because its very fustrating. I have taken many inniciatives with others software development platforms in my life (I have a number of years developing software), but never something  I cant solve like this. 

 

So my question is for the Blackberry development team, How to solve this?