Code example for DatagramPacket

Methods: setAddress, setPort

0
 
		Log.d(LOG_TAG, "server:host = " + hostAddress + ":" + port);
		/* 
		 * Initialize the packet destination 
		 */ 
		_packet.setAddress(hostAddress);
		_packet.setPort(port);
	} 
 
	/** 
	 * Load the target server address and port from the shared preferences 
	 *  
	 * @param context 
	 */ 
	void init(Context context) {
		_sensorManager = (SensorManager) context
				.getSystemService(Context.SENSOR_SERVICE);
		enableOrDisableSensors(); 
	} 
 
	/**