从 J2ME 重新连接到 GPRS

发布于 2024-10-16 12:36:18 字数 374 浏览 9 评论 0原文

我有一个小问题。我开发了一个 midlet 应用程序,通过互联网调用一些网络服务。我使用的是具有 GPRS 连接的手机。一段时间它按照我想要的方式运行,运行应用程序,通过 GPRS 调用 Web 服务,返回结果,再次调用 Web 服务,等等。

但是,假设我调用了网络服务,在应用程序返回我需要的结果后,我将其搁置了一段时间。下次我继续访问网络服务时,应用程序需要一段时间才能通过 GPRS 连接。在诺基亚,它在方框中标有G。在东南部,它标有一个发光的地球仪。盒子中的“G”或发光的地球仪会在一段时间后出现或根本不会出现,但应用程序仍在尝试连接到互联网。

它来自我的应用程序还是来自手机?我能否知道 [或应用程序知道] 目前应用程序尝试连接 GPRS 已准备就绪?

非常感谢您的回复...

I have a little problem. I have developed a midlet application that call some webservices through internet. I'm using cell phones with GPRS connection. For some time it runs as I wanted, run the apps, call the webservices through the GPRS, it returns the result, call the webservices again, and so on.

But say, I call the webservices and after the apps return the result I needed, I left it for a while. The next time I continue to access the webservices, the apps takes a while to connect through the GPRS. In nokia, it is marked with a G in a box. In SE it is marked with a glowing globe. This 'G' in the box or the glowing globe will appear after a while or won't appear at all, but the apps is still trying to connect to the internet.

Does it come from my apps or it come from the cell phone? And could I know [or the apps knows] that at the moment the apps tries to connect the GPRS is ready?

Thanks a lot for your responses...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谁与争疯 2024-10-23 12:36:18

遗憾的是,Java ME(即 J2ME)中没有任何内容可以控制设备是否连接。您所能做的就是尝试连接。

不过,请确保您正确关闭了所有连接。包括 HttpConnection 对象,而不仅仅是输入/输出流。

There is nothing in Java ME (i.e. J2ME) that can control whether or not the device is connected, unfortunately. All you can do is try to connect.

Make sure you are properly closing all your connections, though. Including the HttpConnection object, not just the input/output streams.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文