Symbian - 查找设备是否已连接到互联网

时间:2021-01-30 20:51:40

Is it possible using the Symbian Java library to find whether the device is connected to the internet or not?

是否可以使用Symbian Java库来查找设备是否已连接到互联网?

I don't want to wait for an exception to find out.

我不想等待异常才能找到答案。

Thanks.

2 个解决方案

#1


There is no practical way to do this in either standard J2ME or using any Series60 Java extension I have heard of.

在标准J2ME中或使用我听说过的任何Series60 Java扩展都没有实用的方法。

Trying to contact a remote server and measuring the time it takes to do so would not be a reliable test because of irregular network coverage (and it would force the device to connect to the internet if it wasn't already).

尝试联系远程服务器并测量这样做所花费的时间并不是一个可靠的测试,因为不规则的网络覆盖(如果它还没有,它将迫使设备连接到互联网)。

#2


You can get information about the network starting with S60 3rd Edition FP 2 phones through a series of system parameters. com.nokia.network.access or com.nokia.mid.networkavailability may server your purpose. There are a few other properties that may be useful for network access, see the complete documentation on system properties http://library.forum.nokia.com/topic/Java_Developers_Library/GUID-1F6DF24F-40E4-4450-80F6-783C996A25D7.html

您可以通过一系列系统参数获取有关从S60 3rd Edition FP 2手机开始的网络信息。 com.nokia.network.access或com.nokia.mid.networkavailability可以为您的目的服务。还有一些其他属性可能对网络访问有用,请参阅有关系统属性的完整文档http://library.forum.nokia.com/topic/Java_Developers_Library/GUID-1F6DF24F-40E4-4450-80F6-783C996A25D7.html

#1


There is no practical way to do this in either standard J2ME or using any Series60 Java extension I have heard of.

在标准J2ME中或使用我听说过的任何Series60 Java扩展都没有实用的方法。

Trying to contact a remote server and measuring the time it takes to do so would not be a reliable test because of irregular network coverage (and it would force the device to connect to the internet if it wasn't already).

尝试联系远程服务器并测量这样做所花费的时间并不是一个可靠的测试,因为不规则的网络覆盖(如果它还没有,它将迫使设备连接到互联网)。

#2


You can get information about the network starting with S60 3rd Edition FP 2 phones through a series of system parameters. com.nokia.network.access or com.nokia.mid.networkavailability may server your purpose. There are a few other properties that may be useful for network access, see the complete documentation on system properties http://library.forum.nokia.com/topic/Java_Developers_Library/GUID-1F6DF24F-40E4-4450-80F6-783C996A25D7.html

您可以通过一系列系统参数获取有关从S60 3rd Edition FP 2手机开始的网络信息。 com.nokia.network.access或com.nokia.mid.networkavailability可以为您的目的服务。还有一些其他属性可能对网络访问有用,请参阅有关系统属性的完整文档http://library.forum.nokia.com/topic/Java_Developers_Library/GUID-1F6DF24F-40E4-4450-80F6-783C996A25D7.html