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
yyhokenny
Posts: 38
Registered: ‎07-29-2008
My Device: Simulator
Accepted Solution

Transfer file to and from simulator?

Does anyone know how to transfer file to and from simulator? (I don't mean loading java program... I want to debug file generated by a program.)  I did some searching on the forum but no luck.  (I guess most people here are developing with actual devices?)

Please use plain text.
Developer
rafo
Posts: 507
Registered: ‎07-15-2008
My Device: Not Specified

Re: Transfer file to and from simulator?

In the Java Development Environment folder there is folder "simulator" - it is simulator "file system" folder.

 

Copy your cod file(s) to this folder and restart the simulator.

 

To clean the simulator file system - run clean.bat file, located in the same folder.

 

If you wish to only clean persistent store of the simulator - do not run clean.bat, but delete manually all *.dmp files in this directory and restart the simulator.

----------------
if your issue solved set "Solution" mark at the relevant post
Please use plain text.
Developer
yyhokenny
Posts: 38
Registered: ‎07-29-2008
My Device: Simulator

Re: Transfer file to and from simulator?

If I use JSR75/FileConnection to create a file or directory, will it appear there?  Or will it be in the dmp file and unreadable?
Please use plain text.
Developer
rafo
Posts: 507
Registered: ‎07-15-2008
My Device: Not Specified

Re: Transfer file to and from simulator?

Check here an example to access file on media card.

 

In case you have written some files on mediacard in simulator - all files (along with other information, like persistent objects) will be written inside of the one of simulator *.dmp file. *.dmp files are device memory image files.

 

 

----------------
if your issue solved set "Solution" mark at the relevant post
Please use plain text.
Developer
yyhokenny
Posts: 38
Registered: ‎07-29-2008
My Device: Simulator

Re: Transfer file to and from simulator?

Right.  I know about the input stream, file connection, etc., it's just the matter of varifying the output is correct.  Are there utilities out there that would allow me to extract information from the *.dmp files?  Does it follow some kind of standards?

 

(Thanks btw, you have been very helpful.) 

Please use plain text.
Developer
rafo
Posts: 507
Registered: ‎07-15-2008
My Device: Not Specified

Re: Transfer file to and from simulator?

As far as I know there is no standard on dmp file format. It is a RIM proprietary format. And there is no tool to extract data from a dmp file.

 

I would recommend you to create additional simple application, that reads file from SDCard.

 

And run this application after your text file has been saved. Run this application and read all contents of file and show it into screen.

 

I think it would be a good and reliable verification.

----------------
if your issue solved set "Solution" mark at the relevant post
Please use plain text.
Developer
rafo
Posts: 507
Registered: ‎07-15-2008
My Device: Not Specified

Re: Transfer file to and from simulator?

To be 100% sure that the file saved correctly - use hashCode() method of the loaded string data.

 

If hashCode() of written and loaded text are equal - your file has been saved properly.

----------------
if your issue solved set "Solution" mark at the relevant post
Please use plain text.
Developer
richard_puckett
Posts: 191
Registered: ‎04-03-2008
My Device: Bold 9700

Re: Transfer file to and from simulator?

The SD card dmp file appears to be FAT12 - at least that's what it calls itself (0x36 - 0x3A in the boot sector).  I've entertained the idea of creating a file explorer for SD card dmp files but just don't have quite the amount of Copious Free Time needed to do it.

Please use plain text.
Developer
yyhokenny
Posts: 38
Registered: ‎07-29-2008
My Device: Simulator

Re: Transfer file to and from simulator?

Ah... cool.  Thanks for all the information guys.  I tried using WinImage on the dmp file and it worked!  I think other image/iso mounting software should work as well.
Please use plain text.
Developer
KarlH
Posts: 29
Registered: ‎09-12-2008
My Device: Curve 8330

Re: Transfer file to and from simulator?

[ Edited ]

So Mark, or Peter, or some other Blackberry folks, why does the simulator not support Mass Storage Mode like the real devices do?  Seems like a logical thing to support, and it would allow placing files on the disk image for testing.

 

By the way, using the Desktop Software 4.3.0.17 I am able to transfer files to and from the simulator's internal (not SDCard) memory.  After upgrading to Desktop Software 4.6 that capability went away, so I downgraded again.

Message Edited by KarlH on 09-19-2008 05:59 PM
Please use plain text.