Locative Technology

Other Apps in the Locative Directory:

One of the benefits of having the ability to work with the phone is that there is an interface to the cell tower you are connected to. With this information, it's easy to make a "Where I've Been" type of interface. This is one of the first projects I did when I got the phone: The output of my wandering can be seen, although it's very incomplete due to limitations of the program.

This codes is powered by two parts: one is PHP, on the server side, and one is Python, on the phone. Source to both is available.

Client Source - Server Source

import appuifw
import location
import urllib
class App:
    def save_data(self):
        u = urllib.urlopen("http://crschmidt.net/cell/?n1=%s&n2=%s&l=%s&c=%s&com=%s"%
		    (self.loc[0], 
			self.loc[1], 
			self.loc[2], 
			self.loc[3], 
			urllib.quote(self.form[0][2])))
        u.close()
    def __init__(self):
        self.loc = location.gsm_location()
        self.loc_string = unicode(self.loc)
        fields = [(u'Comment', "text"), (u'Cell info', "text", self.loc_string)]
        self.form = appuifw.Form(fields, appuifw.FFormDoubleSpaced)
        self.form.menu = [(u'Send', self.save_data), (u'Update', self.update_form)]
    def run_form(self):
        self.form.execute()
    def update_form(self):
        self.loc = location.gsm_location()
        self.loc_string = unicode(self.loc)
        self.run_form()

if __name__ == '__main__':
    app = App()
    app.__init__()
    app.run_form()

Copyright 2003-2007, Christopher Schmidt