Setting the stage for a clash of two Silicon Valley titans, Oracle said Thursday that it has filed a federal lawsuit alleging that Google’s popular Android operating system was built on Oracle’s Java software without permission.

Android, which was first released in late 2008, has seen surging adoption by computer manufacturers as an operating system for smartphones and other portable gadgets. Oracle’s lawsuit accuses Google of knowingly infringing on Java patents and copyrights that Oracle acquired when it bought Sun Microsystems earlier this year.

While Redwood Shores-based Oracle did not specify the amount of damages it will seek, one analyst said the stakes could be high. But he also suggested the lawsuit may be a strategic move by Oracle in the course of a larger negotiating effort.

“At the end of the day, it could mean a fair amount of money,” said Al Hilwa, a software industry expert at the IDC tech research firm. Based on other similar past disputes, he added, it’s likely that the two companies have been negotiating quietly for months.

“Going public with a lawsuit may well be part of a strategy by Oracle for trying to force the issue,” Hilwa said.

Mountain View-based Google declined to comment and said it had not seen the lawsuit. An Oracle spokeswoman declined to say whether the two companies held any talks before the lawsuit was filed.

The suit came as a surprise to many in the industry, and it may ultimately turn on complex points of intellectual property law. Sun Microsystems, whose engineers developed the widely used Java programming language and related tools, decided several years ago to release key elements of the Java code under an open-source license that allows others to use it freely.

“Java is essential for Android,” said Hilwa, adding that “since Android has been out there for more than a year, most people would have expected they were in compliance with whatever license terms apply.”

Google makes little money directly from Android, since it is distributed as an open-source operating system. But Android’s growth means more search revenue for Google, as consumers use their smartphones to search the Web.

While Google does not break out its revenue from mobile search, a company official recently announced that Google searches from Android devices grew by 300 percent during the first half of 2010.

Android is now the most popular smartphone operating system in the United States, according to the Gartner research firm, which said it is on the verge of becoming the second-most-popular in the world, closing in on Research In Motion’s BlackBerry.

Contact Brandon Bailey at bbailey@mercurynews.com.