BEIJING — He cooked dumplings with families, made small talk with delivery workers and tried out riot gear with the police.

President Xi Jinping of China sought to project an image as a strong and folksy leader during a two-day tour of Beijing ahead of the Lunar New Year holiday, which begins on Tuesday. Facing a slowing economy at home and a trade war with the United States, he used the occasion to defend his policies, including his efforts to create jobs and the Communist Party’s increasingly tight grip on society.

Here are the highlights.

Mr. Xi, the most powerful Chinese leader since Mao, rarely mingles with the public. But ahead of the Year of the Pig, he made an exception, visiting a famous Beijing alleyway on Friday to hang decorations with residents and make dumplings, a favorite New Year food.

The visit was yet another attempt by Mr. Xi to be seen as sympathetic to the struggles of ordinary people. With China’s economy slowing after years of breakneck growth, he does not want to risk being seen as out of touch.

In the alleyway, Mr. Xi asked about the cost of electricity, wished a restaurant owner success and patted children on the head. Later, he spoke with delivery workers, comparing them to “diligent honeybees,” and vowed to create more jobs.