Image copyright Getty Images

President Trump has insulted military commanders and used the troops for political purposes, say his critics. Yet many of those who serve in the military adore him. Why?

On Thanksgiving, the commander-in-chief spoke on the phone with US troops who were stationed overseas.

"You really are our heroes," he said. He also took their conversation in an unexpected direction, though, telling the troops "the nation's doing well economically - better than anybody in the world".

His manner on the phone - criticised as too political - was nothing new. He has often bragged to the military about his accomplishments - and has also shown off what he's done for them. As he told reporters on Thanksgiving: "Nobody's done more for the military than me".

The president has spent little time on the ground with US troops based abroad. Recently he said during a Fox News Sunday interview that a trip might be in the works. If he goes to Iraq or Afghanistan, it will be his first visit as commander-in-chief.

He did not go to Arlington National Cemetery for Veterans Day. And he skipped an outing to a French cemetery that was filled with graves of US soldiers who had served in World War I.

He has slighted the military in other ways too.

After the revered commander who led the mission to capture Osama Bin Laden described the president's attacks on the media as the greatest threat to US democracy, Mr Trump called him a Hillary Clinton backer and said it would have been "nice" if Bin Laden had been caught sooner.

Image copyright Chip Somodevilla Image caption William McRaven headed the Navy Seal team that killed al-Qaeda leader Osama Bin Laden

During the presidential campaign, President Trump spoke disparagingly of John McCain, who was held as a prisoner of war in Vietnam. "I like people who weren't captured." His critics were quick to point out that bone spurs - calcium build-up in the heels - kept the New York businessman from serving in Vietnam.

President Trump has been accused of treating the military in a cavalier fashion. He sent troops to the US-Mexico border to stem "an invasion" shortly before the mid-term elections, a move that was decried as a stunt to burnish Republican national security credentials.

Some critics of the administration claim that he has led the military in an ad-hoc fashion. In the summer of 2017, he surprised officers with his proposal for a parade to celebrate Veterans Day, a show of strength for the nation. Paul Eaton, a retired US army general, said the president wanted to create "a display of the military saluting him".

President Trump eventually gave up his plans for a parade, saying it would be too expensive.

The president and the military

Media playback is unsupported on your device Media caption Could Trump's 'Space Force' become a reality?

He has sprung other ideas onto military leaders - his announcement of a US Space Force, an additional branch of the military, was unexpected, and so was his promise to end military exercises on the Korean Peninsula.

The troops are his "toy soldiers", says Gordon Adams, a former White House budget official for national security who has co-authored a column about the president's "betrayal" of the military.

Since 2016, the percentage of troops who disapprove of President Trump has gone up from 37-43%, according to Military Times.

But those are overall numbers, showing how he is seen among officers and the rank and file. He is popular among enlisted men, with a 47% favourable rating in that category.

These men like the way that President Trump is backing their efforts - he said in July that the military resources in the nation's next budget would be the "most amount ever".

Image copyright Reuters Image caption Trump did not attend Arlington Cemetery on Veterans Day

People who are not serving in the military - but study the budget - see things differently.

Fact-checkers have pointed out that for fiscal year 2019, the president signed the John S McCain National Defense Authorization Act, which includes $716bn (£526bn) USD for the Pentagon. In contrast, President Barack Obama pledged $726bn for 2011.

But neither figure is a historical high. That came, predictably, in 1945 when the US spent the equivalent of $950bn in today's money.

Yet enlisted men still love the president - regardless of the budget.

Jason Amerine, who once served as the leader of a US special forces unit, says that they forgive him "all sorts of missteps that would normally enrage service members", adding that "people generally let it go".

"There doesn't seem to be a line that he can cross that people won't forgive," says Amerine, describing the president and his supporters in the armed forces.

"I feel like it's almost the mentality of a sports team: 'My team's going to win.' When you see missteps on your team, you don't turn against it."

Media playback is unsupported on your device Media caption McCain widow - I'll never get over Trump slur

George Mason University's Francis Buckley, who writes for the American Spectator, says that the president's support is fuelled both by his strength as a commander-in-chief and by his conservativism.

"Trump has built up the military, and he's maintained forces - he's not simply retreated," says Buckley.

He has shown himself to exercise military power in a way that Obama did not, he adds, pointing to the way that Trump authorised US-led strikes against President Bashar al-Assad and his chemical weapons programme in April 2018 - and the cruise missiles fired at a Syrian base in 2017.

Besides that, Buckley says, the president and those in the rank and file share the same world view.

"These are people who signed up with the military because they're patriotic people, and the president picks the kinds of fights that appeal to him.

"The people who volunteer for the military are not opt to regard Colin Kaepernick as a hero," he says, referring to the athlete who kneeled during the national anthem in order in order to raise awareness of racism and injustice - and incurred the wrath of the president.

"You have to understand what Maga is all about," Buckley, referring to the president's campaign slogan Make America Great Again: "We don't like people who dump on American values."

Media playback is unsupported on your device Media caption How Americans think Trump affects their life

Many members of the military have reflected these views in posts on Twitter. One retired officer, @andersonDrLJA, who describes himself as a "Patriotic Family Man, says simply: "We salute you sir."

And @LtStevenLRogers, whose describes himself as a "Military Intel Officer,USN (Ret)", expresses his admiration for a president who "Continues to keep his promises".

In the end, though, the president's popularity - or lack of it - may not have much of an impact on most of the individuals who are serving in the military. The Heritage Foundation's James Carafano recalls that when he was in the army, Jimmy Carter was president - and had low approval ratings.

Still Carafano says: "Nobody ever sat around talking about Jimmy Carter.

"Whether the president is incredibly popular or unpopular doesn't matter."

Most people in the military, he says, just do their jobs - and pay little attention to the noise in Washington.

Follow @Tara_Mckelvey on Twitter