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

Web and WebWorks Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 66
Registered: ‎09-14-2011
My Device: Simulator
My Carrier: Developer

saveFile working in one emulator and not working in another

In my application i'm converting data into json object and i'm writing those onto a file.

I wrote code in such a way that if tha filePath exists then dont do anything else create a file with default json object

i'm using this code

 

var fileLoginInfoPath = "file:///store/home/user/AppData/ClientLoginInfo.txt";
var loginInfo = [{RememberMe:"2",GroupId:"",Pin:""}];
    //if the file dosent exists, that means the user is using the application for 1st time so create file
  	var content = JSON.stringify(loginInfo);
	try {
      if (!blackberry.io.file.exists(fileCookiePath)) {
    	  var blob = blackberry.utils.stringToBlob(content, "UTF-8");
          blackberry.io.file.saveFile(fileLoginInfoPath, blob);
      }
    }
	catch (e) {
	    alert("error in creating loginInfo file:"+e);
	}

 

 this code is working perfectly when execued on "Bold 9770" emulator running on 5.0.0.469 os version

but same code is giving "net.rim.device.api.io.file.FileIOException:File Not Found" exception on "Strom2 9550" running on same os version ie., 5.0.0.469 and also it is giving same excetion when i tried running on "Torch 9800" running on 6.0.0.227 os version 

 

why is it like that??

 

Developer
Posts: 66
Registered: ‎09-14-2011
My Device: Simulator
My Carrier: Developer

Re: saveFile working in one emulator and not working in another

Anyone???
i'm still looking for the solution