On May 29, Martin unsuccessfully tried to open a cash register at Tauranga Central Backpackers, and he was arrested a short time later inside Tauranga Library.
He told police he robbed the Subway store to feed his methamphetamine habit and admitted he smoked at least one gram of the drug daily.
Martin, who earlier pleaded guilty to two charges of charges of robbery and a further charge of burglary, was sentenced in the Tauranga District Court on Monday. His lawyer Rebekah Webby urged Judge Thomas Ingram to allow her client the full 25 per cent discount for his guilty pleas despite the delay in him doing so.
But Judge Ingram said he was not prepared to do so as the evidence against Martin had been overwhelming and he could have pleaded guilty much earlier.
Judge Ingram imposed the two years six months' prison sentence on Martin for the robberies and burglary, and concurrent sentences for three unrelated charges.
That included a breach of prison release condition and two driving-related charges.
Judge Ingram noted that Martin had been to prison several times in his past and in fact, he was subject to release conditions at the time of the robberies and burglary.
The judge urged Martin to "think long and hard" about his future while in prison and take full advantage of all rehabilitative programmes available to him.
Judge Ingram said especially undergoing counselling to help him kick his P-habit as he was only likely to re-offend and spend even "longer and longer" time behind bars.
"In the end Mr Martin only you can make up your mind what you want to do with your life.
"Ultimately, you'll be dealt with by the Parole Board on all these matters, and you need to present the best case you possibly can when it comes time to consider your release."