The economic situation has turned awfully dicey in China. Growth has been slowing, fears of a real estate bubble are rising and the country’s stocks are underperforming.

Despite all those issues, it’s hard to be too down on the long-term future of such a populous country that’s still growing rapidly. You just have to pick your battles.

For investors, there might be no better battleground than the country’s Internet and mobile industries.

China has the world’s largest number of Internet users, at about 513 million — more than double the 245 million in the U.S.! Interestingly enough, China’s penetration rate is still only 38%, versus nearly 80% in the U.S.

As for mobile, China has crossed over 1 billion subscribers, which is about one-sixth of the global market. Of this, over 150 million are 3G users.

Great, huh? It is. But there’s still a big issue: It’s extremely difficult for U.S. companies to get traction in China.

While country may have pro-capitalists policies, the government remains firmly committed to the idea of communist principles of controlling speech and the flow of information. This is a huge issue for companies like Google (NASDAQ:GOOG), Facebook (NASDAQ:FB) and Twitter. After all, they operate on the principles of free expression of ideas.

So, unless they capitulate to censoring their websites and services, these companies will have to bypass an enormous market. It’s certainly a tough dilemma.

To deal with this, Google has been aggressive with acquisitions, moving into categories like video, ad networks and mobile. Facebook and Twitter will probably need to do the same. If not, growth could be stunted.

Yet, even if U.S. companies agree to play by China’s rules, this is still no guarantee of success. Operators like Groupon (NASDAQ:GRPN) have had a tough time finding success in the country because of the lackadaisical approach to intellectual property laws and other legal protections.

Even Apple (NASDAQ:AAPL) has had challenges. Consider that it needs to get approval from the Chinese government to make a deal with China Mobile (NYSE:CHL) to sell iPhones in its massive distribution channels.

So what to do? The best approach for investors is to focus on China’s home-grown companies. They understand the nuances of the national markets and, of course, have the benefits of dealing more familiarly with the complexities of the communist rules.

Investors still need to be selective, so it’s probably a good idea to avoid the small operators, such as Renren (NYSE:RENN) and Dangdang (NYSE:DANG). They were supposed to be the next Facebooks and Amazon (NASDAQ:AMZN) but have had nowhere near the same growth ramps.

Instead, a better approach is to look at the mega-players. And one that stands out is Baidu (NASDAQ:BIDU). It currently has 78.6% of the search market in China, which generates juicy cash flows. Baidu has also leveraged its platform into areas like commerce and mobile. No doubt, it has the advantage of looking at how Google pulled off this strategy outside of China.

And Baidu’s opportunity is still in the early stages. Keep in mind that it has 352,000 customers for its advertising business — but China has 40 million businesses.

No doubt, China will remain volatile. Beijing is going through a leadership change, which is adding to the uncertaintity. But for those looking for the long term, China’s Internet and mobile market look promising. The key is to stick with the leaders.