Fruit flies are unable to produce their own food.
In general, this is the basic difference between plants and animals. As such plants are known as an autotroph. Autotrophes can make produce their own food through the exposure to sunlight, the process that is commonly known as photosynthesis.
As fruit flies do not possess the capabilities to produce their own food, they are known as heterotrophs, Heterotrophs are grouped into three main classes; parasite, decomposing, and consuming. Such as a parasitic worm which leaves inside of a host organism and feeds of the nutrients from the host. A worm is a good example of decomposing heterotroph in that they take biological materials from both plant and animal and use this as their food source and in turn create a more decayed or decomposed material with it.
And finally, is the fruit fly, like many other animals, it is unable to produce its own food internally and is therefore known as a consuming organism.