In 2004, Andy Rubin made an urgent call to his friend, Steve Perlman.

Rubin’s startup, Android, was in trouble, he explained. Rubin didn’t like asking for money again, but the situation was dire.

Android, which was creating mobile software for phones, was out of cash, and other investors weren’t biting.

Perlman agreed to wire some funds as soon as possible.

“Maybe a little sooner would be better,” Rubin said nervously. Rubin had already missed payments on Android’s office space, and the landlord was threatening to evict him.

Perlman went to the bank and withdrew $10,000 in $100 bills and handed them to Rubin. The next day, he wired over an undisclosed amount of money to provide the seed funding for Android.

“I did it because I believed in the thing, and I wanted to help Andy,” Perlman told Business Insider.

With the new cash, Rubin got Android back on track. He secured more funding and moved the team into a larger office in Palo Alto, California, a technology hub on the West Coast.

Today, Android powers about 85% of all smartphones globally, while the iPhone accounts for only 11%. It’s making a push into wristwatches, cars, and TVs. It’s not hard to envision a time when Android will be in every single device from stove and thermostats to toothbrushes.

To grab 85% of the smartphone market, Rubin had to beat the two most valuable, and profitable, technology companies of their era: Microsoft and Apple. He had to fight entrenched wireless carriers. He had to get phone makers to buy into its radical vision.

Rubin didn’t do it alone. He got help from investors such as Perlman and big support from Google.

Based on interviews that Business Insider conducted with several sources who were there at the beginning, the following is the story of how Android came to be.

An impossible idea

Over the course of his 29-year career in Silicon Valley, Andy Rubin has become known as a technical genius, a skillful businessman, and a dynamic leader.

Above all, Rubin is an entrepreneur who loves to create things, whether it’s writing code or building robots.

His knack for engineering was evident in Building 44, where Android lives on Google’s campus. There, Rubin spent his spare time programming a gigantic robotic arm to make him coffee each time he sent it a text message. The machine was on the second floor of Building 44, and it was large enough to lift cars, a former Googler says.

Another one of Rubin's projects involved flying a massive remote-controlled helicopter on Google’s lawn.

"It's this huge $5,000 helicopter — he's trying to pilot it and it takes off and flips over upside down," said Sumit Agarwal, a former head of mobile product management at Google. "And it doesn't explode, but you've got this helicopter that's literally ripped itself apart out on the lawn in front of Building 44."

Long before Rubin had the luxury of tinkering with enormous robots at Google, he had to prove he could execute his crazy ideas. One of his wildest was building an open operating system for phones in the early 2000s.

In the early 2000s, carriers controlled everything from the way a phone was marketed to how much it would cost. Carriers called the shots back then, and they were determined to keep it that way. They didn’t want any company — large or small — infringing on their profits, which is why most of the tech industry thought an idea like Rubin’s was impossible, say sources who worked at Google in Android’s early days.

While the carrier system was closed and siloed, Android is open source. The term “open source” means anyone can take the original source code that makes up Android and use it on their gadgets free. Anyone can build on that code or modify it.

Rubin initially tried to design Android for cameras but couldn’t get traction from investors. So he teamed up with Chris White, who previously designed the interface for WebTV, and Nick Sears, a former T-Mobile marketing executive Rubin had worked with when launching the Danger Hiptop, or T-Mobile Sidekick as it was widely known. Rubin explained his idea to create an open-source operating system for phones. Rich Miner, another Android cofounder who leads the East Coast investment team at Google Ventures, joined the group in February 2004.

The first T-Mobile Sidekick T-Mobile When the Android team pitched their idea to venture capitalists, their original business plan was to give away the software free to phone manufacturers. The carriers would then order phones from the manufacturers running Android’s open software, and they could brand or modify it as they saw fit. Android would then sell “value-added services” to the carriers to go on top of that software, a source said.

It was a business model designed to attract carriers. The problem, however, was that it was difficult to make any mobile product successful because the carriers didn’t want to give up control of the industry. For example, Rubin’s first phone, the T-Mobile Sidekick, came to fruition only because T-Mobile agreed to sell it and re-brand it. Most teens who owned the Sidekick probably didn’t even know what Rubin’s company, Danger, was. They just knew they could only get the phone through T-Mobile. It was T-Mobile’s product more than Danger’s to any customer looking to buy the phone.

Sure, Rubin’s plan would allow carriers to openly advertise their products and services, but it would also require that they share some of their handle on the mobile market with Android. And they weren’t willing to agree to an idea like that very easily.

The impenetrable environment could rattle any CEO — but not Rubin.

“Even when things get really bad, you never really give up,” one source said of Rubin’s reaction to the difficult carriers. “It’s just the way these people who build these kinds of things are built to work.”

Most people thought Rubin was crazy for trying. Perlman, who met Rubin when they both worked for Apple in the early 1990s, remembers running into a venture capitalist at a Whole Foods in 2003 and asking what he thought about Rubin’s open-source project.

“He said, ‘Steve, come on. He’d have to sell at least a million of those things for it to break even,’” Perlman recalled. “‘He’s trying to boil the ocean.’”

In 2014, analysts estimate that more than 1 billion Android phones were shipped.

The man behind the idea

Andy Rubin AP Rubin graduated from Utica College in upstate New York. Prior to Android, he had a long career in tech, which started at Carl Zeiss Microscopy, where he worked as a development engineer for about a year between 1986 and 1987.

After leaving his job at Carl Zeiss, Rubin moved to Switzerland to work for a robotics company, according to The New York Times. During a vacation in the Cayman Islands in 1989, Rubin met an Apple engineer named Bill Caswell.

Rubin barely knew Caswell, but did him a favor — he offered Caswell a place to stay after he had been evicted from his beach cottage following a fight with his girlfriend, according to the Times.

This is how Rubin got his job at Apple, where he worked as a software engineer between 1989 and 1992 after Caswell offered him a job. Rubin’s love of robots was apparent at Apple too — he even earned himself the nickname Android while working at the company, according to The Verge.

But he was also quite the prankster back then. Rubin once got in trouble for programming Apple’s internal phone system to make it look like then-CEO John Sculley was calling to offer Rubin’s engineering colleagues special stock grants, The New York Times reported.

Rubin and Perlman, now the CEO of a company called Artemis Networks that’s working on an alternative to traditional wireless carrier networks, eventually left Apple to work for General Magic — a company that spun out of Apple in the early 1990s. The company was credited with creating a personal handheld computer some have called the precursor to the modern smartphone.

Rubin worked at General Magic between 1995 and 1997, until he left to join WebTV, which eventually was acquired by Microsoft and became MSN TV. Perlman founded WebTV and went with Rubin to Microsoft, too. After leaving Microsoft in 1999, Rubin started his own company Danger, the startup that invented the T-Mobile Sidekick.

Rubin didn’t know it at the time, but this was his first big break, and it would eventually lead to his next startup getting acquired by Google.

Google comes knocking

Google co-founder Larry Page speaks with people at his lunch table during the Clinton Global Initiative in New York September 27, 2007. REUTERS/Chip East While many saw Rubin’s idea for Android as crazy, he did find one other early supporter: Larry Page.

The Google co-founder was the company’s president of products when he learned about Rubin’s Android project. He asked a Google executive to reach out to Rubin, and it may have been the most important call of Rubin’s life.

Google told Rubin it heard about Android and wanted to offer “help.” Page previously met Rubin during a panel at Stanford University.

Rubin and Sears drove to Google’s Mountain View headquarters the first week of January in 2005. They sat down with Page and his Google co-founder Sergey Brin, as well as Georges Harik, a Google Ventures advisor and one of the company’s first 10 employees.

Page was dressed casually in jeans and a T-shirt. Brin wore no shoes but had a plastic Disney watch on his wrist. He sat near two candy jars and popped handfuls into his mouth.

Page wasted no time and praised Rubin’s previous work. He called the T-Mobile Sidekick one of the best phones he had ever seen.

Google's Sergey Brin Getty Images / Justin Sullivan Brin jumped in with a few jokes. He also talked with Rubin in meticulous detail about the technology that powered the Sidekick.

The meeting wasn’t all about praising Rubin; Brin wanted to test him too. He kept pressing Rubin about what he could have done differently to make the Sidekick even better, and why he chose to create the phone the way he did.

It wasn’t an aggressive conversation but a collaborative exercise in problem solving.

When Rubin and Sears walked out of that meeting, one thing was clear: Google was interested in Android. But it wasn’t clear why.

Was Google their friend or foe? Was it developing its own mobile software and learning from the competition?

Forty-five days later, when Google called Rubin back for a second meeting, Page’s intentions became clear. This time all four Android co-founders attended, and they brought a prototype of the software to show Google.

Harik got straight to the point: Google wanted to buy Android.

The founders were torn. Android desperately needed funding. Rubin, Android co-founder Chris White, and Sears were on board. But Rich Miner, the fourth founder who now works at Google Ventures, wanted the company to stay small.

Ultimately, Android accepted Google’s offer for a reported $50 million. About six months after their first meeting with Google in January, the Android team moved into the Googleplex on July 11, 2005.

'The new model'

Android’s headquarters in Building 44, which is where the team moved in April 2006 after living in Building 41, wasn’t like the rest of Google. A cylon from Battlestar Galactica guarded the entrance to the secluded office. Gizmos, gadgets, and robots filled the workspace.

“[Android] was a little resistant to becoming part of the bigger Google,” one early employee said. “It was kept pretty separate.”

Google typically reviews every single piece of code before it’s put into a product to improve code quality. Android, however, resisted that idea. A year or two passed before the team allowed Google to review its code.

Another former Googler described Android as an “island” inside Google in its early days that ran as its own secretive group with its own culture.

“I didn’t realize he was running a startup inside Google,” one source that worked with Rubin told us. “That’s what it was.”

The Android building at Google Google+/Sundar Pichai

The Android team’s strategy when it came to mobile was foreign to other Googlers at the time, too. If one were to explain the idea behind Android to other Google employees around 2005 or 2006, the reaction probably would have been, “good luck with that.”

Before Android, Google focused its mobile efforts on getting its apps onto other phones — like those made by Nokia or Blackberry devices. The idea with Android, however, was to create Google’s own system for distributing its services in addition to making Google apps for other platforms.

“Call it the old model,” one source said. “We were the new model.”

But in order to distribute Android at all, the team at Google would need to develop a phone that would run on the software. Then, they would have to find a carrier that would sell the phone.

“If you said just go out and build a phone, that’s one thing,” a source who previously worked with Rubin said. “That’s what Apple did. We went out and built the phone and then we had to build this infrastructure, this alliance, and partnerships.”

That meant, partnering with chipmakers, smartphone makers, and wireless carriers. All to build a phone that was seen as radically disruptive at the time.

“He [Rubin] maneuvered the waters between the OEMs very skillfully, and often times you don’t find that,” one source that worked with Rubin said. “Often times, people that speak the engineers’ language can’t really sit in a boardroom and listen to CEOS. But he had both”

Google and the Android team basically built its first phone, the G1, as a proof-of-concept. They wanted to show potential partners what Android could do so that they would want to use it on their own phones.

The G1, or HTC Dream Amazon No carrier wanted to partner with Google to launch the first Android phone in 2007. Verizon had turned them down, Sprint wasn’t interested, and AT&T didn’t give them a straight answer. Even T-Mobile, which eventually agreed to release the G1, initially refused.

“It was not a good time in Android history,” the source said.

Carriers wanted to sell content on phones and keep all of the profits for themselves, so they were reluctant to work with any company. They were essentially the gatekeepers between the companies that make the phones and the customers who buy them, and they weren’t willing to compromise.

The Android team knew T-Mobile was their best bet at the time.

After trying to negotiate with T-Mobile for about six months, the carrier came back and said they didn’t want to do a deal with Google, according to our source.

Rubin was one of the few people in Google that knew the T-Mobile deal had balked.

“He was disappointed, but Andy’s not the kind of guy that’s going to wear disappointment on his sleeve,” one source said. “We still had people that hadn’t told us no. He certainly didn’t like it and he knew that was our best prospect and we spent a lot of time on it.”

But T-Mobile eventually came around to the deal — largely because Android co-founder Nick Sears previously worked as a marketing executive for the carrier and was able to convince then-CEO Robert Dodson to take the deal, one source said.

The 'game changer' comes along

Google had finally overcome one of its biggest hurdles. It had found a carrier that would launch its first Android phone. But just as Google was putting the final touches on the G1, something happened: Apple unveiled its smartphone.

“Rubin was so astonished by what Jobs was unveiling that, on his way to a meeting, he had his driver pull over so that he could finish watching the webcast,” Fred Vogelstein writes in his book “Dogfight: How Apple And Google Went To War And Started A Revolution.”

“Holy crap,” Rubin said to one of his colleagues in the car, according to Vogelstein’s book. “I guess we’re not going to ship that phone.”

Rubin and his team modified their original plans and eventually shipped a phone that was much different than their original vision. The first version of the G1 had no touch screen and a slide-out keyboard and was thought to appeal more to the BlackBerry-loving crowd. Apple was the first company to wholly bet that touchscreens would be the preferred means of interacting with computers for the foreseeable future.

“It was a game changer,” one source said in explaining what Apple’s launch had felt like inside Google. “It made us go back to the drawing board and reevaluate: Do we want to launch this product without touch? We had to go back and make that decision.”

Steve Jobs unveils the first iPhone AP

Another former Googler describes it differently. According to Sumit Agarwal, a former head of product management at Google, the company had been developing features like pinch-to-zoom for touch-screen devices long before the iPhone was unveiled.

“Everyone thinks it was this epochal moment,” Agarwal said. “The one thing that I would say might have been directly influenced by Apple was the likelihood that people would want to leap all the way to a full touch screen. Everybody knew that would be the future. I think Apple caused Android to go that direction more quickly.”

The 'crusade against the iPhone'

Although the Android team had to backtrack a bit, the iPhone contributed to Android’s success in a strange way.

The iPhone was released as an exclusive to AT&T, and the buzz around its launch alone was enough to convince the world that this was going to be big.

By 2009 the growing success of the iPhone had become a problem for Verizon, one former Google employee on the Android team said. The company had no real smartphone option that could compete with the iPhone just yet.

The iPhone pushed phone manufacturers and carriers to side with Android.

Carriers viewed the iPhone as the biggest threat to their business models. With the iPhone, Apple owned the relationship with the customer — not AT&T. And customers were switching from other carriers to AT&T to get their hands on the iPhone.

So when the iPhone was announced, it was much easier for Android to sign on with carrier partners.

Compared to the iPhone, Android was a much more appealing opportunity for carriers. Rubin and his team pitched it as a platform for developers, not consumers, which made carriers and phone manufacturers feel more comfortable.

“At the time, the strategy was to counter,” one source who previously worked in Google’s Android division said. “Look at what Android brings as a way for them to actually fight the iPhone from kicking [carriers] out of relevance … Let’s find terms that carriers would be happy with that will help them in their crusade against the iPhone.”

Carriers could modify the phones and add their branding, which gave them some control over the product.

Android’s first big win

The original Motorola Droid Tech-Ex Although BlackBerry has fallen to the bottom of the smartphone market, it was the dominant player in the early 2000s. The iPhone came on strong after its launch, in 2007, but Android was nowhere.

Verizon saw the threat clearly, but it didn’t have an answer. Motorola did, however.

Motorola had developed an Android-based phone. It wasn’t as sleek as the iPhone. It was somewhat bulky and had a slideout keyboard. But it was the best non-iPhone on the market when it was released in 2009.

Verizon spent $100 million marketing Motorola’s phone, known as the Droid, a name it had licensed from George Lucas. It wasn’t as big as the iPhone in sheer numbers, but it was successful enough to make the world start paying attention to Android.

Rubin’s platform broke through to the mainstream and ultimately marginalized the iPhone.

“I remember the toasting and cheering as the team huddled around the war room, intently watching the dashboards and seeing the massive spike building fup on the first day of sales,” Jonathan Matus, a former Google employee who worked as the product marketing lead for Android between 2007 and 2010, told Business Insider.

The 'magic of Andy Rubin'

If you were to ask exactly what made Android the smash hit it is today, you wouldn’t get a clear-cut answer. It’s a mix of things — one being that Rubin knew how to approach carriers in the early 2000s. He knew they wouldn’t want to give up their power, and he, along with the rest of Google’s Android team, convinced them that his software wouldn’t force them to. At the same time, carriers weren’t calling all the shots, either. The first Droid, for instance, was a combined effort on the part of Motorola, Google, and Verizon. That became clear in the final product.

“Open source was important because it gave carriers and manufacturers confidence that Google wouldn’t have absolute power over the Android platform,” one source said.

Rubin doesn’t have any say in what happens to Android anymore — Google’s Sundar Pichai oversees Android, Chrome, and most of Google’s other major products now. Pichai has been in charge of Android for nearly two years — in March 2013, Rubin left the Android department at Google to return to his first love: robotics. He oversaw the robotics department at Google until he left the company in 2014 to focus on his own startup incubator, which is listed as being called Playground.global on Rubin’s LinkedIn profile.

Rubin is an entrepreneur at heart; he knows exactly how to build a company, and he expects all the hurdles that come with it. Android is the strongest testament to that.

Rubin was the one who made Google and the rest of the wireless industry believe he could do the impossible with Android.

“And that’s the magic of Andy Rubin,” said a source who worked closely with him. “When he attracts talent, everybody kind of contributes. And he still has a vision, and it’s very smart, and he kind of puts it together. It’s his ability to attract, this coolness factor he has, to attract talent and to make people believe in this path he’s going down.”