I would highly suggest watching this [ video][1] because it’ll explain how to do it, why it’s difficult to do, etc. There are some devices that spit out a null value while devices such as Motorola all have the same device ID. So using this in general might be a bad idea.
If you watch from the tutorial link I posted, you’ll find there is another way to obtain what you’re trying to in your game. Give it a try, let me know your outcome.
Thanks!
Google I/O 2011: Android Protips: Advanced Topics for Expert Android App Developers - YouTube