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

Web and WebWorks Development

Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Error using SD card program given on the blackberry site

Have you tried comparing the sample found here to your code: http://na.blackberry.com/eng/developers/devbetasoftware/widgetsdk.jsp

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
New Contributor
Posts: 2
Registered: ‎01-21-2011
My Device: Curve 8520
My Carrier: Telcel

Re: Error using SD card program given on the blackberry site

Hi, there is the code implementation that I've in my project. Maybe it could guide U.


public void crearFile(){
        int campo8, campo9;
        DateField lafecha;
        SimpleDateFormat formato = new SimpleDateFormat("yyyyMMddHHmmss");

            lafecha = new DateField("", System.currentTimeMillis(), formato);
            FileConnection fc = (FileConnection)Connector.open("file:///SDCard/Blackberry/documents/"
                    + "visitas" + Inicio.clave + lafecha
                    + ".txt");
            OutputStream out = fc.openOutputStream();
            PrintStream output = new PrintStream( out );
            _vvisitas = (Vector)visitas.getContents();
                for(int idx = 1; idx<_vvisitas.size(); idx++){
                    StoreInfoSalida info = (StoreInfoSalida)_vvisitas.elementAt(idx);

                    for (int j = 0; j < 3; j++){
                Dialog.inform("Data has been saved in a file into Blackberry SD Card "
                        + "Check it");
            catch(Exception ex1){
        catch(IOException ioe){
            Dialog.inform("Data cannot saved in SD Card");
        catch(Exception ex){