“But compared to Vietnam or Singapore, it’s a tough place to do business,” he said.

Mr. Joko nonetheless has high hopes for his visit, especially for American investment in Indonesia’s e-commerce sector, which analysts say could see tens of billions of dollars in new investment in the next five years. He is scheduled to fly to San Francisco on Wednesday to tour Silicon Valley, visit the headquarters of Google, and have dinner with Tim Cook, chief executive of Apple.

In Washington, Mr. Joko and Mr. Obama are expected to sign memorandums of understanding on maritime and defense cooperation, and energy. Mr. Blake said the two leaders would also discuss increasing cooperation in countering violent extremism and climate change, and the territorial disputes in the South China Sea.

China has recently acted aggressively to bolster its maritime claims in the region, including by creating islands in disputed territory, which conflict with claims by the Philippines, Vietnam, Malaysia and Brunei. In 2002, China and the Association of Southeast Asian Nations agreed to establish a code of conduct in the South China Sea, but to date no document has been finalized.

Mr. Joko said he wanted Indonesia, which is not a claimant to the disputes, to use its neutrality to push for a code to be signed as soon as possible.

“Dialogue is very important to solve this problem,” he said. “We must start detailing the contents” of the code “element by element, and implement them. It’s been too long — 13 years.”

In the interview, he also reflected on his first year in office, which analysts say has been rocky. Mr. Joko, a slum child who made history by being his country’s first president not to come from the political elite or the military, followed through on campaign promises to eliminate fuel subsidies, and provide free health care and financial support for education for the poor.

But his commitment to fighting corruption in one of the most graft-ridden nations in Asia was questioned when he nominated a police general implicated in corruption as the nation’s top law enforcement official.

The excitement he had generated, especially among the working class who mobbed him at campaign rallies like a rock star, has waned. A poll released last Tuesday put his approval rating at 52 percent, up from a low of 41 percent in June but far below his peak of 72 percent immediately after his election.