Ad-hoc networks of devices and sensors with (limited) sensing and wireless communication capabilities are becoming increasingly available for commercial and military applications. The first step in deploying these wireless sensor networks is to determine, with respect to application-specific performance criteria, (i) in the case that the sensors are static, where to deploy or activate them; and (ii) in the case that (a subset of) the sensors are mobile, how to plan the trajectory of the mobile sensors. These two cases are collectively termed as the coverage problem in wireless sensor networks. In this chapter, we give a comprehensive treatment of the coverage problem. Specifically, we first introduce several fundamental properties of coverage that have been derived in the literature and the corresponding algorithms that will realize these properties. While giving insights on how optimal operations can be devised, most of the properties are derived (and hence their corresponding algorithms are constructed) under the perfect disk assumption. Hence, we consider in the second part of the chapter coverage in a more realistic setting, and allow (i) the sensing area of a sensor to be anisotropic and of arbitrary shape, depending on the terrain and the meteorological conditions, and (ii) the utilities of coverage in different parts of the monitoring area to be nonuniform, to account for the impact of a threat on the population, or the likelihood of a threat taking place at certain locations. Finally, in the third part of the chapter, we consider mobile sensor coverage, and study how mobile sensors may navigate in a deployment area to maximize threat-based coverage.