Obviously, a big part of the project will involve parsing XML in Python. This can easily be done in 'normal' Python but Mobile Python does not come with any XML parsing packages. The only one I've found so far is cElementTree.
Downloaded here: http://ssalmine.googlepages.com/somepys60extensions
The desktop version here: http://effbot.org/zone/celementtree.htm
Anything else out there?
UPDATE: pexpat (or something like that) was recommended. Haven't tried it yet.
Friday, May 9, 2008
PyS60 XML Parsing
Wednesday, May 7, 2008
Some useful links
A collection of extension modules for S60:
http://wiki.opensource.nokia.com/projects/PyS60_extensions
http://cyke64.googlepages.com/
To get a .sis file signed
https://www.symbiansigned.com/app/page/public/openSignedOnline.do
How to use SQL on S60
http://wiki.forum.nokia.com/index.php/How_to_use_SQL
Code examples for S60
http://wiki.forum.nokia.com/index.php/Category:Python#Code_Examples_for_Python
Tuesday, May 6, 2008
WLanTools
Anand and I just tried wlantools to check for a certain AP's MAC address. We had the program loop every 10 seconds and check all the MAC addresses it found. We set it to the Grad Lab's AP's MAC address and walked around the 3rd floor. It worked. The code we used:
import wlantools, e32
while 1:
b=0
a=wlantools.scan(False)
for i in a:
if i['BSSID']==u'00:1C:57:89:BB:20':
b=1
if b==1:
print "Inside"
else:
print "Outside"
e32.ao_sleep(10)
Monday, May 5, 2008
While talking with Kostas:
XML:
- LoCal node will always have a userid attribute except for the first request from client to server. First request will have login information and server will respond with userid.
- Add/update/delete nodes in the request from a client will be wrapped in sync node. If sync node is empty then server will only sync. If sync is not empty, child actions will be handled first.
- For handling lost connection we'll need to have try catch blocks.
- We need to sit down and write out all possible communications between client/server before starting to code
- We can start coding by creating classes for handling xml parsing and db queries.
XML parsers for php:
http://us3.php.net/xml
http://www.criticaldevelopment.net/xml/doc.php
UPDATE (5:21pm): [by Kostas] also all item lists need to be wrapped in <itemlist>
Sunday, May 4, 2008
Wifi module
- Goto http://www-rp.lip6.fr/~berger/pys60_exts/ and click the last link : wlantools-PyS60_1_4_1_3rdEdFP1-unsigned.sis
- Get the file signed and install it on your phone.
- Use import wlantools to import the module and wlantools.scan() to get a dictionary of information about the wlan you are using. The BSSID element gives us the unique identifier that we need for the WLAN.
How to sign and use unsigned .sis files
For security reasons, Nokia decided that modules in S60 cannot directly be used on multiple phones . Instead for each phone the module needs to be signed with the phone's IMEI. Here are the steps to get a module signed :
- First go to: https://www.symbiansigned.com/app/page/public/openSignedOnline.do
- Fill up the application information form:
- IMEI no of the phone ( found by typing in *#06# on the phone )
- Your email id
- Upload the unsigned module (will be a .sis file)
- Select all the capabilities, don't bother to find out which ones are the ones required
- Write the code, sign the document and submit the form
- An email will be sent to your email id, asking you to confirm that you want the file signed.
- After you confirm, another email will be sent to you when the file is signed. Download this file.
- Now download this file to the phone
- Go to file manager on the phone, find the file and open it to install it on the phone.
- Install it to the phone's internal memory and ignore the warning.
- And you're done, the module is installed on your phone. You can import and use this module as any other inbuilt module.
More stuff about the design
For logout:
- Store userid on the local db. This way we dont need to delete records during logouts and/or logins.
