Code example for TelephonyManager

Methods: getCellLocation

0
			{ 
				Log.d(TAG, "ACTION_TIMER_TICK");
				 
				TelephonyManager tm = (TelephonyManager)
						getSystemService(Activity.TELEPHONY_SERVICE); 
		        GsmCellLocation location = (GsmCellLocation) tm.getCellLocation();
		         
		        if (currentCellLocation == null || !currentCellLocation.equals(location)) {
		        	Log.i(TAG, "new cell location: " + location);
		        	currentCellLocation = location;
		        	 
		        	sendCellLocation(); 
		        } 
		         
			} 
			else if(intent.getAction().equals(ACTION_COLLECT_CELL_IDS))
			{ 
				Log.d(TAG, "enable location timer");
				AlarmManager mgr=(AlarmManager)getSystemService(Context.ALARM_SERVICE);
				Intent i=new Intent(this, SyncBroadcastReceiver.class);
Stop searching for code, let great code find you!  Add Codota to your java IDE