开发者

Windows Mobile - Connect to Internet

开发者 https://www.devze.com 2023-01-25 06:02 出处:网络
My application is making call to server at regular intervals. This requires internet connection either using Wi-Fi or GPRS.

My application is making call to server at regular intervals. This requires internet connection either using Wi-Fi or GPRS.

This works ok when phone is waken (screen light is on). But, as soon as phone lights are off, it makes HttpWebRequest and tried to get Internet connection. Mobile starts connecting to Wi-Fi. But, Application does not wait for establishing co开发者_StackOverflownnection to Wi-Fi.

  1. How can I connect to Wi-Fi or GPRS before making HttpWebRequest?
  2. How to specify that I want to connect to Wi-Fi or GPRS?


I think their are two approaches to do:

  1. You can create a thread and do sleep/resume activity you want.
  2. you can use set timer for particular interval.
0

精彩评论

暂无评论...
验证码 换一张
取 消