1. /** 
  2.  * 系统工具类 
  3.  * Created by zhuwentao on 2016-07-18. 
  4.  */  
  5. public class SystemUtil {  
  6.   
  7.     /** 
  8.      * 获取当前手机系统语言。 
  9.      * 
  10.      * @return 返回当前系统语言。例如:当前设置的是“中文-中国”,则返回“zh-CN” 
  11.      */  
  12.     public static String getSystemLanguage() {  
  13.         return Locale.getDefault().getLanguage();  
  14.     }  
  15.   
  16.     /** 
  17.      * 获取当前系统上的语言列表(Locale列表) 
  18.      * 
  19.      * @return  语言列表 
  20.      */  
  21.     public static Locale[] getSystemLanguageList() {  
  22.         return Locale.getAvailableLocales();  
  23.     }  
  24.   
  25.     /** 
  26.      * 获取当前手机系统版本号 
  27.      * 
  28.      * @return  系统版本号 
  29.      */  
  30.     public static String getSystemVersion() {  
  31.         return android.os.Build.VERSION.RELEASE;  
  32.     }  
  33.   
  34.     /** 
  35.      * 获取手机型号 
  36.      * 
  37.      * @return  手机型号 
  38.      */  
  39.     public static String getSystemModel() {  
  40.         return android.os.Build.MODEL;  
  41.     }  
  42.   
  43.     /** 
  44.      * 获取手机厂商 
  45.      * 
  46.      * @return  手机厂商 
  47.      */  
  48.     public static String getDeviceBrand() {  
  49.         return android.os.Build.BRAND;  
  50.     }  
  51.   
  52.     /** 
  53.      * 获取手机IMEI(需要“android.permission.READ_PHONE_STATE”权限) 
  54.      * 
  55.      * @return  手机IMEI 
  56.      */  
  57.     public static String getIMEI(Context ctx) {  
  58.         TelephonyManager tm = (TelephonyManager) ctx.getSystemService(Activity.TELEPHONY_SERVICE);  
  59.         if (tm != null) {  
  60.             return tm.getDeviceId();  
  61.         }  
  62.         return null;  
  63.     }  
  64. }  

更多相关文章

  1. Android property系统分析
  2. JS判断请求来自Android手机还是iPhone手机
  3. Android判断网络是否可用,调用系统网络设置
  4. 非常不错的资金管理系统android版客户端源码
  5. Android原生C语言捕获按键
  6. PHP如何检测手机是什么系统?
  7. 调用android系统自带的功能
  8. 手机上使用google 搜索引擎
  9. 配置android手机下方的三个按键震动

随机推荐

  1. android中修改默认语言
  2. Linux Kernel(Android) 加密算法总结(二)-
  3. Android所有系统资源图标android.R.drawa
  4. android -sdcard
  5. android获取当前窗口的宽度和高度
  6. android 获取屏幕宽高、view宽高
  7. Android SystemServer
  8. Android 两个Activity切换时回调函数调用
  9. Android客户端GPS定位源码
  10. Android(安卓)Q 色彩(颜色)模式解析(一)