Heat a pan and fry the grated apples until all the juices get evaporated.
When the apple seem to have got half cooked add in coconut, extract, food color, sugar and keep stirring the mixture on a medium to low flame, until the entire mixture comes together as a ball without sticking to the pan.
This consistency is something very similar to the usual coconut burfi.
At this stage transfer the mixture to a greased pan and let it cool.
Next prepare the pineapple layer for the burfi.