Save and open the remote aspx file on the device

Hello.

IM developing a widget that opens up to a distance of webfilehttp://11.11.11.11/myHtmlPage.aspx. I need it to be available offline that I have but I would like to put the HTML on my SD card.

My question is. How to save the file with all its html and how can I open it so that it opens as a Web page.

Here is a code snippet which does not really. (he opens the file stored on the sd card, all right but with the text http://11.11.11.11/myHtmlPage.aspx instead of the html code that was in the original file

var

filePath = file:///SDCard/myDataFile.html;

function

openFile() {}

blackberry.io.file.readFile (filePath, readFile);

}

function

{saveFile()}

object var blackberry.utils.stringToBlob = blob ('http://11.11.11.11/myHtmlPage.aspx'); ("' saved file");

blackberry.io.file.saveFile (filePath, blob);

}

I think the problem lies in the following snippet:

var blob = blackberry.utils.stringToBlob('http://11.11.11.11/myHtmlPage.aspx');"file saved");

stringToBlob does not have an HTTP request for the value you provide.  It turns out some string that is received in a blob object.

You will need to use XmlHttpRequst to make a Web request to the given page and then use the results of this HTTP response in the call to the stringToBlob method.

Does that make more sense?

See you soon!

Adam

Tags: BlackBerry Developers

Similar Questions

Maybe you are looking for