Simulated SDCard

Hey,.

I'm getting started with the development of an application for sqlite. I have the source code located on BlackBerry.com. I built the code, called the connection key.

I try to go to the SD card and see if the file was created or not. Bascially, I browse the simulated SD card.

I clicked on the Simulator to simulate-> change SDCard and provided the name of a file and the path. I see a .dmp file but when I click it, it opens in Visual Studio.

Thank you very much.

When you select simulate-> change SD card you should choose 'Add directory' and then select an empty directory on your drive.  This is where all the files that you create will go from the simulated application.  Remember, you want to read these same files back you will need to select the same directory the next time.  You could create a confirmation of execution and set the directory once.  I've attached a picture to show you where you can find that.

Hope that helps.

Tags: BlackBerry Developers

Similar Questions

  • He can get wav to play from the SD card in the sim

    For some reason any my .wav will play only a simulated SDCard but not where I stored it in the res folder.

    It works

    ______________

    public void playSound().

    try {

    String filename = "file:///SDCard/Blackberry/tink.wav";

    A player = javax.microedition.media.Manager.createPlayer (filename);

    Player.Start ();

    } catch (IOException e) {}

    System.out.println ("error creating player");

    } catch (MediaException e) {}

    System.out.println ("error media type");

    }

    }

    public Sub fieldChanged (field field, int context) {}

    if (field is filing) {

    playSound();

    _animatorThread = new AnimatorThread (this);

    _animatorThread.start ();

    }

    If I replace the file name with "com/app/res/tink.wav" it doesn't work. My Kit is com.app.res.

    Try this

     InputStream is = getClass().getResourceAsStream("tink.wav");
     //create an instance of the player from the InputStream
     Player player = Manager.createPlayer(is, "audio/wav");
    
  • SDCard of BB JDE 4.2.1 Simulator.

    Quote from previous forums:

    Comments: Raiden
    SDCard of BB JDE 4.2.1 Simulator.
    Posted the: July 10, 2008 06:32
     
    Hello guys have a good day.
    Little do I need your advice. I want to know how to write the file on card SD JDE on local hard drive. I think that it is possible to do. But I do not know how? Please help me guys.
    Have a beautiful day again"

    msohm

    Messages: 2 239
    Join date: Jul, 2005

    Re: SD of the BB JDE 4.2.1 Simulator.
    Posted the: 10 July 2008 09:37
     
    You try to do to the BlackBery Simulator or a real BlackBerry?

    Mark Sohm
    BlackBerry developer journal
    www.blackberrydeveloperjournal.com

    Comments: Raiden
    Re: SD of the BB JDE 4.2.1 Simulator.
    Posted the: July 14, 2008 21:25
     
    Sorry for answering at the end "I am train to the BB Simulator.
    TNX for your reply ' Makk Sohm

    See the knowledge base article developers below for the steps to set up a micro SD card in the BlackBerry Simulator.

    Use a computer filesystem in the form of microSD card
    DB-00654
    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800738/800792/801083/...

    This feature was added in version 4.2.2 of the BlackBerry Simulator.  So unfortunately it is not supported in version 4.2.1.

  • Simulator to start without conditions

    Hi all

    Our automated test environment starts the simulator through off which automatically starts our application that starts a battery of tests. The problem is that whenever the Simulator starts a terms and Conditions window is displayed, blocking any automated process.

    Is there a way to disable the context menu? I thought to use a keypress of fledgecontroller command, but then the next question is how can I know that the Simulator has finished booting?

    Thank you

    fledge.exe/app = Jvm.dll / Pocket = 9800/session for partner = bbtester/app-param = NoTutorial/app-param = DisableRegistration/app-param = JvmAlxConfigFile:9800.xml/data-port/data-port = 0x4d4e /pin = 0x2100000A 0x4d44 = / automate/title = bbtester/No.-save-settings / secure/clear-flash/no.-save-flash/clear-sdcard

    solves the problem.

  • Can not read files in Simulator

    I used a folder on my pc to the SD card file system.

    I used the following code to read the file that I copied to the shared folder. But the app could not find the file. In debug mode, it appears an error code 1003.

    Try
    {
    FileConnection fconn = (FileConnection) Connector.open ("file:///Media Card/my.xml");
    If (! fconn.exists ())
    {
    System.out.println ("the file do not exist!");
    }
    }
    catch (IOException e) {}
    System.out.println (e.getMessage ());
    }

    I also tried to use the FilePickerDemo which is an example of a project. The FilePickerDemo can navigate in the file but can not find the file my.xml either.

    Does anyone know where I could be wrong? I worked on this question since yesterday afternoon. Thank you very much!

    BTW, I use 8900 Simulator, Windows 7 Pro 32 bit Eclipse with the plug-in.

    The Simulator freezes after a while, it looks like a memory leak. Also, if I use the simulator of 9550's, it could be worse. The simulator of 8350's is the only does not freeze at any time. Anyone happens to know on this issue?

    Problem solved. The directory must be file:///SDCard/xxxxxx

    I misunderstood to file:///Media card/xxxxxxxx, since when I've explore it media, is what shows on the screen.

  • How access to the SD card in my blackberry Simulator

    MA in my application I want to access my SD card but in Simulator how do I access card SD is possible to access SDCard Simulator please help me in this regard...

    Magalie

    I found the solution for this... Thanks to the forum

    to do this, go in this...

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800792/801083/How_To _...

  • Where is internal memory? the Simulator

    Hello

    I took some pictures of camera (9500 of my Simulator) and these were recorded in the "internal memory". I know where is the simulated SD card memory. But where can I find this internal memory?

    Many thanks for any help.

    Not sure I understand the question or asking the reason, but it does not help?

    I think "Internal SDCard" is one of the dmp files you will find in your directory of Simulator.  So not much use for images etc sorry, you need to move these to the SD card and have the SD simulated in a directory on the PC if you want to see these.

  • Problem with writing records on SD Simulator

    Hello

    I am trying to write a file to the SD card in Simulator, with javax.microedition.io.file. *.

    But it does not work.

    It's my code. I chose "C:/Program Files/Research In Motion/BlackBerry JDE 5.0.0/simulator/BlackBerry" to be my location of SD card and tried to create a file named "test_log.txt".

    Javax.microedition.io.file import. *;
    Import javax.microedition.io.file.FileConnection;
    Import javax.microedition.io.Connector;

    FileConnection fconn = null;
    DataOutputStream UO = null;
              
    try {}
    fconn = (FileConnection) Connector.open ("file:///C:/Program Files/Research In Motion/BlackBerry JDE 5.0.0/simulator/BlackBerry/test_log.txt",Connector.READ_WRITE);
    {if(!fconn.) Exists())}
    fconn. Create();
    } else {}
    fconn. Delete();
    fconn. Create();
    }

    UO = fconn.openDataOutputStream ();
              
    ByteArrayOutputStream Bos = new ByteArrayOutputStream();
    DataOutputStream back = new DataOutputStream (bos);
        
    dos.writeUTF ("Start log");
    Temp = Bos.toByteArray ();

    back. Close();
    Bos.Close ();
       
    OU. Write(temp,0,Temp.Length);

    OU. Flush();
    OU. Close();
    fconn. Close();
    }
     
    catch (Exception e) {}
    e.printStackTrace ();
    }

    Hi babyblue_lee

    Your problem is this line:

    fconn = (FileConnection) Connector.open ("file:///C:/Program Files/Research In Motion/BlackBerry JDE 5.0.0/simulator/BlackBerry/test_log.txt",Connector.READ_WRITE);

    You can not choose a windows directory, if you want to write to the SD card, you must code something like this:

    String URL = "file:///SDCard/BlackBerry/documents/";   This is the path to the SD card.

    String filename = "myfile.txt";

    String fName = URL + file name;

    fconn = (FileConnection) Connector.open (fName, Connector.READ_WRITE);

  • write a text file on Simulator 9800

    I'm writing a log for my application file. I used both FileConnection and openDataOutputStream, as shown in the code snippet bellow. In both cases, I can IOException with the message "file system error (1003). The interesting part is that I am able to open the file for reading well. The file is located in the res folder in my project. I use the path \logs\myfilename for playback using getResourceAsStream (path) and it works fine. But openinig it for writing and update fails. Here's the code snippet I "ve used in the entry:"

    String NomFichierJournal = logs/myfilename"."

    String outputfilename = "file:///" + logfilename;
    fconn = (FileConnection) Connector.open (outputfilename, Connector.READ_WRITE);
    OS = Connector.openDataOutputStream (outputfilename);

    The lineis commented on the second method I used. I have two cases, she out exceptions. For reading, I use just the relative path "/ logs/myfilename ' and it works. But it does not work for writing and forums it seems that I had to add the "file:///" which I did, but to no avail. I think there must be a setting I'm missing in the Simulator. I'm really working in the dark regarding the structure of the file on a blackberry Simulator system. A simple example of application is required to read and write to the local file system. It is the most popular activity, I guess that would do any nontrivial blackberry application.

    Thus, any response expertise on this subject will be much appreciated.

    I think you're a little confused about the BlackBerry file system structure.

    Try to browse the root directory and list the names of the directories you will find.

    Once you do this, you will get a better understanding of the file system.

    What I meant by SDCard/store is adding SDCard or store after file:///.

    Also, read the following article.

    http://goo.GL/IeTr

  • How to run SQLite on Blackberry JDE 5.0... ? Simulator of

    Hai,

    How to run SQLite on Blackberry JDE 5.0... ?

    Is it really need all jde settings? for sqlite running applications?

    I use the source-

    class InnerClassScreen extends form {}
         
    sqliteDB public database;
    public InnerClassScreen() {}
                
    LabelField title = new LabelField ("Create DB application",
    LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
    setTitle (title);
    Add (new RichTextField ("initialize db create process..."));
                
    try {}
    URI uri = URI.create)
    "file:///SDCard/Databases/database1.db");
    sqliteDB = DatabaseFactory.create (uri);
    Add (new RichTextField)
    (("Status: database was created successfully."));
    } catch (Exception e) {}
    System.out.println (e.getMessage ());
    Add (new RichTextField)
    (("Status: database has not been created."));
    Add (new RichTextField (e.getMessage ()));
    e.printStackTrace ();
    }
    }
    }

    Unfortunately had the exception-

    net.rim.device.api.database.DatabasePathException: invalid path name. Path does not contains a list of appropriate root. See class FileSystemRegistry for more details.

    Hello
    In your eclipse go to debug configurations in select tab Simulator, in memory of Simulator tab selection in this last use system files from the pc to SDCard policy file box to check this and give some trail (IE any path of the folder) this directory is worked as a SD card in your Simulator...

    Thank you...

  • Write Debug Output to the media under the Simulator map

    I'm testing my application using the Simulator with the eclipse plugin (using the simulated device 9700). Simply, I can't open a file. Here is the code I use:

    try {   // filename = "file:///SDCard/debug.txt"
        fileConnection = (FileConnection) Connector.open(fileName);
    } catch (IOException e) {
        System.out.println("Could not create " + fileName);
        e.printStackTrace();
    }
    
    if (fileConnection != null) {
        try {
            OutputStream out = fileConnection.openOutputStream();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    

    Are there settings specific Simulator which must be defined and who could stop me from writing on the SD card in the device? I put 'Use PC file to SD Card file system' and with the path on my PC where I want the file resides. Any help would be greatly appreciated.

    The file exists in your file? If it isn't, your code does not indicate that you create a file.

    So when you try to open an output stream on a file that does not exist, that would not work.

    Steps to follow:

    -Check if a file exists

    -Yes: Open stream and write to the file

    -No: fileConnection.create)

    -Open the stream and write to the file

    PS Don't forget to close the flow of data and file connection when you are finished.

  • App did not detect the SD card on 4.6.1 Simulator and above

    Hi all

    I test my app on 4.6.1 Simulator 8900. My app has a check as follows:

    Determines if an SD card is installed
    {} public static Boolean hasSDCard()

    EFS of the enumeration = FileSystemRegistry.listRoots ();
    While (efs.hasMoreElements ()) {}
    String root = (String) efs.nextElement ();
    If (root.equalsIgnoreCase("sdcard/")) {}
    Returns true;
    }
    }
    Returns false;
    }

    I created a memoery card named as SD - sdcard.dmp to the location card

    C:\Eclipse\plugins\net.rim.ejde.componentpack4.6.1_4.6.1.49\components\simulator

    But my application is not able to detect the SD card.

    Don't know where im wrong. ? I need to create SDcard in any place?

    The code works fine with 4.5 Simulator...

    Please guide.

    ~ Priyanka

    I use slightly different code to detect the SD card but I guess yours is OK too

        public static boolean hasMediaCard()
        {
            Enumeration e = FileSystemRegistry.listRoots();
            while (e.hasMoreElements())
            {
                String root = (String) e.nextElement();
                if (root.startsWith("SDCard"))
                    return true;
            }
            return false;
        }
    

    Regarding the SD card - try to create a directory in the Simulator file, the name of the "SD card" dir. Start Simulator, simulation menu, change SD Card..., select the previously created directory, you should receive a message at that point MediaCard is inserted.

    And please, for future questions use the Java development forum, you will get more answers there

  • File on Simulator operations

    Hi, I use this for reading and writing of the file on the Simulator, but it still does not work:

    for writing:

    Try
    {
    String data = "Data to save the text file";
    FileConnection fc = (FileConnection)
    Connector.Open (System.getProperty ("file:///SDCard/"+"test.txt"),Connector.READ_WRITE");)  should I ///SDCard?

    I tried also to include test.txt in my project files does not work and I also tried file:///test.txt
    If (!) FC. Exists())
    FC. Create();
    OutputStream os = fc.openOutputStream ();
    Byte [] theByteArray = data.getBytes ();
    OS. Write (theByteArray);
    OS. Close();
    FC. Close();
                           
    }
    catch (Exception GOOSE)
    {
    Dialog.Alert(""+IOE);
    }

    I got an Exception: java.lang.IllwgalArgumentException: URL Null

    Thank you guys

    As other posts have tried to explain, you are close to a solution, just understand a little more.

    (1) can access the files on the SD card using:

    FileConnection fc = (FileConnection) Connector.open("file:///SDCard/test.txt",                                                      Connector.READ_WRITE);
    

    (although you might have to ask the system to the root of the SD card like this: System.getProperty ("fileconn.dir.memorycar");- but this jump until you know how this works a little better)

    (2) you want to access the file in the Simulator (from your application) and the Windows Explorer at the same time?

    Open your JDE and go to Edition-> Preferences-> tab Simulator.

    Now, check the box 'use PC filesystem for files from SD card' and find the path in the field below.

    The folder you choose will actually represent the path "file:///SDCard/" in your application.

    Clean way to do things would then create a subfolder (with your app name?) then you do not write to the root (it's just nicer like that)

    -Remember to change the path in your app in this case (in "file:///SDCard/test.txt")

    After 1 and 2 you will have access to the file in your application, as well as any browser that you use in Windows.

  • See the SD card on the Simulator

    JDE 4.7 on Storm

    I am trying to run code that uses the API signature and because I do not have a signed license yet I can only run on the Simulator for now.

    My code is reading a specific subdirectory within the SD card files. I'm assuming that the top of the SD card is file:///SDCard/ that my directory structure in the upper part of the card is _app_ippub/ippub/and there are a few files in this directory.

    I've read some files and write others (create 1 file).

    Now, I run my app in the debugger by clicking on GO.

    The debugger opens and I run my application. Nothing is typed on the screen (only done when errors occur at the moment).

    I change apps (leaving the conduct of a current) and try to look.

    I select the Simulator menu and change SD card. It pops up a modal dialog where I select Add Directory and punch in the path to my home directory of the SD card that contains the structure directory, I want to... SDCard/_app_ippub/ippub

    It adds to the list of directories. So now, I guess that the Simulator is concerned, the directory on my disk... D:.../SDCard/_app_ippub/ippub is mounted at the top of the SD card as _app_ippub/ippub, and when I go to file:///SDCard/_app_ippub/ippub/filename.png it will access the file on my disk as if it were on the micro SD card.

    Is this correct?

    When I run my application, I see no change in the contents of the disk directory.

    Is it possible to watch the card on the side of the Simulator. I watched memory Options and could see that there was a large SD card (size of my hard drive), whereas before I did the change SD card it did not exist.

    I would like to be able to see the file from the point of view of the Simulator system... is possible to do otherwise than to load an application of file system.

    So far, my problem is that I get no exception, but I don't see any file created in my disk space (via Explorer).

    Some advice in this area would like to thank appreciated. Also answers to the above questions.

    Thank you

    -Donald

    I'll close that I found the problem (IOException when you try to connect to the SD card), but I wasn't using the right code to get the name of path, so I need to create a different problem instead... associated with System.getProperty

  • Read the files using BlackBerry device Simulator...

    In the device Simulator if you take a photo using the camera option it shows that it is saved as a .jpg file.

    I can read such a file using the FileConnection method? This file is real?

    Or should I use a real BlackBerry device to simulate it?

    Because what I'm looking for is to read the image stored in the device and attach it to an email and send it.

    But it seems as if this file is not accessible, even if I give the path of it.

    For example:

    FileConnection fconn = (FileConnection)Connector.open("file:///SDCard/BlackBerry/picture/IMG00017.jpg");

    Can anyone give a solution for this?

    Third-party applications are not able to read the example of media (pictures, sounds, etc.) which is preinstalled on a BlackBerry handheld.  You should be able to read files created by the user or other applications.

Maybe you are looking for