| Reply | « Previous Thread | Next Thread » |
|
Hi .. is this a bug or my code is buggy ???
This is my code: Code:
import os
import appuifw, socket
import e32
import httplib, urllib
filename = u'c:\\goal.txt'
urllib.urlretrieve(u'http://www.danihome.dnsalias.org',filename)
data = file(filename)
f = data.read()
data.close()
appuifw.app.title = u'go4it on Mobile'
appuifw.app.body = appuifw.Canvas()
i = f.find('title')
while i != -1:
j = f.find('title',i + len('title') + 1)
k = f.find('reminder_type',i)
l = k + len('reminder_type') + 1
str = f[i+ len('title') + 1:j-2] + ' is ' + f[l: f.find('/>',l)]
appuifw.note(unicode(str), 'info')
i = f.find('title',j + len('title') + 1)
os.remove(filename)
I am running it as script in my pys60 interpreter [pyS60_1_4_1 on Nokia N73] ... I am getting 'Connection Timed out Error' always even for google. However I am able to access the URL {even the one in my code} via web browser Whats the issue ...??? Thanks in advance... |
| dani2mobile |
| View Public Profile |
| Find all posts by dani2mobile |
|
Probably you need to set default access point before using socket functions outside localhost. Please refer to PyS60 documentation.
Mikko Ohtamaa Twinapex Research http://www.twinapex.com |
|
Hi .. I tried running the same script in S60 emulator with pys60 installed ... My script works perfectly fine in it ... So I think I must configure my N73 in some way to allow GPRS access for applications. My N73 device is able to access url through it web browser. Any ideas ???
When I run the script on device it asks me to choose an access point .. So probably setting it as default may not solve the issue i guess {maybe i am wrong anyways gonna give a try} |
| dani2mobile |
| View Public Profile |
| Find all posts by dani2mobile |
|
Quote:
Mikko Ohtamaa Twinapex Research http://www.twinapex.com |
|
Quote:
![]() |
| dani2mobile |
| View Public Profile |
| Find all posts by dani2mobile |
|
wap2net need a proxy, first u may know your wapgate, and do not use urllib.
Code:
r=urllib.FancyURLopener(proxy).open(url).read() if u want to download a file, u may try httplib 'GET' this's what u want: http://discussion.forum.nokia.com/fo...ad.php?t=77722 |
| dumpling.ch |
| View Public Profile |
| Find all posts by dumpling.ch |
|
Quote:
http://discussion.forum.nokia.com/fo...ad.php?t=77722[/quote] but no luck again ... getting the following error Code:
connect: (10.10.1.100, 9401) send:u'POST http://www.google.com\r\nAccept-Encoding: identity\r\n\r\n' reply: 'HTTP/1.0 503 Service Unavailable\r\n' header: Content-Type: text/vnd.wap.wml header: Proxy-Connection; close |
| dani2mobile |
| View Public Profile |
| Find all posts by dani2mobile |
|
Can you use your serve browser goto google.com ?
Maybe change a website and try ... |
| dumpling.ch |
| View Public Profile |
| Find all posts by dumpling.ch |
|
if you want to use the wap/3g portal access then the connection needs to use the proxy server of your operator.
i use: con = httplib.httpconnection("my.operator.proxy",8080) con.request("get","http://some.site.i.want.com") res = con.getresponse() data = res.read() con.close() |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| GPRS Support in Nokia PC Suite Connectivity API 3.0. | sspiffusa | PC Suite API and PC Connectivity SDK | 1 | 2007-11-02 19:16 |
| Problem with GPRS connectivity | corej2me | Mobile Java Networking & Messaging & Security | 0 | 2005-08-21 16:18 |
| Nokia PC Connectivity能否链接到cdma手机上发送短信和其他操作? | bborn | Web Technologies and Multimedia Content- Web 技术和多媒体内容 | 2 | 2004-05-04 12:06 |
| Emulator connectivity issues (GPRS) | nikola_mitrovic | Mobile Java Tools & SDKs | 4 | 2003-09-26 21:18 |
| Connectivity between a websever and GPRS Modem | akj_77_mobile | PC Suite API and PC Connectivity SDK | 0 | 2003-04-08 07:39 |