Food-Finding Ability
The fruit fly only lives for about two months, but during that time it needs to find sources of food and nesting. Although the fruit fly's sense of sight and smell are less sophisticated than humans, like humans they are the primary mechanisms to how these insects locate food. Along with smelling for potential foods, fruit flies use color contrasts in the environment to locate potential food sources. When drosophilia smell a potential nectar they begin buzzing around the area to locate the most flavorful source using both sight and smell. The closer they come to the source, the better they can locate where the smell is coming from. Interestingly enough, color contrast in environment is so important in helping them locate food that in a low-contrast environment (such as in a lab setting), fruit flies are unable to locate the food source despite being able to smell it.
Prevention
While one or two fruit flies may occasionally be seen, clean sanitation practices and properly functioning screens are essential in preventing a fruit fly infestation. Forgotten vegetables in cellars or baskets can be a continuing larva nest. Produce that is overly ripe should be eaten, refrigerated or thrown away to reduce breeding and feeding sources. Sixteen-gauge screen mesh is suitable to keep smaller flies such as fruit flies outside. When canning, be sure that all lids and seals are clean and flush against the lip of the jar to prevent fruit fly larva from crawling into the jar after canning.
Treatment
Treatment of drosophila depend on the source. If the source is a host site for nesting, the nest must be located and removed. Nesting spots include clogged drains, soiled garbage and recycle bins, or places where fruit juices can draw adult egg laying flies. Once the food source and nesting site are removed, a pyrethrum-based insecticide is safe to use to kill any remaining adults. Organic fruit fly traps can be constructed by placing a paper cone in a jar and baiting the bottom of the jar with a drop of apple cider vinegar.
Considerations
Produce that has been damaged by fruit flies can be used if the damaged areas are cut away from the produce's healthy flesh. While most people are not harmed by fruit flies, they do carry bacteria that can cause illness. Additionally, before using any pesticides, contact local organic farmers or agricultural offices to obtain a list of organic pesticides that are safe to use in your area.