开发者

Android UID vs iPhone UID

UID - is unique for every device. But is it possible to determine to which device it belongs(iPhone or Android I mean)?

iPhone devices are quite standardized - they come with almost same hardware but Android is almost on every device(including iPhone in 开发者_JS百科some cases)


This isn't a good idea. It's quite common to use some feature of the underlying hardware when generating a UUID on a platform - MAC address for example - but you have no guarantees.

I've used device ID (a UUID) from iPAQs in some mobile data collection applications to trace where data was collected/uploaded from, and whilst it was usual to find related batches of iPAQs would have similar patterns this would change radically with different models and sometimes within the same model range for no apparent reason.

It's possible to overlook how mind-bogglingly vast the space of UUIDs is. To quote wikipedia

In other words, only after generating 1 billion UUIDs every second for the next 100 years, the probability of creating just one duplicate would be about 50%. The probability of one duplicate would be about 50% if every person on earth owns 600 million UUIDs.

Having said which I did hear that Second Life once encountered a problem with duplicate UUIDs being generated (where every object in the world is identified by a UUID) because of a very very obscure problem in the Python library they were using to generate them, so the risk of collision is probably a mite higher than the theoretical due to coding assumptions.


I think you shouldn't put any assumptions in there - maybe they can be differentiated now, but maybe not next month. Take it as a black box.

I am not sure if it is guaranteed that a UID from one platform cannot appear on the other as well, but I don't think this would ever become up a problem ("highly unlikely and maybe not possible at all").

If you really need to differentiate, use some custom extension, i.e. prefix them with some kind of device type string.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜