Android手機中獲取手機號碼和運營商資訊

2021-06-04 19:41:59 字數 1465 閱讀 7630

**如下:

package com.pei.activity;

import android.os.bundle;

import android.view.view;

import android.view.view.onclicklistener;

import android.widget.button;

import android.widget.textview;

/** * class name:androidutilactivity

* class description:show get sim card info activity

* ps:注意許可權

* date:2012-3-12

* @version 1.00

* @author codyy)peijiangping

*/public class androidutilactivity extends activity

class buttonlistener implements onclicklistener

} }}

package com.pei.activity;

import android.content.context;

import android.telephony.telephonymanager;

/** * class name:simcardinfo

* class description:讀取sim卡資訊

* ps: 必須在加入各種許可權

* date:2012-3-12

* * @version 1.00

* @author codyy)peijiangping

*/public class simcardinfo

/*** role:獲取當前設定的**號碼

* date:2012-3-12

* @author codyy)peijiangping

*/public string getnativephonenumber()

/*** role:telecom service providers獲取手機服務商資訊

* 需要加入許可權

* date:2012-3-12

* * @author codyy)peijiangping

*/public string getprovidersname() else if (imsi.startswith("46001")) else if (imsi.startswith("46003"))

return providersname;

}}

<?xml version="1.0" encoding="utf-8"?>

Android 獲取手機的手機號

1.獲取手機號 telephonymanager telephonymanager telephonymanager getsystemservice context.telephony service string line1number telephonymanager.getline1numb...

獲取手機號歸屬地

如下 test public void tt catch interruptedexception e finally public void get string v phone finally catch clientprotocolexception e catch parseexceptio...

手機號判斷

public class smsutil toast.maketext activity,手機號碼輸入有誤!toast.length short show return false 驗證手機格式 public static boolean ismobileno string mobilenums 1...