I am developing an Android app (and soon iPhone app). I need a way to identify the handset from server side. I was thinking I could write a secret (a cryptographic string of some sort) in persistent storage on the device the first time the app is run, and use this to identify the handset next time it speaks to the back end server. Is this how to do it? Is there a better way?
Clarification: The question should have said, I want to identify the user of the app. I'm not interested in tracking the actual device.