It felt to me that it was implied that you'd been there a while, say two weeks, with no hope in sight, nor much vegetation on which to survive. Otherwise your friend would likely not be dead and you'd likely not be starving.
Well the friend could have died on the safety raft floating to the deserted Island (most common way these things happen I presume).
Nonetheless, eating your friend is still a terrible idea if the meat is not cooked properly. It will only make dying that much more unpleasant and painful.