Main menu:

View Leonardo Risuleo's profile on LinkedIn
Forum Nokia Champion
Janus Symbian Engine Open Project
FITC Mobile 2009
SEE 2009 - Symbian Exchange & Exposition

showUsYourMouthOff

    .mobiledevjobs

    .upcoming events

    site search

    .categories

    .archive

    Add this to my technorati favorities
    Add .byte-sms_blog EyeMag widget
    Add to Google
    Add to My Yahoo!
    Subscribe in NewsGator Online
    Add .byte-sm's blog - Leonardo Risuleo Mippin widget
    Add to my Widsets

    Flash Lite tool: WriteFile for S60 2nd & 3rd edition

    writefile

    WriteFile is a Symbian.c++ tool that gives to mobile flash developers the capability of saving text files on Symbian devices.

    This new version (see my previous project) is fully compatible with both S60 2nd and 3rd edition flash-enabled phones and works great with Flash Lite 1.1, 2.0, 2.1 embedded players. WriteFile can be used for save games, for saving user’s options configuration or anything you want (in theory with FL 2.0 could be possible even save xml files, but I’ve not tested yet).

    How it works

    WriteFile simply achieves the communication with Flash Lite player in order to handle commands and perform the saving process (which it’s impossible for FL 1.1). It consists in a Symbian exe engine that starts a local web server on phone listening for incoming request.

    Flash make the request using loadVariables api and by passing three variables with POST method:

    • method: replace or append (write/replace the file or append content to it; note that if specified file does not exists it will be created)
    • path: the path of the output file (on same drive of exe if without drive specification)
    • cont: the content to be written

    How to use it

    To use WriteFile correctly you have to follow three steps: launch exe engine, perform write command and, at the end, stop the engine.

    The operation of launching the engine can be performed by FSCommand2 “Launch” function only on Symbian S60 2nd edition. To make the same operation on 3rd edition, the engine have to be launched throw the same application that launch the Flash Lite project (if you have no idea about this process, refer to my devnet article about this topic).

    To perform write command you have to do something like this:

    method = “REPLACE”;
    path = “\\Others\\hello.txt”;
    cont = “Hello world from Flash Lite!”;

    loadVariables(”http://127.0.0.1:1080/writeFile”, “targetMC”, “POST”);

    And to stop the engine simply call:

    loadVariables(”http://127.0.0.1:1080/Close”, “targetMC”);

    Download WriteFile for S60 2nd edition

    downloadExample S60 2nd edition application (sis)
    codeExample project source code (carbide project + fla)
    linkEXE engine – 2nd edition (zip)

    Download WriteFile for S60 3rd edition

    downloadExample S60 3rd edition application (sis)
    codeExample project source code (carbide project + fla)
    linkEXE engine – 3rd edition (zip)

    If you would like, test it and feel free to use it in your own projects… Any comments or suggestions are appreciated.

    Note: Flash Lite files (fla) are located in sis folder. The tool was tested on 6630, N70, N73, N80, E61.

    THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THESOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    Comments

    Comment from Luciano Ayres
    Time: January 28, 2007, 1:41 pm

    Great job, Leonardo! Thanks for sharing.

    Pingback from ~kuneri bloggy » WriteFile for 2nd & 3rd edition
    Time: January 28, 2007, 3:56 pm

    […] Leonardo announced availability of his Flash Lite WriteFile tool for S60 2nd and 3rd edition devices. Well done! WriteFile is a Symbian.c++ tool that gives to mobile flash developers the capability of saving text files on Symbian devices. New version is fully compatible with both S60 2nd and 3rd edition flash-enabled phones and works great with Flash Lite 1.1, 2.0, 2.1 embedded players. WriteFile can be used for save games, for saving user’s options configuration or anything you want […]

    Pingback from biskero.org
    Time: January 28, 2007, 6:09 pm

    […] Leonardo created the Write2File tool for Symbian phones. The tool helps to write text data to a local file on the phone. Alessandro […]

    Comment from chall3ng3r
    Time: January 29, 2007, 2:15 am

    great work.

    // chall3ng3r //

    Comment from fandango
    Time: January 29, 2007, 8:34 am

    Perfect work! greetings to you…

    Comment from bglite
    Time: January 29, 2007, 9:36 am

    Cool.!!!….,thank you.

    Pingback from Flash Lite For Mobile Game Developers » Blog Archive » WriteFile application: save data on Flash Lite enabled Symbian devices
    Time: January 29, 2007, 10:56 am

    […] Leonardo released his WriteFile application for 2nd & 3rd edition Symbian devices. The application is meant for Flash Lite enabled phones, and works with Flash Lite 1.1, 2.0 and 2.1. Using this application, one is able to for example save game data or user’s configuration options to device.  It’s really cool, so go check it out! […]

    Comment from Dimitry
    Time: January 29, 2007, 12:19 pm

    Excellent job, Leonardo!
    Thanks it will be usefull

    Comment from Alex
    Time: January 29, 2007, 12:37 pm

    Thank a lot, Leonrdo!! That’s great!

    Comment from redzvika
    Time: January 29, 2007, 2:49 pm

    Hi Leonardo ,Great job

    I’m a Symbian developer, I’m creating an application with logic and storage in Symbian app and display in flash.
    I’m using flash 1.1 player.

    I’m encountering problems with flash to use the fscommand on the 3rd Edition phones , for example N73

    The flash can’t launch browser using fscommand .

    The solution is to use the internal http server .

    I have seen your solution , I think I can add more functions to the http server

    Can you post the source code .

    Comment from leocrawf Stewart
    Time: January 29, 2007, 4:38 pm

    I love this app. I have been waiting for it for a long time. I have one question how did you create a sis for the s60 3rd edition.

    Comment from byte.sm
    Time: January 29, 2007, 9:30 pm

    thanks for all your feedback, at the moment I’m not at home, and i will take care of you only Thursday…

    cheers,

    Leonardo

    Comment from Marcos
    Time: January 30, 2007, 1:38 am

    […] Leonardo ha creado la herramienta Write2File para teléfonos basados en Symbian. La herramienta permite la escritura de datos en formato texto en una fichero local del dispositivo […]

    Pingback from BlocketPc » Write2File
    Time: January 30, 2007, 1:41 am

    […] Via biskero.org descubrimos esta herramienta creada por Leonardo para teléfonos basados en Symbian: Write2File. La herramienta permite la escritura de datos en formato texto en una fichero local del dispositivo… fantástica funcionalidad! […]

    Comment from redzvika
    Time: February 1, 2007, 1:28 pm

    Hi Leonardo ,Grat job

    What does the server return to the flash player
    I’m trying to develop a server with more options

    The SWF file writes

    POST /writeFile HTTP/1.1
    Host: 127.0.0.1:1080
    Connection: close
    Content-type: application/x-www-form-urlencoded
    Content-length: 79

    what is the servers reponse , my solution hangs the SWF file.

    Comment from byte.sm
    Time: February 1, 2007, 1:46 pm

    hi,

    you can use the standard response format… see here:

    tcp/ip guide

    Leonardo

    Comment from byte.sm
    Time: February 1, 2007, 6:55 pm

    Hi I have to add one consideration, which may be not understood from the post: this tool works in asynchronous way, it means that flash lite can know WHEN the operation is done and if all is good or if some errors happen.

    Leonardo

    Comment from Ryan Unger
    Time: May 1, 2007, 5:26 pm

    I just love this tool. Thanks!!

    Comment from James
    Time: August 23, 2007, 11:31 am

    Sounds very promising, but will the POST cause the Access Point prompt in Flash Lite to be automatically shown? If it does, then that would cause a usability issue. Thanks!

    Comment from byte.sm
    Time: August 23, 2007, 2:42 pm

    Hi James,

    no, the Post request does not cause the Access Point prompt…

    Leonardo

    Comment from Sandeep
    Time: August 25, 2007, 6:11 am

    Hi Leonardo,

    Can you please post the source code of write 2 file so that we can add more functions to the http server? It will really solve our problem and we will be really thankful to you. Waiting for your positive response.

    Regards
    Sandeep

    Comment from Sally
    Time: September 5, 2007, 9:30 pm

    Thank for making this valuable information available to the public.0

    Comment from xone
    Time: September 26, 2007, 2:54 pm

    when i’m trying write file from Flash Lite 2.1 i’ve got “Generic error”.. :(

    Comment from byte.sm
    Time: September 26, 2007, 3:57 pm

    hi xone,

    are you sure you’re using the correct syntax? please, check .fla example files to know how it works…

    Leonardo

    Comment from xone
    Time: September 27, 2007, 7:45 am

    Hello..
    i’m useing correct syntax but i made function that i wanted use when i need..
    something like:

    function saveXML () {
    var method = “REPLACE”;
    var path = “\\Data\\Others\\test.xml”;
    var cont = “”; //here some sample xml

    loadVariables(”http://127.0.0.1:1080/writeFile”, “targetMC”, “POST”);
    }

    but when i made test file with the same code but on _root timeline it’s working..
    is there any solution to use it in function?

    Comment from xone
    Time: September 27, 2007, 8:24 am

    the other problem is when i wanna create cont dynamically..
    writeFile don’t write it and closing even when i don’t call “Close”..

    Comment from byte.sm
    Time: September 27, 2007, 10:04 am

    hi,

    the problem would be that parameters comes to the server in a dirty way… check sent variables to see if all is ok!!

    Leonardo

    Comment from Souhieb
    Time: October 28, 2007, 12:40 pm

    Good for you Leonardo, great job fellow, I’ve tested this engine in 2′nd and 3′rd editions Mobiles and it works fine, but there is something to mention here, I notice that some times the engine exits when writing utf-8 arabic characters above some size,-it works fine for 7-10 words but when trying to save a long sentence it fails- I don’t know why but maybe because of buffer size, it will be great if it could save long arabic sentences, but all in all its great Leonardo, thank u.

    Comment from sweety
    Time: November 19, 2007, 7:54 am

    i did the following procedure and got an internet error:
    1. installed the sis file for 3rd edition.
    2. copied the swf file

    and executed.
    i have not created the server. can u please tell me how to do the same.

    Comment from shwetha
    Time: November 19, 2007, 8:26 am

    hello again,

    i have a flashlite program that needs to write itz contents to a file.
    how can i use your logic in my program.

    I ran your sample program and that works great!!!
    i want the same thing to be called from my flashlite program…. can u please help…

    Comment from shwetha
    Time: November 19, 2007, 8:27 am

    hello ,

    i have a flashlite program that needs to write itz contents to a file.
    how can i use your logic in my program.

    I ran your sample program and that works great!!!

    i want the same thing to be called from my flashlite program….
    my flashlite will gives the file name and contents to be written as parameters
    can u please help…

    thanks in advance

    Comment from Philippe
    Time: March 1, 2008, 2:33 am

    Hi,

    I use WriteFile for a long time now and this is really a good app. Great job!

    I’d like to know if it would be possible :
    1/ to create a file containing a long binary string?
    2/ to store a complete swf file loaded from a server (using loadmovie) to reuse it locally afterward?

    Thanks in advance for your answers.

    Philippe

    Comment from Kiran Prabhu
    Time: June 2, 2008, 8:48 am

    Could you please tell me the implementation of your writeFile in my application.

    I am just creating an application that stores address details of individuals in xml file locally (in device).

    I tried to installing your example application but it was not installing due to expiry of certificate. Could you solve this issue please?

    Comment from Alone
    Time: June 25, 2008, 4:22 pm

    How can i do an application in flash lite to connect in write file?
    i tried to make use the same loadVariables(”http://127.0.0.1:1080/writeFile”, “targetMC”, “POST”); but this give an error message “server not found” i want to put the txt file and the swf in the same folder.
    can you help me?

    Comment from Alone
    Time: July 3, 2008, 4:10 pm

    please

    Comment from hemant bansal
    Time: November 19, 2008, 2:19 pm

    Hi All,
    Great work!!But can anyone tell how it can work on flash plyaer 3.0 or it cant work on that.Pls anybody help.
    Thanks
    Hemant

    Comment from byte.sm
    Time: November 25, 2008, 3:33 pm

    Hi, you can find some new resources about multi langage programming (including Flash Lite tips) for Symbian OS on developer.symbian.com ;-)

    -Leo

    Write a comment