×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    101

    Help connect to internet using gprs

    Hi everyone, I have the following code from mobilenin.com running when using the Wlan connection but fails when I connecting to GPRS network...
    Code:
    import appuifw, e32, urllib
    
    print "press options"
    
    def fetching():
        x=1
        addr = appuifw.multi_query(u"Latitude:", u"Longitude:")
        lat,lng = addr
        url =  "http://maps.google.com/staticmap?center=11.244435,125.002506&zoom=17&size=320x340&markers=11.244435,125.002506,blue&key=%22ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6Moupicuser"
        tempfile = "e:\\python\\gmaps\\gmap"+str(x)+".png"
        try:
            print "Retrieving information..."
            urllib.urlretrieve(url, tempfile)
            lock=e32.Ao_lock()
            content_handler = appuifw.Content_handler(lock.signal)
            content_handler.open(tempfile)
            x=x+1
            # Wait for the user to exit the image viewer.
            lock.wait()
            print "GMap viewing finished."
        except:
            print "Problems."
    
    def quit():
        app_lock.signal()
    
    appuifw.app.menu = [(u"Get Map", fetching)]
    
    appuifw.app.title = u"Get video"
    
    appuifw.app.exit_key_handler = quit
    app_lock = e32.Ao_lock()
    app_lock.wait()
    thanks in advance,
    picuser

  2. #2
    Registered User
    Join Date
    Mar 2010
    Posts
    6

    Re: Help connect to internet using gprs

    It works (shows the same map everytime though coz ur url is static)
    u need to check ur gprs settings
    BTW, wat do u mean by 'fails'? Be more specific...
    Last edited by jinn_29; 2010-11-15 at 23:32. Reason: typo

  3. #3
    Registered User
    Join Date
    Dec 2008
    Posts
    101

    Re: Help connect to internet using gprs

    Quote Originally Posted by jinn_29 View Post
    It works (shows the same map everytime though coz ur url is static)
    u need to check ur gprs settings
    BTW, wat do u mean by 'fails'? Be more specific...
    Hi, hmmm the code from post 1 is a test if I can connect or open the map using the GPRS connection with N95 and i set it GPRS as the default, but I dont have any luck with it. Then I try to use this code
    Code:
    import e32
    import sysinfo
    url="http://maps.google.com/staticmap?center=11.244435,125.002506&zoom=15&size=320x340&markers=11.244435,125.002506,blue&key=%22ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6Moupicuser"
    internal_url = '4 '+ url + ' 1'
    b = 'BrowserNG.exe'
    e32.start_exe(b, ' "%s"' %internal_url, 1)
    The above code works fine..any idea why using
    Code:
    urllib.urlretrieve(url, tempfile)
    does not work?

    thanks in advance,
    picuser

Similar Threads

  1. java MIDlet wont connect via 3G but will connect to internet via WiFi
    By jpedwards in forum Mobile Java Networking & Messaging & Security
    Replies: 6
    Last Post: 2009-09-04, 13:37
  2. wap/gprs howto?.. how to connect to gprs and send udp packets..
    By Bojankv in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2009-08-16, 14:16
  3. Connect to internet via GPRS problem
    By Aaypee in forum Symbian Networking & Messaging (Closed)
    Replies: 4
    Last Post: 2007-03-05, 07:49
  4. Connect to internet via GPRS problem
    By Aaypee in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2007-03-02, 09:28
  5. How to connect Palm Tungsten E -> 6220 (GPRS) -> Internet
    By sirpete in forum General Development Questions
    Replies: 0
    Last Post: 2004-05-11, 14:03

Posting Permissions

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