The 32 year old Republic of Ireland striker has played under Alan Pardew before at West Ham. He has scored 9 times in 41 internationals and had one of his most prolific spells when at Wimbledon where he scored 42 goals in 63 league starts.
He was last at Sunderland, but left in the summer following a succession of injuries.
Manager Alan Pardew said: "If he comes back from this injury lay-off, like I think he will, then we're going to find ourselves with an exciting player."
He added: "David is keen to show that he is ready to kick back in.
"I believe in him and my staff all feel that we could get one of the bargains of the season - but only if David comes back to what he has achieved and what he could do before, because he is a Premiership player when he is at his best.