Topic: Does SWF2Go have download and calendar plugins?

I’m working on a Flash Lite project which needs to download a file from an external server and download it onto the phone as well as add notifications to the phone calendar.  Originally we were planning on using Kuneri Lite, until Kuneri informed us that they are no longer supporting/providing commercial licenses for that product.  I’m therefore looking for an alternative that will allow us to easily recreate this functionality and was wondering if SWF2GO would be a good option.  Does SWF2Go have already written download and calendar plugins?  How easy is it to use SWF2GO to add these functions to a flash lite project?

Thanks in advance.

Re: Does SWF2Go have download and calendar plugins?

Hello David,

Yes, SWF2Go supports many frameworks and plugins to use advance devices APIs in Flash Lite games and applications. You can download files and make changes in device's calendar using these frameworks.

SWF2Go sets you free to use best framework or plugins for your applications. You can use Open Source PyS60 based frameworks (Flyer / SWF2Go's mCore), Forum Nokia's APIBridge or even your custom written C++ APIs framework.

The most easiest option to get started is using PyS60 with a template server mCore, which comes with SWF2Go. SWF2Go 2.5 supports latest PyS60 2.0, you can use all possible APIs exposed in PyS60 in your Flash Lite applications.

You can try the "Be My Lips" sample application which demonstrates using Text To Speech APIs using PyS60. http://www.swf2go.com/wiki/PyS60Sample_BeMyLips.ashx

Visit PyS60 project page to download latest build and documentation https://garage.maemo.org/frs/?group_id=854

Let me know if you have any more questions, I'll be glad to help.

Regards,

// chall3ng3r //

Re: Does SWF2Go have download and calendar plugins?

Thanks – do you know if anybody has written a download file from server Python script.  The nearest I could find is this

Re: Does SWF2Go have download and calendar plugins?

Hello,

There are tons of examples for Python. With PyS60 2.0 most of the regular Python scripts work without modifications.

For example take a look at the following link:
http://stackoverflow.com/questions/2267 … ing-python

You can add this simple script in mCore server which is used with Be My Lips application.

For example:

def donwload_file(attributes):
    print ">> downloading file:" + attributes["fileurl"]
    import urllib
    urllib.urlretrieve (attributes["fileurl"], "mydata.xml")

And register this function in the server's callback list

server.addCallBack("donwload_file", donwload_file)

You can call this function from your Flash Lite application using the following URL:

http://localhost:2190/donwload_file?fileurl=mydomain.com/file.xml

Please note this method should be used for small file downloads. If you need to download bigger files, you may have to start download in separate thread, and poll the server for download complete.

You might also like to take a look on another easy to use Python networking framework named Eventlet. http://eventlet.net/

I hope this helps.

Best,

// chall3ng3r //

Re: Does SWF2Go have download and calendar plugins?

Hi David,

I found another option for you. It's an Open Source server for Flash Lite written in Symbian C++. You can learn from it to write your own native S60 server, or extend it for your specific needs.

http://sourceforge.net/projects/intelligerefls/

Best,

// chall3ng3r //

Re: Does SWF2Go have download and calendar plugins?

Thanls for your help – it really is appreciated.

I tried using Intelligere Flash Lite Server however when I tried installing the precompiled sis files I got certificate errors, then after compiling it myself using offline open signing got the demo to install but it just gave a generic error message.

Stuart, my boss, has bought a copy of SWF2Go and I’ve got it to download a file and at the moment I’m trying to get the file downloader to run in a new thread as otherwise the server won’t close probably is something is still being downloaded.  Do you know if there’s an easy way to debug python the script when running on the phone (i.e at the moment the server just fails if it doesn't work rather than giving a message saying which line of code failed and an error code)?

Last edited by FP_David (24-06-2010 12:43:07)

Re: Does SWF2Go have download and calendar plugins?

Hi,

I haven't used Intelligere Flash Lite Server myself, as I prefer PyS60. Maybe there's some bug in it. Or maybe you didn't selected correct capabilities. There are whole lot of issues with native S60  servers smile

Anyway, debugging PyS60 is very easy. You have many options to do debugging.

  • Make a simple logging function to write your debug messages to a log file (I personally use this method)

  • Make a remote/network logging utility. Rather than writing the log messages to file on phone, you can send them to a PC in your local network over WiFi connection

  • Make a file logger as mentioned above, but on the same device. Create a log viewer PyS60 app, which automatically re-reads the log file and shows it in readable way on regular intervals

  • Maybe there could be more ideas on internet for effectively debugging PyS60 scripts

As I mentioned, I use the first approach. I connect my device via BT to PC, and open the log file directly from the BT connected device. I've set my text editor to re-read the file if it changes, so I see the latest log messages as soon as they get write from the logger function.

Here's a sample logging function:

    def log(self, mesg):
        "Writes the debug.log file"
        mesg = mesg + u'\n'
        print mesg
        f = open('e:\\myapp.log', 'a+')
        f.write(mesg)
        f.close()

BTW, you can debug the entire application, Flash Lite + PyS60 script on PC using Device Central and S60 SDK installed with PyS60 SDK. I used this approach, and it was quite effective to rapidly test the application in early development phase. Once my app was mature, I moved to on-device logging based debugging.

I hope this info helps you smile

Best,

// chall3ng3r //

Re: Does SWF2Go have download and calendar plugins?

The app works on phones such as the N97 which allows the user to set a default connection, however I’ve discovered a problem on the N95 (where setting a default connection for all apps is, as far as I’m aware, not possible).  If you connect to the Internet via the Python script then nothing happens if it cannot connect to a network, unlike in Flash when it displays an access point dialog box.  I’ve written the following Python script to display an access point box:

import btsocket
btsocket.set_default_access_point(btsocket.access_point(btsocket.select_access_point()))

This works when I run it through the Python script shell however when I use SWF2Go to integrate the Python with my flash lite SWF no dialogue box displays.  Do you have any ideas why this might be?

Last edited by FP_David (12-08-2010 10:09:34)

Re: Does SWF2Go have download and calendar plugins?

Hello,

My best guess is some S60 capability is missing for the background Python script server. Try recompiling with the following capabilities:

- ReadUserData
- WriteUserData
- NetworkServices
- LocalServices
- UserEnvironment
- Location

You can set these in SWF2Go Options window. SWF2Go will apply these capabilities to both, main SWF launcher as well as on Python script server.

Do let me know how it goes.

Best regards,

// chall3ng3r //

Re: Does SWF2Go have download and calendar plugins?

Thanks for your reply, I’ve tried adding those permissions (and afterwards all the permissions that offline signing will allow!) however the access point dialogue still doesn’t pop up when it tries to connect to a network or when I use the select_access_point Python call.

Do you know if the SWF file running in the foreground stops Python script bringing up a dialogue box?

Re: Does SWF2Go have download and calendar plugins?

Hmm, I thought only capabilities are required hmm

I am gonna try it in a couple of days and see if I could manage to get the AP selection dialog popup.

Meanwhile, there's another option. PyS60 have APIs to get list of all AP set in device, you can try to fetch the list, and show a custom AP selection option in your Flash app. PyS60 also have APIs to use the manually specified AP to connect to internet.

I will take a look if I can make some running sample code for you.

Best regards,

// chall3ng3r //

Re: Does SWF2Go have download and calendar plugins?

Hi David,

I had a little time to search for a solution for you. I found this working sample for AP selection:
http://wiki.forum.nokia.com/index.php/S … _in_python

Please note that SWF2Go starts the PyS60 script in background in console mode, PyS60 scripts running in console mode cannot use appuifw for UI interactions.

What you can do is, fetch the list of APs using socket.access_points() and show in Flash Lite app, display a selection list there, once user selects the AP, use it to connect to internet by apo = socket.access_point(apid) or even set it as default AP socket.set_default_access_point(apo) for further communication.

Best regards,

// chall3ng3r //