zoukankan      html  css  js  c++  java
  • Android获取手机和系统版本等信息的代码

     1 String phoneInfo = "Product: " + android.os.Build.PRODUCT;
     2                 phoneInfo += "\n CPU_ABI: " + android.os.Build.CPU_ABI;
     3                 phoneInfo += "\n TAGS: " + android.os.Build.TAGS;
     4                 phoneInfo += "\n VERSION_CODES.BASE: " + android.os.Build.VERSION_CODES.BASE;
     5                 phoneInfo += "\n MODEL: " + android.os.Build.MODEL;
     6                 phoneInfo += "\n SDK: " + android.os.Build.VERSION.SDK;
     7                 phoneInfo += "\n VERSION.RELEASE: " + android.os.Build.VERSION.RELEASE;
     8                 phoneInfo += "\n DEVICE: " + android.os.Build.DEVICE;
     9                 phoneInfo += "\n DISPLAY: " + android.os.Build.DISPLAY;
    10                 phoneInfo += "\n BRAND: " + android.os.Build.BRAND;
    11                 phoneInfo += "\n BOARD: " + android.os.Build.BOARD;
    12                 phoneInfo += "\n FINGERPRINT: " + android.os.Build.FINGERPRINT;
    13                 phoneInfo += "\n ID: " + android.os.Build.ID;
    14                 phoneInfo += "\n MANUFACTURER: " + android.os.Build.MANUFACTURER;
    15                 phoneInfo += "\n USER: " + android.os.Build.USER;
    16                 try
    17                 {
    18                     PackageManager packageManager = getPackageManager();
    19                     // getPackageName()是你当前类的包名,0代表是获取版本信息
    20                     PackageInfo packInfo = packageManager.getPackageInfo(getPackageName(), 0);
    21                     phoneInfo += "\n APPVER: " + packInfo.versionCode;
    22                 }
    23                 catch (NameNotFoundException e)
    24                 {
    25                     e.printStackTrace();
    26                 }
    27                 phoneInfo += "\n Language: " + Locale.getDefault().getLanguage();
    28 
    29                 ConnectivityManager conn = (ConnectivityManager) ScActivity.this.getSystemService(Context.CONNECTIVITY_SERVICE);
    30                 conn.getActiveNetworkInfo().getTypeName();//MOBILE->GPRS;WIFI
    31                 phoneInfo += "\n network: " + conn.getActiveNetworkInfo().getTypeName();

    对应的信息:

    Product: full_m805_892x_evm
    CPU_ABI: armeabi-v7a
    TAGS: test-keys
    VERSION_CODES.BASE: 1
    MODEL: azt7012h
    SDK: 15
    VERSION.RELEASE: 4.0.4
    DEVICE: m805_892x
    DISPLAY: 20121210_ver1.0
    BRAND: Android
    BOARD: m805_892x_evm
    FINGERPRINT: Android/full_m805_892x_evm/m805_892x:4.0.4/IMM76D/eng.watt.20120826.153847:eng/test-keys
    ID: IMM76D
    MANUFACTURER: telechips
    USER: watt
    APPVER: 2
    Language: zh
    network: WIFI

  • 相关阅读:
    Windbg Call Stack(调用堆栈)窗口的使用
    设置微软符号服务器的又一方法
    windbg是如何搜索符号文件的?
    如何关闭/禁用.NET JIT调试对话框
    EXCEPTION_HIJACK(0xe0434f4e)异常的抛出过程
    异常EXCEPTION_HIJACK(0xe0434f4e)
    Windows WoW64浅析
    在执行一行代码之前CLR做的68件事
    异常CLRDBG_NOTIFICATION_EXCEPTION_CODE( 0x04242420)的抛出过程
    异常CLRDBG_NOTIFICATION_EXCEPTION_CODE( 0x04242420)
  • 原文地址:https://www.cnblogs.com/androidxiaoyang/p/2958946.html
Copyright © 2011-2022 走看看