How to check android device codename?

android

Solution

The Build class gives access to various device property strings.

Problem

Some android devices (models) are released in many versions. I suppose they differ in their firmwares (ROM) which varies according to the region (and the carrier) it has been sold in. The question is how can I check whether my Samsung Galaxy S3 is md0, m0skt or maybe d2spr ? The best would be to check it programmatically. Is it possible?

Original source