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
Highlighted
New Developer
Posts: 29
Registered: ‎09-29-2008
My Device: Not Specified
Accepted Solution

Want to know how to access Filesystem in Blackberry

Hi All,

 

I am deveoloping an application which access data from filesystem, the code already written for Nokia,

I want to port that code in to Blackberry, Dose anybody can give suggetions.. 

Developer
Posts: 46
Registered: ‎07-12-2008
My Device: Not Specified

Re: Want to know how to access Filesystem in Blackberry

There are a few ways to store data on a blackberry:  RecordStore API, FileConnection API, or RIM Persistable API.

New Developer
Posts: 29
Registered: ‎09-29-2008
My Device: Not Specified

Re: Want to know how to access Filesystem in Blackberry

[ Edited ]

I want to use fileconnection API (JSR75)

I have written the code like this:

 

import.javax.microedition.io.*;

import.javax.microedition.io.file.*;

.

.

.

 

Enumeration enumer = FileSystemRegistry.listRoots();
while(enumer.hasMoreElements())
{

form.append((String)enumer.nextElement());

}

 

when I run the above sample code, I didn't get any file system roos.

 

Con any one please help me to solve this problem.

 

 

And one morething is that how to add the permissions to the application such as:

javax.microedition.io.Connector.file.read, 

javax.microedition.io.Connector.file.write.

 

Help would be appreciated. 

Message Edited by dillirao on 09-29-2008 10:09 AM
BlackBerry Development Advisor
Posts: 15,752
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Want to know how to access Filesystem in Blackberry

What BlackBerry model and handheld software version are you testing with?  You can see this under Options, About on the BlackBerry.  Is there a micro SD card in the BlackBerry?
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Developer
Posts: 29
Registered: ‎09-29-2008
My Device: Not Specified

Re: Want to know how to access Filesystem in Blackberry

Thank u for reply

I am using emulator-8120 version  for testing

BlackBerry Development Advisor
Posts: 15,752
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Want to know how to access Filesystem in Blackberry

I ran this in the 8120 BlackBerry Simulator included with the version 4.3.0 BlackBerry JDE and receieved these results:

 

Root: SDCard/
Root: store/

 

 

Are you using the same simulator?  If not, what is the BlackBerry handheld software version you see under Options, About?

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Developer
Posts: 29
Registered: ‎09-29-2008
My Device: Not Specified

Re: Want to know how to access Filesystem in Blackberry

[ Edited ]

Thank u,

I did a small wrong while printing its working now..

 

I created a file in sdcard/ and i am developing on emulator . I want to know the location of file i used

ie. where it will store in the system

 

 FileConnection fconn = (FileConnection)Connector.open("file:///SDCard/Dil_fil_burry.txt");

 

Did u tell me where the file specified above will store in the system 

Message Edited by dillirao on 09-30-2008 12:04 AM
New Developer
Posts: 29
Registered: ‎09-29-2008
My Device: Not Specified

Building Error

While building my project it shows

 

C:\Program Files\Research In Motion\BlackBerry JDE 4.3.0\bin\rapc.exe  -quiet import=..\lib\net_rim_api.jar codename=Myproject

 ...................................

.....................................

.....................................

 

Error!: Class: BaseListMidlet has no member: <init>

 

I am using jdk1.5.0_12 and JDE4.3.0.1r

 

both environmental variables are exists..

 

What is the problem? 

BlackBerry Development Advisor
Posts: 15,752
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Building Error

Please verify that you have set the project type to a MIDlet and filled in the main MIDlet class.  This is done by right clicking on your project in the BlackBerry JDE, selecting Properties and then clicking on the Application tab.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Developer
Posts: 29
Registered: ‎09-29-2008
My Device: Not Specified

Re: Building Error

[ Edited ]

Thank U

 

It's working with the modifications specified by you...

 

I want to load my application from SDCard ie. I want to load my application in to SDCard and when user insert SDCard it will automatically

 

install in to the mobile . Is it possible with some auto installer script.

 

 

Message Edited by dillirao on 10-03-2008 09:18 AM