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
Developer
Posts: 153
Registered: ‎10-26-2010
My Device: Bold 9900
My Carrier: AT&T
Accepted Solution

Access to internal flash

Hi,

If I do this to get to the SDcard, how do I get to the other 6 GB?

 

	private final String rootname = "file:///SDCard/MyDirectory/";
	public int checkit() {		// return value just to force thread to complete before continuing
		// check if directory exists and if not, create it
		try {
			FileConnection fconn = (FileConnection)Connector.open(rootname);
			// If no exception is thrown, then the URL is valid, but the file may or may not exist.
			if (!fconn.isDirectory()) {
				System.err.println("Creating directory");
				fconn.mkdir();  // create the directory
			}
			fconn.close();
		 }
		 catch (IOException ioe) {
			 System.err.println("Directory error");
		 }
	return 0;
	}

Harry

--------------
Accepted PlayBook Applications: Marmi-doos, BASIC, Run and Hide, SuperClip
Accepted OS4-7 SmartPhone App: KeepLightOn
Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Access to internal flash

you can use http://www.blackberry.com/developers/docs/7.1.0api/javax/microedition/io/file/FileSystemRegistry.htm... to get a list of the currently available roots.
usually the file system is in there.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 153
Registered: ‎10-26-2010
My Device: Bold 9900
My Carrier: AT&T

Re: Access to internal flash

Hi,

 

Yes, the code that you referenced works okay on a 9650.  That is how I found the SDcard directory in the first place.

 

It returns almost nothing on a 9900 - just system/.

 

That code won't even find the SDcard though I can read/write to it as easily as on the 9650.

 

That is why I asked here.  Has anyone used the 6 GB internal flash and know how to reference it?

 

Harry

--------------
Accepted PlayBook Applications: Marmi-doos, BASIC, Run and Hide, SuperClip
Accepted OS4-7 SmartPhone App: KeepLightOn
Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Access to internal flash

system/ should be the internal flash
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Highlighted
Developer
Posts: 153
Registered: ‎10-26-2010
My Device: Bold 9900
My Carrier: AT&T

Re: Access to internal flash

Hi,

 

So to access it, I should use file:///system/home/user/MyDirectory  ? 

 

Harry

--------------
Accepted PlayBook Applications: Marmi-doos, BASIC, Run and Hide, SuperClip
Accepted OS4-7 SmartPhone App: KeepLightOn
Developer
Posts: 153
Registered: ‎10-26-2010
My Device: Bold 9900
My Carrier: AT&T

Re: Access to internal flash

 

I found by going back to my 9650 (lucky I kept it), that the correct root directory is /store

 

I can access my 9900 by file:///store/home/user/MyDirectory successfully even when the sample program refuses to list it as a root directory.

 

Harry

--------------
Accepted PlayBook Applications: Marmi-doos, BASIC, Run and Hide, SuperClip
Accepted OS4-7 SmartPhone App: KeepLightOn