Contact angle measurements with sessile drops and bubbles