JS获取手机型号和系统】的更多相关文章

废话不多说,直接上源码 <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=…
###前段通过js获取手机型号 需求: 用户登录后记录当前的手机型号并记录 插件: mobile-detect.js插件地址 mobile-device-js插件地址 使用步骤: 获取UA信息->根据安卓和IOS不同的处理 IOS再通过插件mobile-device-js去获取型号 安卓通过解析UA信息去获取build之前的信息得到手机型号 //引入插件 <!--获取手机型号相关js--> <script type="text/javascript" src=&…
1.js 判断IOS版本号 先来观察 iOS 的 User-Agent 串: iPhone 4.3.2 系统:Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7 Safari/6533.18.5iPone 5.1 系统:Mozilla/5.0 (iPhone; U; CPU iPhone…
新添加判断iPhone 7.iPhone 7 Plus ,我手里没有7,判断不对表打我~ FQ找的资料:http://www.iphonehacks.com/download-iphone-ios-firmware 1.手机系统:iPhone OS NSString* phoneVersion = [[UIDevice currentDevice] systemVersion]; 2.手机类型:iPhone 6 NSString* phoneModel = [self iphoneType];/…
在AndroidManifest.xml文件中要添加 <uses-permission android:name="android.permission.READ_PHONE_STATE" />  才有权限 [java] view plaincopy TelephonyManager tm = (TelephonyManager) this.getSystemService(TELEPHONY_SERVICE); /* * 电话状态: * 1.tm.CALL_STATE_I…
原先获取不了苹果系列的型号,但转换思路,先推断是否是苹果,再用分辨率获取型号 //获取手机型号函数begin function getPhoneType(){  //正则,忽略大写和小写 var pattern_phone = new RegExp("iphone","i"); var pattern_android = new RegExp("android","i"); var userAgent = navigator.…
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); TextView textView = (TextView) findViewById(R.id.text); textView.setText("Product Model: " + android.os.Build.MODEL + ",&qu…
Android开发平台中,可通过TelephonyManager 获取本机号码. TelephonyManager phoneMgr=(TelephonyManager)this.getSystemService(Context.TELEPHONY_SERVICE); txtPhoneNumber.setText(phoneMgr.getLine1Number()); //txtPhoneNumber是一个EditText 用于显示手机号 注: 根据Android的安全机制,在使用Telepho…
Android开发平台中,可通过TelephonyManager 获取本机号码. TelephonyManager phoneMgr=(TelephonyManager)this.getSystemService(Context.TELEPHONY_SERVICE); txtPhoneNumber.setText(phoneMgr.getLine1Number()); //txtPhoneNumber是一个EditText 用于显示手机号 注: 依据Android的安全机制,在使用Telepho…
只需 navigator.language 就可以获取手机系统语言,要做国际化的童鞋可以看看 如图:(第一次是简体,第二次切换English),zh-CN,en-US是语言代码 更多语言代码,请查看http://www.lingoes.cn/zh/translator/langcode.htm…
在开发中 我们有时候会需要获取当前手机的系统版本来进行判断,或者需要获取一些当前手机的硬件信息. android.os.Build类中.包括了这样的一些信息.我们可以直接调用 而不需要添加任何的权限和方法.…
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; CFShow(infoDictionary); // app名称 NSString *app_Name = [infoDictionary objectForKey:@"CFBundleDisplayName"]; // app版本 NSString *app_Version = [infoDictionary objectForKey:@&qu…
获取手机设备信息,如name.model.version等,但如果想获取具体的手机型号,如iphone5.5s这种,就需要如下这种 swift: func phonetype () -> String { let name = UnsafeMutablePointer<utsname>.alloc(1) uname(name) let machine = withUnsafePointer(&name.memory.machine, { (ptr) -> String? i…
获取手机设备信息,如name.model.version等, 但如果想获取具体的手机型号,如iphone5.5s这种,就需要如下这种(含Swift和OC两种写法) Swift建议添加到extension,使用简单,直接新建个extension,拷贝下面代码进去即可. 以下是最新的类型:一直到iPhone X import Foundation import UIKit public extension UIDevice { var modelName: String { var systemIn…
Device模块管理设备信息,用于获取手机设备的相关信息,如IMEI.IMSI.型号.厂商等.通过plus.device获取设备信息管理对象. imei: 设备的国际移动设备身份码 imsi: 设备的国际移动用户识别码 model: 设备的型号 vendor: 设备的生产厂商 uuid: 设备的唯一标识 直接上代码: document.addEventListener('plusready', function(){ function device(name){ return plus.devi…
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> <script src="js/jquery-2.1.4.min.js"></script> <script type="text/javascript" src=&qu…
摘要 有时需要获取电脑的相关信息.这时可以通过调用windows api的方式,进行获取. 方法 可以通过在powershell中 通过下面的命令进行查询,然后可以通过c#调用获取需要的信息. gwmi + windows api 如图所示 对应的c#代码为 /// <summary> /// 获取硬盘容量 /// </summary> public string GetDiskSize() { string result = string.Empty; StringBuilder…
方案一 <div class="div user-input"> <input type="number" class="code" name="verify" placeholder="请输入手机验证码" required maxlength="6"> <input type="button" class="obtain ge…
/**********************************浏览器型号搜集start*************************************/ var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串 var ua = navigator.userAgent.toLowerCase(); if (window.ActiveXObject){ $("#browerVersion").val("…
<script language="javascript"> window.onload = function () { var n = navigator.userAgent; if (n.indexOf('Android') > -1 || n.indexOf('Linux') > -1) { console.log("安卓手机"); } else if (n.indexOf('iPhone') > -1) { console.lo…
<?php $user_agent = $_SERVER['HTTP_USER_AGENT'];     if (stripos($user_agent, "iPhone")!==false) {         $brand = 'iPhone';     } else if (stripos($user_agent, "SAMSUNG")!==false || stripos($user_agent, "Galaxy")!==false…
由于oppo手机自带浏览器的高度底部多了144px导航栏 所以:专门针对oppo手机做适配: var dowphone = document.getElementById("dowphone"); function validBrowser(){ var u_agent = navigator.userAgent; if(u_agent.indexOf('OPPO R7s Build')>-1){ dowphone.style.width = "54%"; d…
<script type="text/javascript"> function Location() {}; Location.prototype.getLocation = function (callback) { var options = { enableHighAccuracy: true, maximumAge: 1000 }; this.callback = Object.prototype.toString.call(callback) == "…
/*========================================= 函数功能:获取浏览器类型 =========================================*/ function getBrowser() { var type = "pc" var ua = navigator.userAgent.toLowerCase(); /* Navigator 是HTML DOM中的内置对象,它包含有关浏览器的信息.userAgent是Navigator…
navigator为Window对象的一个属性,指向了一个包含浏览器相关信息的对象. navigatot中包含了一些常用到的属性,如: navigator.appVersion 浏览器的版本号 navigator.appName 浏览器的名称 navigator.language 浏览器使用的语言 navigator.platform 浏览器使用的平台 navigator.userAgent 浏览器的user-agent信息,它是一个特殊字符串头, 使得服务器能够识别客户使用的操作系统及版本.C…
window.addEventListener("offline", function() { alert('offline') }, false); window.addEventListener("online", function() { alert('online') }, false);…
<html> <head> <title>DeviceOrientationEvent</title> <meta charset="UTF-8" /> </head> <body> <p>左右:<span id="alpha">0</span></p> <p>前后:<span id="beta"&…
网页可见区域宽:document.body.clientWidth 网页可见区域高:document.body.clientHeight 网页可见区域宽:document.body.offsetWidth (包括边线的宽) 网页可见区域高:document.body.offsetHeight (包括边线的宽) 网页正文全文宽:document.body.scrollWidth 网页正文全文高:document.body.scrollHeight 网页被卷去的高:document.body.scr…
+ (NSString *)iphoneType {            //    需要导入头文件:#import <sys/utsname.h>        struct utsname systemInfo;        uname(&systemInfo);        NSString *platform = [NSString stringWithCString:systemInfo.machine encoding:NSASCIIStringEncoding]; …
代码如下: package com.zzw.getPhoneInfos; import android.app.Activity; import android.content.Context; import android.os.Build; import android.os.Bundle; import android.telephony.TelephonyManager; import android.util.Log; public class MainActivity extends…