Well, I guess you can do plenty of interesting things with that even if you don't have a full location database.
For example, it would be easy to write a script which would act differently if you are at home or at the office...
Using a Bluetooth GPS unit, it should be possible to geographicaly map cellid's to real locations -- and the database of location lookup's would be a nice web service for those lacking GPS units. Obviously the size of a cell can vary drastically depending on location, but in a dense urban environment, the positioning can be fairly good.
Once more native API's are available from Python, it should be easy to do things like changing your Profile based on location. It would also be nice if location metadata could be inserted into pictures (which would be easy if the Camera API's were available, but could probably be done with a separate tagging app.)
gsm_location() produces KerrNoMemory after about 2600 calls on my Nokia 6600. Can anybody acknowledge this strange behaviour from his own experience?
>> have a look at this notes:
cellid.py runs out of memory after about 7 hours and 26 minutes (7,4 hours) when trying to get the cellid.
the mainloop sleeps 10 seconds between each call to location.gsm_location()
so there is 6 calls per minute, 360 calls per hour,
so the script leaks after about 360 * 7,4 = 2664 calls to location.gsm_location()
the following message was left on the console.
Traceback (most recent call last).
File "C:\System\Apps\Python\default.py", line 55, in <lambda>
lambda: menu_action (query_and_exec)),
File "C:\System\Apps\Python\default.py", line 46, in menu_action
File "C:\System\Apps\Python\default.py", line 32, in query_and_exec
execfile(os.path.join(this_dir, script_list[index]), globals())
File "C:\System\Apps\Python\cellid.py", line 49, in ?
g_mcc, g_mnc, g_lac, g_cellid = location.gsm_location();
it points to a symbian out of memory error.
running the script in this session of python immediately produces the error again.
restarting python "solves" the problem.
great that i am not the only one who had problems with the location module!
i solved the problem in a similar way: i am using e32.start_server() to kick off a background process that just writes the location data to a text-file in ram-disk and quits afterwards. the main-application is put to sleep for a second and then reads the data from ram-disk.
i don't quite like this way of having to bloat this quite simple application with a seperate process (and a wobbly critical section between the two processes). luckily it works quite well for my purpose of long-time data-collection.
nevertheless i think it would be really good if the memory leak in gsm_location() could be fixed for the next release of python.
also, os.spawn*() would be a cool feature.