1

I am storing all the config details to a test.cfg file in my BlackBerry device. So every time when i start the application, the app will check if test.cfg exists. If it exists, then it loads all the configuration from that file and if not, the app will show the config page, then the user can enter all the config details and proceed further.

The above is working fine except one scenario. When the device is plugged in to the system and I open the Desktop Manager and the user opens the application, its directly shows the configuration page even if test.cfg already exists in the device.

Does anybody know the solution for this? or any idea why its behaving like this?

Nate
  • 31,017
  • 13
  • 83
  • 207
mindus
  • 209
  • 2
  • 12

2 Answers2

1

My guess would be that when you connect your device to the computer via USB cable, your computer is mounting the SDCard as an external drive. When it does this, the device will essentially lose access to its SDCard. It needs to do this, because the device software and the desktop computer's software don't want to simultaneously be modifying the same files.

Are you saving test.cfg on the SDCard?

If so, you might want to save the file to the device's internal storage instead, for example, in the PersistentStore.

You could turn off the mass storage feature that makes your SDCard available to the PC, if you prefer to have the media card always available to the app. (if you want to do this, tell me which OS version you're using ... but, understand that this only works for you, and isn't a good solution if you want your users to avoid this problem).

You can also test for the SDCard in your app, programmatically

References

Reference on BlackBerry support forums

Data Storage Development Guide on BlackBerry.com

Community
  • 1
  • 1
Nate
  • 31,017
  • 13
  • 83
  • 207
  • yes,its an exceptional case when device is connected to PC because Blackberry says "when device is connected to PC,BB is not controlling file system of device"..control is under OS of PC. – Preetam Jadakar Jul 22 '13 at 05:36
  • Is that possible to display the message in the application, that what we are getting while accessing the media -> Explore folder when the device is connected to the system. The message is as fllows - "To access built-in or media card storage from your device, disconnect your device from your computer." The above message is shows when we are trying to access the explore folder when the device is connected to the system – mindus Jul 22 '13 at 06:17
  • 1
    @krishIndia, sorry, I can't quite understand what you're asking. Are you asking whether your app can show the user a warning message if it cannot find the SDCard? Sure, you can. However, as I suggested in my answer, it might be better to store your configuration information on device storage, which is always available. It's more common to store app configuration data in the [PersistentStore](http://docs.blackberry.com/en/developers/deliverables/29299/Storing_objects_persistently_1554312_11.jsp). – Nate Jul 22 '13 at 09:13
0

Go to option -> Device -> Storage and deselect and select the media card support and save it and come out the option.Now try to access the media -> explorer folder u can able to access it and also my apps can read the file when its connecting to USB drive now.

mindus
  • 209
  • 2
  • 12