×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Aug 2008
    Location
    Bergen, Norway
    Posts
    8

    Project with pyS60 and location aware web

    Hello,
    I'm a newbie in mobile programming who has a project at the university. I'm going to make a location aware website who gives the user "news" in a variable proximity to the users location.

    I need some help with the code and general input on how this can be done. I've imagined something like this:

    1. In pys60 on mobile phone with internal gps. Using positioning module to send gps to a server. pys60 opens the webbrowser with the news website on the mobile after sending the gps positioning.

    2. Server recieves gps position from mobile phone and performes an query using sql to a database with all the stored "news" based on proximity to the users location.

    3. User recieves the result in the webbrowser on his mobile phone

    Can this be done?

  2. #2
    Registered User
    Join Date
    Nov 2006
    Posts
    568

    Re: Project with pyS60 and location aware web

    Yes, possible, although the causalities have to be ordered correctly:

    1) You get the position from whatever physical location provider (WPS, CellID, GPS)
    2) Your app sends a request to your server, containing the position in form of a geocode
    3) Your server does the database lookup and renders the LBS aware page to your app.

    This can be done with a few lines in python. But does it make sense?!

  3. #3
    Registered User
    Join Date
    Aug 2008
    Location
    Bergen, Norway
    Posts
    8

    Re: Project with pyS60 and location aware web

    What do you think by does it make sense? I'm very open for suggestions since I've not yet started the project, just trying out different solutions. I'm focusing on the user-side (the user walking around in a town with his mobile and wanting to read news in his proximity) and what will be most userfriendly, not necessarily what is more secure or traffic costs.

    I have the server with a database allready set up and the SQL code, so all I really need is the python code that will send the gps-data. Is this already available somewhere? I have been looking into the proof of concept http://discussion.forum.nokia.com/fo...d.php?p=496275 but have not yet get it to function properly.

  4. #4
    Registered User
    Join Date
    Aug 2008
    Location
    Bergen, Norway
    Posts
    8

    Re: Project with pyS60 and location aware web

    Strange problem with my code. Instead of doing anything it just quits python completely.
    This is the code i'm trying to get to work:
    Code:
    import httplib, e32, positioning, urllib, appuifw, positioning, sysinfo
    
    
    
    
    def gps_init():
    	try:
    		positioning.select_module(positioning.default_module())
    		positioning.set_requestors([{"type":"service","format":"application","data":"test_app"}])	
    		positioning.position(course=1,satellites=1,callback=gps,interval=500000,partial=0)
    		e32.ao_sleep(3)
    	except:
    		appuifw.note(u'Problem med GPS','error')
    
    
    
    def gps_stop():
    	try:
    		positioning.stop_position()
    	except:
    		appuifw.note(u'GPS stoppet','error')
    
    		
    def gps_print():
    	lokasjon = str('Min GPS posisjon er (Lengdegrad/Breddegrad) : %s, %s, %i' % (pos_lat, pos_long) )
    	print lokasjon
    	e32.ao_sleep(10)
    
    
    def open_browser(url):
    	url = "%s?%s" % ('http://www.example.com/mobil/upload.php', urllib.urlencode({'lat': pos_lat, 'lon': pos_long}),)
    	e32.start_exe('BrowserNG.exe', ' "4 %s 1"' % url, 1)
    	
    
    gps_init()
    count = 0
    while True:
    	count = count + 1
    	sat = gps_data['satellites']['used_satellites']
    	pos_lat = gps_data['position']['latitude']
    	pos_long = gps_data['position']['longitude']
    	if pos_lat > 0:
    		gps_print()
    		print 'Fant GPS posisjon, åpner Lokanytt...'
    		open_browser(url)
    	e32.ao_sleep(1)

  5. #5
    Nokia Developer Champion
    Join Date
    Sep 2007
    Location
    Bhavnagar
    Posts
    928

    Re: Project with pyS60 and location aware web

    Hi,
    As you had written your code try this query at python dibo. It may be possible that you will get a quick response.
    Jajal Mehul

Similar Threads

  1. Replies: 12
    Last Post: 2008-11-04, 12:55
  2. location and signing pys60
    By jwevandijk in forum Symbian
    Replies: 6
    Last Post: 2007-12-09, 12:00
  3. where is python location on mobile phone
    By lb213_2000 in forum Symbian
    Replies: 1
    Last Post: 2007-11-05, 08:56

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×