Code example for Service

Methods: getSystemService

0
	protected WifiInfo m_wifiInfo;
	protected Service m_service;
	public WifiLogger(String logFileName, int interval, Service s) {
		super(logFileName, interval);
		m_service = s;
		m_wifiManager = (WifiManager)m_service.getSystemService(Context.WIFI_SERVICE);
	} 
 
	@Override 
	public String getLogValue() {
		if(m_wifiManager == null)
			return "No Device"; 
		else{ 
			m_wifiInfo = m_wifiManager.getConnectionInfo();
			String rstr = "" + getWifiStateStr(m_wifiManager.getWifiState()) + " " + m_wifiInfo.getRssi();
			return rstr;
		}	 
	} 
	 
	private String getWifiStateStr(int code){
		switch(code){