編輯:關於android開發
第一種方法:
獲取手機的IMSI碼,並判斷是中國移動\中國聯通\中國電信
TelephonyManager telManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
/** 獲取SIM卡的IMSI碼
* SIM卡唯一標識:IMSI 國際移動用戶識別碼(IMSI:International Mobile Subscriber Identification Number)是區別移動用戶的標志,
* 儲存在SIM卡中,可用於區別移動用戶的有效信息。IMSI由MCC、MNC、MSIN組成,其中MCC為移動國家號碼,由3位數字組成,
* 唯一地識別移動客戶所屬的國家,我國為460;MNC為網絡id,由2位數字組成,
* 用於識別移動客戶所歸屬的移動網絡,中國移動為00,中國聯通為01,中國電信為03;MSIN為移動客戶識別碼,采用等長11位數字構成。
* 唯一地識別國內GSM移動通信網中移動客戶。所以要區分是移動還是聯通,只需取得SIM卡中的MNC字段即可
*/
String imsi = telManager.getSubscriberId();
if(imsi!=null){
if(imsi.startsWith("46000") || imsi.startsWith("46002")){//因為移動網絡編號46000下的IMSI已經用完,所以虛擬了一個46002編號,134/159號段使用了此編號
//中國移動
}else if(imsi.startsWith("46001")){
//中國聯通
}else if(imsi.startsWith("46003")){
//中國電信
}
}
第二種方法
TelephonyManager telManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
String operator = telManager.getSimOperator();
if(operator!=null){
if(operator.equals("46000") || operator.equals("46002")){
//中國移動
}else if(operator.equals("46001")){
//中國聯通
}else if(operator.equals("46003")){
//中國電信
}
}
HttpCache in android
HttpCache in android 概述 http Cache指的是web浏覽器所具有的復用本地已緩存的文檔”副本”的能力。我
Android Picasso 獲取遠程圖片並顯示,
Android Picasso 獲取遠程圖片並顯示, Picasso是Square公司開源的一個Android圖形緩存庫,地址http://square.git
暫停和恢復Activity Android,activityandroid
暫停和恢復Activity Android,activityandroid暫停和恢復Activity(Pausing and Resuming an Activity)
環形進度條,圓形進度條
環形進度條,圓形進度條本文參考借鑒http://blog.csdn.net/jdsjlzx/article/details/42497135 先上效果圖: 自定義控件: