Are there any special JavaScript methods you can access on Android to identify the user or the device?
In particular we want to uniquely identify a user's multiple phones in their household so that they can manage their phones' app usage centrally. E.g. if 开发者_开发知识库we could get their phone's name like "Jim's Phone" or get the serial or IMEI, that would be great.
As Paul mentioned, this is not possible because device does not expose its data via browser. On the other hand, native apps can access device data called Universally Unique Identifier called uuid. By using cross platform like PhoneGap you can easily port your mobile web app into native mobile app. In this way, you can uniquely identify users. (With phonegap, you can access the id with javascript device.uuid).
Another option is to assign unique identifier to users and store it in local storage or cookie. This has a risk of losing the tracking of users if user clears his local storage or cookie. To solve this problem, you can provide some service for users to recover the information.
In any case, you should do this with users permission because of privacy issue.
精彩评论