Click here to Skip to main content
15,911,646 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I wanna know is it possible for the browser to use web application and find device information e.g. IMEI or UUID. If yes then kindly give me some direction.

Thanks

What I have tried:

I have tried to search on web but not find the exact information that I want. But instead of this I just get information of current device resolution.
Posted
Updated 3-Jun-16 20:34pm

1 solution

No, browsers do not allow your web application to determine the device-based capabilities. Web browser just provides the details about the, well, browser itself. A few other properties can be found, such as operating system being used, location etc. using the IP address etc.

Other device-specific characteristics are always hidden from the web application. Browsers don't even allow your web applications to communicate with offline applications and protocols unless user allows it to, or there is already an application that can handle the protocol request. For example, How do BitTorrent magnet links work? - Stack Overflow?

You are left with two options.

1) Forget about this way of performing the task. This won't work. If you still want to enforce it, online services may target your web application as a malware application.
2) Try to get an offline service that can be executed on the mobile device. Then get the device-specific traits from that service itself. There is another way of doing this. You can use the native Android application to be distributed for your clients. Use a WebView control in that application to load the web site. However, while you do, on the background you can access the device properties and send them to the web application in the URL itself, such as, http://www.example.com/default.aspx?data=value&data2=value2

Building Web Apps in WebView | Android Developers[^]
How to get the device's IMEI/ESN programmatically in android? - Stack Overflow[^]

Remember, even this method would require your Android application to get permissions to query device properties and sensitive data. For example, reading the Phone state would require you to explicitly get the permission for READ_PHONE_STATE.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900