Water, water everywhere, and not a fly in sight! Well, not actually, because the vast majority of flies could be considered aquatics. I’m not just talking about those flies that actually are aquatic at some stage of their life (like chironomid midge larvae, or black fly larvae; I’ll discuss them later), but rather how even those considered “terrestrial” require extremely moist habitats. Take for example, larve of the Xylophagidae, which in North America live in the humidor of rotting bark on downed trees. Or fruit flies (both the true fruit flies {Tephritidae} and the household “Drosophila” melanogaster), which develop in live fruits, stems, flower heads, and leaves for the former, and rotting fruits in the latter. A decaying body is a wet place, and harbours plenty of maggots, usually of Calliphoridae. A live body is also a wet place, and can be colonized by a number of families (termed myiasis) including the infamous bot fly (Oestridae). In fact, very few flies come to mind that don’t spend at least a part of their life in a humid/moist/wet environment.
Besides the vast diversity of “aquatic” flies, flies that are truly aquatic as larvae have been found to be important bioindicators of the health of their watery homes. Phantom midges (Chaoboridae) and their larvae have been used to monitor heavy metals such as nickel in northern Ontario lakes. Black fly larval diversity and species composition has been used to evaluate the health of rivers, especially in northern Canada (imagine that field work, ouch).
Finally, there are some flies which defy convention and dive headlong into the water (skip to 4:40 to see the flies, taken from The Future is Wild series):
Which flies live as larvae in the driest habitat relative to other flies? I’ve dug up what I presume are tabanid larva living in the soil in corn fields. Yes, soil does have some moisture, but it wasn’t especially wet soil – there were the other assortment of typical corn field soil insects such as wireworms.
With such a huge diversity its hard to say which flies live in the driest habitat, but there are bee flies (Bombyliidae) which are ectoparasites on larvae of sand nesting hymenoptera; a lot of larvae in the Syrphinae (Syrphidae – flower flies) are active aphid predators and live on exposed foliage; bee lice (Braulidae) larvae live within the wax of bee hives. But, given the diversity of flies and the general lack of knowledge about most of their larvae, there are sure to be species out there that survive in even more drastic environments!