Even before President Donald Trump tweeted a threat to send “in the Feds” to curb Chicago’s gun violence, he was saying on the campaign trail that there was a simple solution to the bloodshed: police should get tougher.

Chicago should follow the lead of New York City, Trump’s administration has said, and crack down on even the smallest offenses.

It turns out Chicago Police Supt. Eddie Johnson visited the New York Police Department weeks before the Trump administration advice. But what he gleaned from a city that has achieved long term success in fighting crime was more nuanced than a Trump-inspired police crackdown.

Johnson came home with ideas aimed at increasing community trust by using technology to get Chicago police officers out of their squad cars, and putting new cadets in neighborhoods to walk the streets and talk to locals.

“We are only as strong as the faith the community has in us,” Johnson said.

Gaining that community trust will be a tall order in a city suffering from a toxic brew of rising violent crime in some of its poorest neighborhoods along with anger at police after the release in 2015 of a video showing a white police officer shooting black teenager Laquan McDonald 16 times.

That lack of faith has had grave consequences in Chicago where many people living in high-crime neighborhoods are reluctant to help police solve them. While the number of homicides surged to the highest in nearly two decades last year at 762, the percentage of those murders solved by police fell ten points to 26 percent, according to a University of Chicago Crime Lab study. In New York, police solve about 70 percent of homicides.

“We need them (witnesses) to come forward and give us the information so we can put these bad guys in jail,” Johnson said.

In one example of Chicago’s dilemma, the police department is struggling to draft a new policy on the use of force. An October proposal prompted concern from the police union that the restrictions were so tight officers would put themselves in danger to comply. A new draft released Tuesday would give police more latitude in deciding when to fire their weapons, which pleased the police union but prompted concern from community activists about excessive force.

All this is a sharp contrast with New York, where the NYPD during the 1990s turned to the “broken windows” policing strategy of cracking down on minor offenses championed by then-Mayor Rudy Giuliani. That policy helped drive the number of homicides down in one decade from more than 2,200 a year to fewer than 700.

Since then, the number of homicides in New York has continued to decline. In January the police department announced that there had been a near record low 335 homicide in 2016 — less than half the tally in Chicago, which has less than half the population. And New York has done this with a lighter policing touch.

The NYPD has been making a targeted effort to repair damaged relationships with minority communities. Use of the “stop-and-frisk” tactic that disproportionally affected black and Hispanic men has plummeted in the past three years. Low-level possession of marijuana is now considered a ticketable offense, and overall arrests dropped 20 percent in 2016 from the year before.

Since his visit to New York, Johnson has begun applying what he learned about community policing with some encouraging results.

In New York, the department started giving officers smartphones that are equipped with policing apps linked to federal and state databases. Statistics show the officers are relying on those phones more and more.

In Chicago, those phones are part of a strategy that includes sensors installed around neighborhoods that alert officers immediately where and when a gun is fired and a computer system that takes information about arrests, 911 calls, gang activity and other data and predicts where violent crime might occur.

That gives officers instant access to information both when they are in their squad cars and out on the street. This is significant because there has been a growing concern that as officers become more dependent on technology, they are more reluctant to get out of their squad cars.

“You are never going to get the community to like you or trust you if all you did was race by at 30 mph and get out of your cars only to jack somebody up,” said Jim Bueermann, president of the Police Foundation, a Washington, D.C.-based research organization. “It is absolutely important to get them (officers) out of their cars.”

In two of Chicago’s most violent police districts where the technology was introduced last month, the number of shootings dropped dramatically compared to February 2016 — 60 percent in one and 40 percent in the other.

Johnson was also impressed with how rookie officers in New York are assigned to more experienced mentors around the city. Trainees are pulled from the academy to spend a week at a precinct house, in a patrol car and then walk the beat over a nine-week period. The goal is to get those officers into the community to meet people and learn how to interact with them.

RELATED: Chicago’s deadliest neighborhoods get greenest cops

“Police officers are giving their cellphone numbers and email addresses to residents so that they can have a constant dialogue,” New York Mayor Bill de Blasio said after a speech in Chicago on March 3. “Arrest is the last resort, not the first one,” he said.

Johnson liked that strategy so much that he will begin putting cadets from the training academy into communities this year. When they return to the academy, the hope is that the cadets will be better versed on the neighborhoods and their residents.