开发者

Android persistent HttpClient connection

Would it be possible to setup an HttpClient such that on a website that updates periodically, perhaps due to AJAX, the resulting changes would be captured by the HttpClient. Similar to keeping a connection to a website alive, and if there were an update, the HttpClient would send the updated response to a listener of some type. I feel as if there is an obvious answer to my question, but I just haven't found it because I may have some of my terminology wrong...

This is just an example snippet of how I usually set up a connection:

DefaultHttpClient httpClient = new 开发者_JAVA技巧DefaultHttpClient();
HttpGet httpGet = new HttpGet(url);
HttpResponse response = httpClient.execute(httpGet);


Welcome to Stack Overflow! I do not think keeping a constant connection open to your site would be the best solution. Why don't you just poll every once in awhile?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜