Blackberry cfg file not found when device connects to computer and Desktop Manager open - blackberry

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?

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

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.

Related

How to create a server for your app to load files

I am not sure even if i am using the right term "Server".
So many apps has this feature now a days where you go to setting and it shows you a local IP. Using the IP you can upload files to the app from a locally connected computer. This is very handy if you don't have iTunes to upload files or a usb cable to connect your device.
My question is what is this feature called? Any reference to API/Examples i can look into?
Here is an example of Comic Flow app with the same feature:

Debugging & accessing NSDocumentsDirectory in real device

I have my apps using NSDocumentsDirectory for saving the downloads & offline data on device. From debugging point of view, I was debugging as usual on simulator & was trying to access the path for these downloads & I was able to do that. I have my doubts as :
I am not able to access the location /var/mobile/Applications/SOME-HEX-CODED-PATH/Documents/ via terminal that was shown in the NSDocumentsDirectory paths during debugging on device. Whereas in iOS Simulator I am able to open , read/ write at that location.
I am not able to browse through the /var/mobile directory as it is not listed in the finder, not even as hidden directory.
Is that directory is mounted on runtime ?
Please clarify.
I am not sure to fully understand your question. You want to access, from your laptop, the filesystem of your device?
You are not supposed to do that on a regular device at least. If you want to browse your documents directory do it through the organiser (Window/Organiser) and then "devices" tab and select your device and your app. You will be able to see your sandboxed filesystem in the bottom part and downloaded its content.

How can I export an iPad app's data to a computer?

I have a simple survey iPad app. The data is saved in a TSV (tab separated file). I'm looking for an easy way to export this TSV file to a computer (without emailing it, if possible, and without doing it through iTunes).
App data on iOS is not directly accessible from a connected computer. It's not like you can mount the iPad's flash drive directly on a computer, navigate to the app's data directory, and copy the file to the computer. You have to have something with rights to access the data.
Some options are:
email or otherwise 'share' the data from within the iPad app.
Make the app's data accessible via iTunes
Turn the app into an FTP client or server
Dropbox integration (There was some problem where Apple was rejecting apps that did this, but i don't know the current state)
Have a look at IExplorer. It's a great little program / app that let's you access your iPad's file system from your computer. You can just drag and drop any file from your iPad to your computer.

How to debug BlackBerry devices on Mac using the filesystem?

How exactly do you go about debugging BlackBerry apps that utilise the (BlackBerry's) filesystem on Mac?
I'm currently recording video and detecting when the video file appears on the file system, however due to the restrictions:
The BlackBerry file system is auto-mounted when plugged into a Mac
The app cannot access the filesystem when mounted
These two things have made debugging the app when it uses the filesystem.. impossible! We receive a file system error 1003 which according to the results from google mean it's mounted and you don't have access.
Is there a a simple way to get round this?
I also receive 63 signing emails from RIM. Woe is me
The workaround is a bit cumbersome, but it should work for you.
Implement EventLogger instance in your application.
Log all necessary info via EventLogger
Compile and run your app on the detached device from your computer.
Inspect log (press CTRL and hit LGLG on the device keyboard). As an additional option - automatically export log to a text file stored in the device filesystem (media card) to review it on your computer.

How to copy html files to ipad and then launch in a browser

Here's a crazy question...The client wants a web application to be available on the ipad when not connected to the internet. My first thought was that it would be a great opportunity to use the offline app feature of HTML5, except that the entire web app (including all the media) is 3GB, and apparently all of it must be available. This exceeds the 5MB limit of the app cache. The website does not necessarily have to rely on any dynamic server side code. It can be straight HTML files. Does anyone know if it would be possible to manually copy the entire website onto the ipad and from there easily launch it in a browser? I was not able to do this, but I have to believe there's a way. Any other approaches to this problem that you can think of? Thank you.
I had a similar problem and here's what I found that worked (using an iPad and a PC):
Download (on the PC) the program HTTrack to the PC. This program can create an offline mirror of a website and has all sorts of options for what gets included.
Run HTTrack on the PC and create a folder for your website.
Install (on the iPad) the free App "Documents 5" by Readdle.
Connect Documents 5 to some sort of cloud based storage (I used by Google drive account, but I'm sure Drop Box would work also)
Zip the entire offline website folder mirrored using HTTrack and upload the zip file to cloud storage (Google drive)
Click on the zip file in Documents 5. It should be downloaded to the iPad
Click on the downloaded zip file in Documents 5. It should be automatically extracted.
Now open the extracted folder and click on index.html. This is your website offline.
I don't know if there is a way to move the index link to the home screen...
There are several apps that can be used for storing files on the iPad and viewing them in an embedded browser. I use GoodReader, but this might be overkill for your purpose.
I've been able to view them using FileApp (after transferring via DropBox), but it's far less than ideal.
Use hightail.com, you can link a website as a space, it will actually convert the website to preview image, then can be access on iPad as webpage in browser, no need to copy file to iPad or install any software.

Resources