View Single Post
  (#1 (permalink)) Old
misty83 Offline
Thumbs Must Hurt
 
Posts: 73
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Default problem with RadioStatusListener - 07-03-2009, 08:22 AM

hi,
i need to implement a class that will register if user connects to the internet, for how long, if he receives any data etc. i've started with implementing a class that would implements RadioStatusListner but it simply does not work.
here is the code:
Code:
InternetInfo _internetInfo = new InternetInfo();
UiApplication.addRadioStatusListener( _internetInfo);

public class InternetInfo implements RadioStatusListener{

  Nouvelle _nouvelle;

	public InternetInfo(){
	  _nouvell = new Nouvelle();
	};
	
	public void baseStationChange(){
		_nouvelle.attention("1");

	}
	
	public void networkScanComplete(boolean _success){
		_nouvelle.attention("2");

	}
	
	public void networkServiceChange(int _networkID, int _service){
		_nouvelle.attention("3");

	}
	
	public void networkStarted(int _networkID, int _service){
		_nouvelle.attention("4");

	}
	
	public void networkStateChange(int _state){
		_nouvelle.attention("5");

		
	}//end of networkStateChange
	
	public void pdpStateChange(int _apn, int _state, int _cause){
		_nouvelle.attention("6");

	}
	
	public void radioTurnedOff(){
		_nouvelle.attention("7");

	}
	
	public void signalLevel(int _level){
		_nouvelle.attention("8");

	}
	
	
}


where Nouvelle.attention:

	public void attention(String data)
	{
	_ui = Ui.getUiEngine();
	_screen = new Dialog(Dialog.OK, data, Dialog.OK,
		Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION),
				Manager.VERTICAL_SCROLL);
		
		_ui.queueStatus(_screen, 1, true);
		
	}
but nothing happens. i mean-i use the browser, went to some page, turned off/on network and nothing! none of these alerts appears..

Can anyone help me with that?

kind regards
   
Reply With Quote
Sponsored Links
Please Login or Register to Remove these Advertisements!