In an ecosystem, the only true producers are autotrophic organisms like plants and bacteria. These organisms produce energy by converting the energy from the sun into simple sugars.
All of the other organisms in the food chain, like the fruit fly, are simply consuming the energy produced by the plants/bacteria and not actually making/producing energy from a new source.