In an effort to do just that, Google hired many key staffers from Sun's Java team and invested much effort. Since Java uses a "virtual CPU" to run programs, Google procured a virtual machine for Android intended to avoid all of Sun's JVM patents. Google felt more relaxed about the actual Java language and programming interfaces, since the received legal wisdom of the software industry is that programming languages and interfaces can't be copyrighted. Google used independently implemented code to sit behind those programming interfaces -- most notably from the Apache Harmony project Sun had shunned. Finally, Google took care to avoid any Java trademarks; despite being Java all the way down, Google never promoted Android as a Java platform. Bear trap avoided.
Sun never tried to close the Java bear trap on Google's leg as it had with Microsoft. Indeed, Sun CEO Jonathan Schwartz welcomed Android as a new vehicle for popularizing Java as a development platform. However, Oracle's culture is a little different. One can imagine, sometime after the acquisition of Sun, an Oracle lawyer stumbling on a folder containing the rough outline of a lawsuit. Next stop, Larry's office.
The Oracle patent lawsuit
Born of a generation of developers who regard software patents as anathemic sociopathy, Google was slow to acquire a defensive patent portfolio. Eventually it began building a patent war chest (mainly by purchasing patent portfolios), but by the standards of its industry peers, it was poorly defended. Oracle, on the other hand, has a fearsome arsenal of software patents, both homegrown and acquired through the the many businesses it consumes each year -- including Sun, which itself had an impressive defensive patent portfolio.
When it initiated its lawsuit against Google, Oracle threw everything it had into the case, accusing it of both patent and copyright infringement. It accused Google of infringing multiple claims in multiple patents, loading so much into the case that the judge involved called foul. Fearing that the preparation for and argument of the case could take years, he ultimately insisted that Oracle limit the number of patents and the number of claims from those patents. Google got straight to work on the list of patents, challenging their validity and getting claim after claim invalidated.
As the patents were eliminated, the potential damages from the case went down and down, until today they are pocket change for Google. Hoping that this would mean Google and Oracle could settle out of court, the judge recently ordered the two companies' executives to appear at a settlement hearing. It didn't work.
What's left? There are still some patent claims. Oracle hopes it will be able to justify an injunction against Google -- a court order banning distribution of Android -- and that will be enough to force Google into some form of royalty-based arrangement. That would not be good for Android.