
Originally Posted by
andrecavallari
Hi, i´ve tryed a lot of ways to get the connectivity status, i know i must use the System Information Service, and get the ConnectionStatus, but so many tryouts but nothing so far, the maximum i got was a ReturnValue with some numbers not specifyed... but i cant get the notification, does anyone know how to get the connection status notification?? Thanks a lot
This code is working fine :
Code:
import com.nokia.lib.Service;
var sysInfo = new Service("Service.SysInfo", "ISysInfo");
var inParams = {Entity:"Connectivity", Key:"ConnectionStatus"};
sysInfo.GetNotification(inParams,onNotify);
function onNotify(transactionID:Number, eventID:String, outParam:Object) {
var systemData = outParam.ReturnValue;
_root._status.text = systemData.ConnectionStatus + " , " + systemData.ConnectionType + " , " + systemData.IAPConnectionName;
//you need a dynamic text on stage with name _status.
}
For more returned values take a look at documentation, it state few other values which return e.g systemData.ConnectionStatus contains "1" for connected & "0" if connection is disconnected. Moreover, few more things which u must know are :
1- Flash lite 3 get paused when send to background ,so, you will not get a notification of connection status if ur app is in background. But Flash Lite 3.1 supports running these functions in backgroung. (see flash lite library @ forum nokia for details)
2- By notification, it doesnt mean that a pop-up is displayed but it only means that the function onNotify is called when u get ConnectionStatus change if flash lite is in running state.
Hope it helps..
Best Regards,
SajiSoft