PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 25 → WM [RESOLVIDO] Saber estado de Sinal do Telefone (Android)
WM [RESOLVIDO] Saber estado de Sinal do Telefone (Android)
Débuté par Willian Fernando, 05 oct. 2016 17:01 - 1 réponse
Membre enregistré
123 messages
Popularité : +46 (46 votes)
Posté le 05 octobre 2016 - 17:01
Membre enregistré
3 659 messages
Popularité : +175 (223 votes)
Posté le 06 octobre 2016 - 08:29
MobileNetworkConnectionInfo (Function)

In French: RéseauMobileInfoConnexion

Returns information regarding the current connection to the data on the mobile network.
Note: This function cannot be used in the simulator and it will return 0 in this case.

Example

// Activation of the Wi-Fi if the signal intensity is strong enough to access the data
// via the mobile network
IF MobileNetworkConnectionInfo(networkGSMSignal) <= 20 _AND_ WiFiStatus() <> wifiEnabled THEN
IF YesNo("The intensity of the GSM signal is not sufficient. Enable the Wi-Fi?") THEN
WiFiActivate()
END
END


Syntax

<Result> = MobileNetworkConnectionInfo(<Type of Information>)


<Result>: Character string

•Requested information.
•If several types of information are requested, each type of information is separated by a CR character (Carriage Return).
•The order in which the information is returned (if requested) is as follows:1.<Type of network>
2.<Operator>
3.<GSM signal>
4.<Roaming>
5.<Plane mode>

<Type of Information>: Integer

Requested information:

networkRoaming Roaming mode of data.
If this information is requested, <Result> is set to:
•1 if the current connection uses the data roaming
•0 otherwise.

networkAirPlaneMode Management of the plane mode.
If this information is requested, <Result> is set to:
•1 if the device is in plane mode.
•0 otherwise.

networkOperator Name of the network operator used.
Depending on the type of network or if the plane mode is enabled, this information may not be specified.

networkGSMSignal Intensity of the GSM signal included between 0 (no signal) and 100 (optimum signal).
This information is available on the devices running Android version 2.2 or later (api level 8).
The intensity will be equal to 0 for the earlier versions of the system.
To find out the version of the Android system on which the application is run, use SysAndroidVersion.

networkType Type of network used to access the data on the mobile network.
Roaming mode of data.

If this information is requested, <Result> is set to:
•network2G: 2G network
•networkEdge: Edge network
•network3G: 3G network
•network4G: 4G network
•networkUnknown: Unknown network


Remarks

To get information about the WiFi connection, use WiFiConnectionInfo.

Android System Android (WINDEV Mobile): Android System


[ + ]
This application is a tutorial example presenting some of the new features of WINDEV Mobile for Android.
The following system functions are used:
- NFC
- Multimedia control
- Brightness
- Volume
- WIFI
- Bluetooth
- Toast
- Progress Bar control
- 9-image mode
- Compass
- Accelerometer
- Camera control
- LED
- Vibrations
- Notifications
- Drawing functions
- Internet

Components

Android wd210android.jar

---------------

MobileNetworkStatus (Function)

In French: RéseauMobileEtat

Returns the current status of the connection to data on the mobile network or asks to be notified when the status of the connection to data changes.
Notes:
•This function cannot be used in the simulator. In this case, it will always return 0.
•This function does not affect the Wi-Fi connection but the connection via a telephony operator.


Example

IF MobileNetworkStatus() = networkConnected THEN
BrowserRunApp("www.WINDEV.com")
END



Syntax

Retrieving the status of the connection to data on the mobile network Hide the details

<Result> = MobileNetworkStatus()

<Result>: Integer constant

Status of the connection to data:

networkConnected Connected.
networkConnectionInProgress Current connection.
networkDisconnected Offline.

Asking to be notified when the status of the connection to data changes on the mobile network Hide the details

<Result> = MobileNetworkStatus(<Procedure Name>)


<Result>: Integer constant

Status of the connection to data:

networkConnected Connected.
networkConnectionInProgress Current connection.
networkDisconnected Offline.


<Procedure Name>: Character string (with or without quotes)

WLangage procedure ("callback" procedure) called when the status of the connection to data changes.
This procedure has the following format:


PROCEDURE <Procedure Name>(<New Status>)

<New Status> is an integer constant corresponding to the new status of the connection to data:

networkConnected Connected.
networkConnectionInProgress Current connection.
networkDisconnected Offline.


If this parameter corresponds to an empty string (""), the notifications regarding the change of connection status will not be sent anymore.

Remarks

A change of connection status can occur when the type of network used changes : for example, when switching from 2G network to 3G network (or conversely).
To find out the type of network corresponding to the current connection, use MobileNetworkConnectionInfo.

Related Examples:


Android System Android (WINDEV Mobile): Android System


[ + ]
This application is a tutorial example presenting some of the new features of WINDEV Mobile for Android.
The following system functions are used:
- NFC
- Multimedia control
- Brightness
- Volume
- WIFI
- Bluetooth
- Toast
- Progress Bar control
- 9-image mode
- Compass
- Accelerometer
- Camera control
- LED
- Vibrations
- Notifications
- Drawing functions
- Internet

Components

Android wd210android.jar

:merci:

--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/