Android - What are the names of the various versions of the Android OS, and how are these names chosen?

Each version of Android since 1.5 has been developed with a specific codename. These codenames are chosen alphabetically and have thus far all been dessert items (or, generically, sweet/sugary foods). Some codenames are associated with more than one version number, while others are limited to only a specific one, and the reason for this inconsistency is not currently known. The naming typically appears to correspond to changes in the developer API levels, but this is not always true (example: 3.0 and 3.1 are both "Honeycomb" but they have different API levels).

The following names are used for the currently existing Android releases. Note that versions 1.0 and 1.1 were not publicly named. However, Android 1.1 was internally referred to as "Petit-Four" (noted in Traroth's answer, confirmed here):

Cupcake:

  • Android 1.5

Donut:

  • Android 1.6

Eclair:

  • Android 2.0
  • Android 2.1

Froyo: (short for "frozen yogurt")

  • Android 2.2

Gingerbread:

  • Android 2.3

Honeycomb:

  • Android 3.0
  • Android 3.1
  • Android 3.2

Ice Cream Sandwich:

  • Android 4.0

Jelly Bean:

  • Android 4.1
  • Android 4.2
  • Android 4.3

KitKat:

  • Android 4.4

Lollipop:

  • Android 5.0
  • Android 5.1

Marshmallow:

  • Android 6.0

Nougat: (official name: https://twitter.com/Android/status/748642375908589568)

  • Android 7.0
  • Android 7.1

Oreo:

  • Android 8.0
  • Android 8.1

Pie:

  • Android 9.0

Android 10 (no codename)

Android 11 (no codename)


Eldarerathis summarized it very well. To add some things: The 1.1 version was internally called Petit Four by Google, and that's how it all began. Google is installing a giant pastry on their lawn at Mountain View each time a new version is about to be launched.

You can see pictures of that display at different stages here:

Overall display (Cupcake to Eclair, with Nexus One) Donut, Android logo, Nexus one, Cupcake, Eclair

HoneycombFroyo

Eclair, Froyo, Gingerbread, Honeycomb and Ice Cream Sandwich Gingerbread, Icecream Sandwich, Honeycomb

Kit-Kat KitKat, Jellybean

Lollipop Lollipop

Marshmallow Marshmallow

Nougat Nougat

Oreo Oreo


https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels contains a table that links all the naming mess, excerpt:

Platform Version    API Level    VERSION_CODE
Android 6.0         23           M
Android 5.1         22           LOLLIPOP_MR1
Android 5.0         21           LOLLIPOP
...

Web archive link.