Indian Prime Minister Narendra Modi takes a selfie next to Sheikh Hamdan bin Mubarak Al Nahyan, U.A.E. Minister of Higher Education and Scientific Research, left, as they tour the Sheikh Zayed Grand Mosque in Abu Dhabi on Aug. 16. (Kamran Jebreili/AP)

India’s prime minister, Narendra Modi, loves to tweet, post on Facebook and take selfies , and dreams of creating smart cities and cyber-hubs.

So when he heads to California’s Silicon Valley this week, Modi, 65, will get the red-carpet treatment as he dines with chief executives, promotes India’s start-up community and meets tech leaders including Apple’s Tim Cook and Microsoft’s Satya Nadella. On Sunday, he will appear at an online “town hall” session with Facebook’s Mark Zuckerberg.

Modi’s intent “is to showcase what a big market India is to Silicon Valley for start-ups and to create an environment that will attract technology companies to invest in India,” according to Arvind Gupta, the National Technology Head of Modi’s Bharatiya Janata Party. Modi’s big push is called “Digital India,” an ambitious $18 billion plan to connect Indian cities and villages to the Internet.

After 16 months in office, the Indian leader remains popular at home and abroad. But much has changed since his first heady trip to the United States last year, which culminated with a stroll at the Martin Luther King Jr. Memorial with President Obama.

Since then, Modi has faced questions over the slow pace of needed reforms and his wide-ranging foreign travel. There is growing concern about government censorship, Internet privacy protections and clampdowns on foreign nongovernmental organizations such as Greenpeace and the Ford Foundation. In San Jose, he will be greeted by protesters and roadside billboards that say “#ModiFail” — put up by an Indian American opposition group.

Just as Modi readied for his trip, mobile phone and text use was blocked in his home state for more than 24 hours in some places as a security measure during a caste protest. And the government backed off a controversial plan that would have required citizens to save their WhatsApp, Facebook and other messages for three months and turn them over to law enforcement, if asked.

In recent days, more than 100 academics — many with Indian ties and connections to prestigious institutions like Harvard, Stanford and Columbia universities — wrote an open letter to Silicon Valley’s CEOs warning of “uncritical fanfare” over Modi’s visit and urging them not to support Digital India.

“The visit is not concerning in and of itself — prime ministers are often combining diplomacy and business,” said Thomas Blom Hansen, the director of Stanford’s Center for South Asia, who has studied the rise of Hindu nationalism.

“What is concerning is that the Digital India project does not rest on a legal framework that respects privacy and sensitive information. Should we trust that Modi’s government will handle this huge pool of data impartially and with due respect for civil liberties and rights?”

More than any other Indian leader, Modi was an early adopter of technology and used cyber war rooms stocked with overseas advisers to leverage a decisive victory in last year’s parliamentary elections. Today, he has 30 million followers on his Facebook page and 15 million Twitter followers.

Yet he remains a divisive figure in the United States, where he was denied a visa in 2005 over allegations he did not do enough to stop ­Hindu-Muslim riots as a state leader.

In San Jose, Modi will be mining a relationship between Silicon Valley and India — particularly its high-tech hubs of Bangalore and Hyderabad — that dates to the IT boom in late 1990s.

An estimated 15 percent of start-ups in Silicon Valley have been founded by Indians or Indian Americans, according to one estimate. And American venture capital firms have invested $4 billion in Indian start-ups since 2010, according to statistics from the National Association of Software and Services Companies, an Indian trade association.

“Ten years ago there was virtually no IT venture capital in India. It’s taken off like wildfire,” said Vinod Dham, the Indian-born entrepreneur and venture capitalist who helped develop the Pentium processor while at Intel.

Modi hopes to woo investors for Digital India with ambitious plans for broadband networks that would link Indian cities and 250,000 villages by next year, increased mobile phone access, digital service centers in rural areas and electronics manufacturing. The Taj Mahal even has free WiFi.

It will be an uphill climb. India has the third-highest number of Internet users in the world, but only 20 percent of the population has even occasional access to the Internet, according to a study by the Pew Research Center.

The ambitious project overlooks the fact that many Indian villages still lack reliable roads and power, points out Rikin Gandhi, an Indian American who founded Digital Green, which provides technology assistance to small farmers.

“It’s great obviously to be expanding Internet access and try and mobilize it to provide investment and IT jobs,” said Gandhi, a Modi supporter. “But there is still much left to be desired with regard to basic access to services like electricity and road connectivity.”

India’s globe-trotting prime minister — who has made 27 foreign trips to date — has used his travels as a way to firm up support from the wealthy and well-educated Indian diaspora, including about 3 million in the States.

On Sunday evening in San Jose, Modi will appear before a ­standing-room-only crowd of the California diaspora at a glitzy “community reception,” to be held in the city’s SAP Center and hosted by a Bollywood star. The arena seats 17,496, but 48,000 had registered for the complimentary tickets, organizers say.

Behind the scenes, Modi will probably face some sharp questions from Silicon Valley titans of Indian origin who, fed up with the stasis and corruption of the previous government, supported his prime ministerial bid in 2014.

“Almost everybody I know is highly frustrated because they ­haven’t made any changes,” said Kanwal Rekhi, managing director of Inventus Capital Partners. “We are all looking forward to speaking to the prime minister over the weekend when he’s here and asking, ‘What about the promises you have made?’ ”

Specifically, he said, the government needs to do more to clarify its byzantine tax system that remains a deterrent to some foreign investors, such as the minimum alternative tax on foreign portfolio investors and other rules.

“I still have hope that substantial changes are coming, but it is fading fast,” Rekhi said. “They have talked a lot but they haven’t done much.”

Read more:

India’s Narendra Modi aims to rebrand and promote yoga in India

Modi and his Indian ruling party face a setback after New Delhi elections