I made a mobile application for Casio brand Windows Mobile. what my app does is it connects to a webservice and get some data. I deployed the app and gave the Casio device back to the customer. The customer told me that the device's 3G goes into the sleep, and my app display error message that says "No internet connection". But they also told me that if they open Internet Explorer and then my app, my app will work.

So what I think is IE opens 3G connection, and my app can connect to internet. I did some research and I saw that there is a connection manager. How do I open that Connection Manager?

Can you give an idea?

有帮助吗?

解决方案

Opening the connection manager to let the user initiate the connection is one possible solution for your 'issue': you may launch ctlpnl.exe with the right argument "ctlpnl.exe cplmain.cpl,19"

Anothother solution, if you have a flat rate data plan, is to make the connection an AlwaysOn connection: wap provisioning

But the best and easiest solution is to make the connection manager aware of your apps need to connect to the internet. Now you can start to use the ConnMgr API from your application code.

It would be also suficiant, if you just let the ConnMgr know that your app needs internet. The ConnMgr only establishes an internet connection if it is requested or needed. ConnMgr only "knows" that you need an internet connection, when your app does a http request. A ftp or socket request will NOT trigger the connection manager! So, just add some line in your code for a http request to a known host (ie stackoverflow.com) and verfiy that you get back some answer. When the http request was successful you can start to use the web service.

I would go first for the last suggestion and then for the ConnMgr API. As a last offer you may allow the user to always manually do the connect (or accidently change connection settings?).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top