We present fabrication and characterization procedures of devices for circuit quantum electrodynamics (cQED). We have made 3 GHz cavities with quality factors in the range 10^4--10^6, which allow access to the strong coupling regime of cQED. The cavities are transmission line resonators made by photolithography. They are coupled to the input and output ports via gap capacitors. An Al-based Cooper pair box is made by ebeam lithography and Dolan bridge double-angle evaporation in superconducting resonators with high quality factor. An important issue is to characterize the quality factor of the resonators. We present an RF-characterization of superconducting resonators as a function of temperature and magnetic field. We have realized different versions of the system with different box-cavity couplings by using different dielectrics and by changing the box geometry. Moreover, the cQED approach can be used as a diagnostic tool of qubit internal losses.