This image is Modified. Original by Google under creative commons
Different versions of Google's open source Smartphone OS, Android, are named after desserts and these names are in alphabetical order.
Before releasing Android OS there were some internal releases and according to Wikipedia those releases were names as Android alpha. Android beta was released in November 2007. These were not commercial versions. First commercial version (Android 1.0) was released in September 2008. On 9 February 2009, Android 1.1 was released as an update with some new features and bug fixes. Android 1.0 and 1.1 had no official codename.
You might also like: History of Android and features of Android KitKat
After starting versions, Android 1.5 (based on Linux kernel) was first one with official codename "Cupcake". Codenames were started from alphabet C maybe because of alpha and beta versions.
After Android "Cupcake," Android 1.6 was codenamed as "Donut" and after it Android "Eclair" came out. In the same way all other versions are codenamed alphabetically and at this time latest one is "Nougat."
Read also: How to create street view with Android phone
There are lots of different versions which have same codename e.g. Android 4.0–4.0.4 = Ice Cream Sandwich. Have a look on the picture below for alphabetical order of Android codenames:
Revised and updated