简体   繁体   English

我可以从Android浏览器JavaScript获得什么信息?

[英]What information can I get from the android browser JavaScript?

I know I can get screen width/height in a browser, can I get any other information about the device? 我知道我可以在浏览器中获得屏幕宽度/高度,我可以获得有关该设备的任何其他信息吗? Device name, OS, carrier, etc? 设备名称,操作系统,运营商等?

It seems as though the only additional resources you're provided with have to do with screen density and resolution: http://developer.android.com/guide/webapps/index.html . 您提供的唯一额外资源似乎与屏幕密度和分辨率有关: http//developer.android.com/guide/webapps/index.html However, if you are going to display this page in a WebView , you can utilize the Java-Javascript bridge to access any information available to the standard Java API (or non standard if you want to get creative and use reflection ;-) ) 但是,如果要在WebView显示此页面,则可以使用Java-Javascript桥来访问标准Java API可用的任何信息(如果您想获得创意并使用反射,则使用非标准;-))

Edit: Oops, didn't see you meant from the browser javascript >< disregard information below. 编辑:糟糕,没有看到你的意思从浏览器javascript> <忽略下面的信息。

android.os.Build provides a lot of information. android.os.Build提供了很多信息。 Try: 尝试:

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 + ")";

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 javascript中如何获取设备信息和浏览器信息? - How can i get device information and browser information in javascript? 浏览器以什么顺序/优先级从CSS和Javascript获取信息? - In what order/priority does a browser get information from CSS and Javascript? 如何从浏览器获取基本身份验证信息 - How can I get basic auth information from browser 我可以使用Javascript获取命令行信息吗? 不是浏览器版本信息 - Can I get the Command line information using Javascript? It is not the browser version information 我可以直接或间接获取使用Javascript运行浏览器的命令行信息吗? - Can I get the command line information of running browser using Javascript directly or indirectly? 在浏览器中分析javascript时,如何获取更多特定信息? - How can I get more specific information when profiling javascript in the browser? 如何使用 JavaScript 制作包含浏览器信息的无序列表? - How can I make an unordered list with browser information using JavaScript? Javascript是否可以从浏览器外部进行选择? - Can Javascript get a selection from outside the browser? Javascript可以在浏览器中收集哪些信息? - What information could be gathered by Javascript within browser? 在Javascript中单击后,如何从用户列表中获取特定用户信息? - How can I get the specific user information from the list of users upon click in Javascript?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM