You Are Here:

Community: Developer Discussion Boards

#1 Old Access Point Configuration - 2008-08-21, 13:26

Join Date: Aug 2008
Posts: 28
skewlboy
Offline
Registered User
I've found some threads about this, but all without answers or dodging the subject..
In J2ME when we use httpconnection interface it uses the proxy from the wap access point settings in case there's one.
In Python I've noticed (and read) that it doesn't. It's easy to make it use the proxy though. I just haven't found how to "discover" those settings to avoid users having to go to configuration and copy it manually.
So, basiclly, anyone knows how to read the selected access point proxy settings? Must be possible...

Thanks
Reply With Quote

#2 Old Re: Access Point Configuration - 2008-08-21, 13:45

Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Offline
Forum Nokia Champion
hi skewlboy
welcome to the python Dibo
Are you talking about this.


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote

#3 Old Re: Access Point Configuration - 2008-08-21, 19:05

Join Date: Jun 2008
Posts: 87
GonzalezM
Offline
Regular Contributor
Gaba probably already solved your problems. If it helps anyone, though, I wrote a small class so the user just has to select an access point one time. I'm not taking credit as I collected bits from different sources. And I'm not sure it's perfect (probably not), but it has worked for me so far.

Code:
class AccessPointManager:
	"""
	Manages the user's access point selection
	"""

	def __init__(self):
		self.restore()
		
	def clear(self):
		"""
		Resets the access point
		"""	
		f = open(ACCESS_POINT_FILENAME, 'w')
		f.write(repr(None))
		f.close()

	def choose(self):
		"""	
		Writes the access point to local storage
		"""
		apid = socket.select_access_point()
		f = open(ACCESS_POINT_FILENAME, 'w')
		f.write(repr(apid))
		f.close()
		apo = socket.access_point(apid)
		socket.set_default_access_point(apo)

	def restore(self):
		"""
		Tries to restore from local storage, or asks the user if
		that doesn't work
		"""
		try:
			f = open(ACCESS_POINT_FILENAME, 'rb')
			apid = eval(f.read())
			f.close()
			
			if not apid == None:
				apo = socket.access_point(apid)
				socket.set_default_access_point(apo)
			else:
				self.choose()
		except:
			self.choose()
You need to define ACCESS_POINT_FILENAME. Upon instantiating (which you should do at program startup), it will try to load the user's choice from a file, or ask the user if the file is missing. You may call choose() anytime to let the user choose a new access point.
Reply With Quote

#4 Old Re: Access Point Configuration - 2008-08-21, 20:05

Join Date: Aug 2008
Posts: 28
skewlboy
Offline
Registered User
Thanks for your fast replies and for the welcome
But no, that's the common misunderstanding I found in posts related to this question.
I do know how to select my default access point and ask/store it in file (that's the tutorial I read, btw ), but that wasn't the question.
My application is based on HTTP connection and my operator WAP data connection uses a proxy. That proxy is set up in Access Point configuration, and I would like to know how can I get that info (proxy URL/port) without asking user to copy it himself..

Thanks
Reply With Quote

#5 Old Re: Access Point Configuration - 2008-08-21, 20:21

Join Date: Jun 2008
Posts: 87
GonzalezM
Offline
Regular Contributor
I could be wrong, but it seems like that's not implemented, so you'd have to write your own module in Symbian C++. There must be some way if it's in J2ME.
Reply With Quote

#6 Old Re: Access Point Configuration - 2008-08-21, 20:27

Join Date: Aug 2008
Posts: 28
skewlboy
Offline
Registered User
Yea, that's what I thought. If JavaME does it, Symbian has to be able to do it too.
In JavaME it's done transparently. When we use the HTTPConnection interface, the VM checks for proxy in the AP configuration and sets the HTTP request accordingly. We can't even "not use" the proxy if we wanted to
Now that I started with PyS60 I liked when I tried with putools to make a request and check that it didn't forced me through the setup proxy, but then I cried after googling and finding nothing on reading that info from AP settings..
I have no idea where to look..
Reply With Quote

#7 Old Re: Access Point Configuration - 2008-08-21, 20:36

Join Date: Aug 2008
Posts: 28
skewlboy
Offline
Registered User
I've found some threads which I believe to be about this topic in Symbian C++.
One of them is http://discussion.forum.nokia.com/fo...ss+point+proxy
They mention this C++ class CHttpFilterProxyInterface to set the connection based on the AP proxy settings. I don't really understand Symbian C++ but I'll try to look into this since I have some more search terms to google now
Just wanted to leave this noted here in case anyone else looking for the same thing stumbles upon this thread.

Update:
So I found nothing about setting Http connections through filtering proxies in WAP AP settings, but I found another thread where they talk about really reading the configuration instead of setting some lower interface to use it.
http://discussion.forum.nokia.com/fo...ss+point+proxy
CommDB seems to be the "Communication Database" - go figure! :P - and I did find some weird sites talking about using it in PyS60, so I'll go check them out later when I get home
Last edited by skewlboy : 2008-08-21 at 20:46.
Reply With Quote

#8 Old Re: Access Point Configuration - 2008-10-09, 22:45

Join Date: Aug 2008
Posts: 2
cacko
Offline
Registered User
so is there's anyway to make PyS60 use the proxy settings for corresponding AP ?
Reply With Quote

#9 Old Re: Access Point Configuration - 2008-10-09, 22:58

Join Date: May 2007
Posts: 2,738
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
Quote:
Originally Posted by cacko View Post
so is there's anyway to make PyS60 use the proxy settings for corresponding AP ?
You can manually define the IP address in the AP. When you select the AP, while connecting, the AP settings are used to connect.

Best Regards,
Croozeus
Reply With Quote

#10 Old Re: Access Point Configuration - 2008-10-10, 07:11

Join Date: Aug 2008
Posts: 2
cacko
Offline
Registered User
actually the proxy settings are not used, that's why I asked this question.

I tried with urllib and httplib, same error "getaddrinfo failed". Of course if I specify the proxy in my python script everything is OK, but I don't want to specify any proxy settings, but the pys60 to automatically used them from the AP settings.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
getting access point configuration roidayan Python 3 2009-03-15 00:56
Connecting J2ME application to Internet using WAP access point? khurshed79 Mobile Java Networking & Messaging & Security 8 2008-08-18 13:40
Unable to connect to Wi-Fi access point after scanning the access point Ahtesham.Khan General Symbian C++ 1 2007-08-10 09:20
NOKIA D211 doesn't work with my 3com and Asus access point nuvolablu Multimodecards 4 2004-04-24 20:00
Midlet using a default Access Point fboya Mobile Java Networking & Messaging & Security 0 2003-07-03 19:53

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia