09-19-2013 02:06 AM
I want to show the message(some alert) to user regarding NetworkAvailability.
Like Device is in online or not(Offline)..?.
I have implemented RadioStatusListener and required methods overriden and while Im doing network on/off,
mostly signalLevel() method is calling repeatedly.
In signalLevel() method Im using Dialog.alert("my network message") to show the message to user.
Now while im turing on Mobile network the signalLevel() is calling repeatedly until its fetching the full network signal. Due to that I'm getting mutiple alerts. So how to restrict this. I want to show the alert to user only once either in online/offline based on turn on/off.
Thanks in Advance
09-19-2013 04:15 AM
Having signalLevel called repeatedly is exactly what I would expect to happen. You have seen the 'bars' on your phone increase and decrease depending on how close you are to a mast. This is not directly related to whether the device can communicate or not (except at 0 when clearly it can not or course!). So I don't think you can use this, at least not by itself, to inform your user.
But what exactly are you telling the user is 'on' or 'off'. Access to the network for phone calls? Access to the network to send a text. Or access to the Network to send data?.
09-19-2013 05:20 AM
09-19-2013 05:29 AM
If you look at your BB, you will see various network status icons displayed, like GSM, GPRS, EDGE. The network is connected if you see one of these. But if it is GSM (or whatever is displayed in a CDMA phone), then you only have voice. So connected does not mean you can send data.
So what state does your network need to be in to be considered off? What must it be capable of doing?
09-19-2013 05:49 AM
09-19-2013 06:43 AM - edited 09-19-2013 06:44 AM
"When I done with signal level it leads to multiple alerts but alert should come only once."
Worse that that - it is only checking Radio - which could be off and you could still have connectivity using WiFi.
Sorry I seem to be repeating the same thing here. You still have not defined what you mean when you say the Device is Online.
I think what you are saying is that the phone is online, when your application can communicate with the Server. But I want your words. Can you define what actions can the user take when the device is online that they can't perform when it is offline?
As noted, it probably has nothing to do with the signal level, so you should ignore that as a possible way to determine the device status.