We have moved to a new Sailfish OS Forum. Please start new discussions there.

Revision history [back]

click to hide/show revision 1
initial version

posted 2014-01-13 18:24:53 +0200

How to find out if phone is connected to wlan or cellular network

The only online documentation for QT SystemInfo has a method for querying the current network mode

QNetworkInfo::currentNetworkMode()

which according to documentation should be able to return NetworkInfo.WlanMode.

When my phone is without SIM card the method above returns NetworkInfo.UnknownMode even if the phone is connected to a WLAN. With SIM card the method returns NetworkInfo.LteMode regardless of whether WLAN is used or not.

With QT Mobility I used the signalStrenght method for figuring which network is used, but that always returns -1 for WLANs in QT SystemInfo.

So is there another API for getting this information?

How to find out if phone is connected to wlan or cellular network

The only online documentation for QT SystemInfo has a method for querying the current network mode

QNetworkInfo::currentNetworkMode()

which according to documentation should be able to return NetworkInfo.WlanMode.

When my phone is without SIM card the method above returns NetworkInfo.UnknownMode even if the phone is connected to a WLAN. With SIM card the method returns NetworkInfo.LteMode regardless of whether WLAN is used or not.

With QT Mobility I used the signalStrenght method for figuring which network is used, but that always returns -1 for WLANs in QT SystemInfo.

So is there another API for getting this information?