Google CEO Larry Page REUTERS/Eduardo Munoz The courts just handed Oracle a surprising win in its years-long lawsuit against Google and Android. And Google, to say the least, is not pleased.

Google sent Business Insider this statement:

We're disappointed by this ruling, which sets a damaging precedent for computer science and software development, and are considering our options.

It's unclear how much money Google could owe Oracle as a result of this new ruling. Oracle had originally been seeking a shocking $6 billion, but the courts didn't allow that huge amount to stick.

The fee Google winds up paying could be as low as $300,000, or even nothing. Then again, it could be $1 billion or more if Oracle gets the court to make Google pay it royalties based on the number of Android devices sold.

The courts still have to rule on Google's final defense: that the copyrighted material it used for Android is OK to use under the Fair Use Doctrine.

To recap: Oracle accused Google of copying some of its Java computer code when it wrote Android. Android itself wasn't the issue. Android is different than Java. But Google wanted developers who work with Java, a popular language for web apps, to jump to Android. So it incorporated Java's application programming interfaces (APIs) into Android. This allowed them to quickly convert their apps to Android and it meant that the millions of programmers trained on Java would be familiar with Android, too.

Oracle sued claiming that the APIs were copyrighted. But the judge ruled that APIs are not subject to copyright laws.

On Friday, an appellate court just overturned that loss, and said APIs are subject to copyright.

An API exists to allow two programs to talk to each other. Normally, APIs are freely given away. It's the tool that encourages developers to write apps for a tech company's products.

By saying APIs are copyrightable, the whole software industry has been put on alert. This ruling could be an epic mistake that leads to a lot of frivolous litigation, James Grimmelmann, a copyright scholar at the University of Maryland, told Vox's Timothy Lee.

In 2013, when the case was still pending, two developers weighed in, railing against Oracle: Sacha Labourey, CEO of CloudBees, and Steven Harris, senior vice president for CloudBees and formerly a SVP of Java Server Development at Oracle. In an article on TechCrunch they wrote:

Will our economy thrive and be more competitive because companies can easily switch from one service provider to the other by leveraging identical APIs? Or will our economy be throttled by allowing vendors to inhibit competition through API lock-in?

Interestingly, this win was largely due to the lawyer Oracle hired, known for helping Apple win cases against Motorola, notes patent blogger, Florian Mueller:

This reversal-in-part is a huge win for Oracle and its appellate counsel, a team of Orrick Herrington & Sutcliffe lawyers led by Joshua Rosenkranz and Mark Davies. Mr. Rosenkranz has previously been dubbed the "Defibrillator" for reviving lawsuits on appeal after losses in district court. He did it again.

Rosenkranz told Business Insider that the alarm in the software industry is unwarranted.

"Google copied 7,000 lines of code and the structure and organization of whole packages of highly creative software. To say that this is protected is not the same as saying that anything that might loosely be called an API is protectable under copyright law," he said.

He also said that many of the legal briefs (aka "Amicus Curiae") filed in support of Google are missing the point. For instance, a year ago, The Electronic Frontier Foundation (EFF) along with 32 scientists filed such briefs.

"Most of the examples cited in Amicus Curiae briefs are not protect-able. Some of them are ways of doing things and not computer code at all," he said. "Others involve tiny snippets of code that are not at all creative, as compared to the entire structure of a complex program.”