What information can I get from the Android JavaScript browser?

I know that I can get the width / height of the screen in the browser, can I get any other information about the device? Device name, OS, media, etc.

+3
source share
2 answers

It seems that only the additional resources that you have provided are related to the density and screen resolution: http://developer.android.com/guide/webapps/index.html . However, if you intend to display this page in WebView, you can use the Java-Javascript bridge to access any information available for the standard Java API (or non-standard if you want to get creative and use reflection ;-))

+2

: , , javascript > < .

android.os.Build . :

String s="Debug-infos:";
s += "\n OS Version: " + System.getProperty("os.version") + "(" + android.os.Build.VERSION.INCREMENTAL + ")";
s += "\n OS API Level: " + android.os.Build.VERSION.SDK;
s += "\n Device: " + android.os.Build.DEVICE;
s += "\n Model (and Product): " + android.os.Build.MODEL + " ("+ android.os.Build.PRODUCT + ")";
-1

Source: https://habr.com/ru/post/1789000/


All Articles