We've talked about how the hardware inside your phone can make a difference when it comes to the user experience. Now it's time to talk about the software. Software is the single-most important piece of any computer. Whether we're talking about the small computer you keep in your pocket or the room-sized clusters that do things like manage space missions, without software all of those circuits and wires and chips would do nothing. It even takes software to turn your phone on and start it up before you can see it doing anything. No matter how expensive or new the hardware inside your phone is, it would be useless without all the work that went into programming it to do something.

We're going to focus on Android with this because that's what we do here, but a lot of the ideas we're going to talk about are the same for any computer you can buy or make yourself. The biggest differences (and challenges) are that our phones are mobile devices that aren't very big, and that means everything is done with an eye for power efficiency. Extreme power efficiency. After the right parts are designed and assembled to try and provide the best user experience with a tiny power supply, it's time for the software teams to get to work. What is Android

We've mentioned this before, but it's worth covering again — Android probably isn't what you think it is. The word gets used in quite a few different ways — Android is a brand, Android is an operating system and Android is source code. What Android is, at the basic level, is a bunch of code that can be used to run applications. It comes with a basic user interface to its core features but it requires a lot of time and development to make it run on whatever device it's intended to run on. While everything you need to have to create a bootable software image is included in the Android source code, you can't create a single image and installer that can be used for all hardware. Support for the specific hardware needs to be declared before you try to build it into something that will actually run. Once that is done you can build a running Linux operating system and install it to the intended target. Before you can ship anything, though, you'll need to tweak and twiddle a lot of it — that's what we mean when we say optimization. The operating system

There are two levels of software — the operating system and its associated extras and applications that are installed to run on it. The people who made your phone not only have to worry about making the operating system perform well, but have to maintain compatibility with a million or so applications. Notice we said "maintain compatibility," not optimize anything for third-party apps. That's an entirely different matter, and Google does most of the work there with the Android application framework — all the phone manufacturer needs to do is try not to break any of it. And that is more work than you think it is, because of the way these companies change the way Android looks and feels. Every Android model is running different software. No two Android models are the same. Even phones from the same manufacturer with the same name can run different software in different regions (or for different customers — your phone company), and they do. And that makes sense. We don't have gigabytes of storage space so support for every different model of Samsung Galaxy S7 — there are more than 30 versions of that one phone — built into one piece of software isn't practical. This is why, for example, you can't download the Verizon update for the S7 and use it on your AT&T model. But outside of the small changes made for different SKUs of the same model, the base software used across every Galaxy S7 (with the Qualcomm CPU) is the same. To keep with our Galaxy S7 example, you need to remember also that "Touchwiz" is not a skin or a launcher. It is the operating system. Samsung takes that base software provided from Google and changes it to better suit its needs. The way it looks, the features it has and the options and settings are all built by Samsung and added into Android in a way that will still allow third-party apps to install and run. There are a lot of parts of the Android code that Samsung doesn't alter (or can't alter) because Google requires certain things to be kept in order to use their store and applications. It's up to Google to improve and maintain those portions, but a large part of the operating system is left to Samsung to optimize for the specific hardware it is to be installed on. What is optimization?

Software optimization is a necessary evil. It's time-consuming and difficult. But without it, the user experience would suffer. Google continuously optimizes Android code on a hardware-independent level. Techniques like loop unrolling, using fewer function calls and more memory efficient routines are things that benefit every device that runs Android. But Samsung (in our example) has to further these for the hardware they are using to reduce the total instruction path length (the number of CPU cycles required goes down with fewer instructions) and reduce the memory footprint, as well as build on things like scheduling and cache optimization for their specific model of CPU. All while adding more features and functions to the user and maintaining compatibility with Google Play. Generally, the process goes something like this: Decide what features your customers want. Then throw 80% of them away and decide what features are feasible.

Define the specific hardware that will be used.

Build a bootable version of the operating system with the required features all working.

Find the bottlenecks, try to fix them, rinse and repeat. Finding those bottlenecks is difficult. Fixing them is even more difficult. And there are several ways to tackle it all. One way is to not add features to the operating system that create overhead, which gives you fewer things that can go wrong. That's where the 2015 Moto G shined. It was a very basic phone, with very basic software. After a talented team optimized the software that shipped on the phone, it was one of the most fluid Android experiences of the year — until you added a handful of apps from Google Play into the mix. Then it was apparent that the hardware inside wasn't as capable of doing many things at once as more expensive phones were. The hardware used was inexpensive so that the phone could be inexpensive, and the software optimization on just the operating system was excellent. A second way is to continue to optimize your platform while not stripping out any important features, and letting better hardware help minimize the impact. The Galaxy S7 is a product of every bit of work the software development team at Samsung has done since the original Galaxy S was introduced, running atop hardware powerful enough to deliver it in a smooth and friendly package. The result is a phone that is universally praised by both the industry and users alike. Missteps with memory management and sluggishness we saw up and including the Galaxy S6 are all but gone, and whether you love or hate the final product you can't say that it's not one of the best Android phones you can buy today when it comes to performance. Memory management