当前位置:操作系统 > 安卓/Android >>

TelephonyManager有什么信息

这是模拟器上的信息:
 
[plain]  
01-29 02:42:41.962: V/PhoneInfo(1002): DeviceID = 000000000000000  
01-29 02:42:41.992: V/PhoneInfo(1002): DeviceSoftwareVer = null  
01-29 02:42:41.992: V/PhoneInfo(1002): Line1Number = 15555215554  
01-29 02:42:41.992: V/PhoneInfo(1002): NetworkCountryIso = us  
01-29 02:42:41.992: V/PhoneInfo(1002): NetworkOperator = 310260  
01-29 02:42:41.992: V/PhoneInfo(1002): NetworkOperatorName = Android  
01-29 02:42:41.992: V/PhoneInfo(1002): NetworkType = 3  
01-29 02:42:41.992: V/PhoneInfo(1002): PhoneType = 1  
01-29 02:42:42.002: V/PhoneInfo(1002): SimCountryIso = us  
01-29 02:42:42.002: V/PhoneInfo(1002): SimOperator = 310260  
01-29 02:42:42.002: V/PhoneInfo(1002): SimOperatorName = Android  
01-29 02:42:42.002: V/PhoneInfo(1002): SimSerialNumber = 89014103211118510720  
01-29 02:42:42.002: V/PhoneInfo(1002): SimState = 5  
01-29 02:42:42.002: V/PhoneInfo(1002): SubscriberId = 310260000000000  
01-29 02:42:42.002: V/PhoneInfo(1002): VoiceMailAlphaTag = Voicemail  
01-29 02:42:42.002: V/PhoneInfo(1002): VoiceMailNumber = +15552175049  
01-29 02:42:42.002: V/PhoneInfo(1002): ----------------------------------------------------------------  
01-29 02:42:42.002: V/PhoneInfo(1002): Build.VERSION.Codename = REL  
01-29 02:42:42.002: V/PhoneInfo(1002): Build.VERSION.Incremental = 43546  
01-29 02:42:42.012: V/PhoneInfo(1002): Build.VERSION.Release = 2.2  
01-29 02:42:42.012: V/PhoneInfo(1002): Build.VERSION.SdkInt = 8  
01-29 02:42:42.012: V/PhoneInfo(1002): Build.Device = generic  
01-29 02:42:42.012: V/PhoneInfo(1002): Build.Display = google_sdk-eng 2.2 FRF91 43546 test-keys  
01-29 02:42:42.022: V/PhoneInfo(1002): Build.Fingerprint = generic/google_sdk/generic/:2.2/FRF91/43546:eng/test-keys  
01-29 02:42:42.022: V/PhoneInfo(1002): Build.Hardware = goldfish  
01-29 02:42:42.022: V/PhoneInfo(1002): Build.Host = e-honda.mtv.corp.google.com  
01-29 02:42:42.022: V/PhoneInfo(1002): Build.ID = FRF91  
01-29 02:42:42.022: V/PhoneInfo(1002): Build.Manufacturer = unknown  
01-29 02:42:42.022: V/PhoneInfo(1002): Build.Model = google_sdk  
01-29 02:42:42.022: V/PhoneInfo(1002): Build.Product = google_sdk  
01-29 02:42:42.022: V/PhoneInfo(1002): Build.Type = eng  
01-29 02:42:42.033: V/PhoneInfo(1002): Build.User = android-build  
 
这是手机上获得的信息:
[plain]  
01-29 10:44:11.319: V/PhoneInfo(15919): DeviceID = 35651304127****  
01-29 10:44:11.319: V/PhoneInfo(15919): DeviceSoftwareVer = 356513041279****  
01-29 10:44:11.319: V/PhoneInfo(15919): Line1Number =   
01-29 10:44:11.319: V/PhoneInfo(15919): NetworkCountryIso = cn  
01-29 10:44:11.319: V/PhoneInfo(15919): NetworkOperator = 46000  
01-29 10:44:11.319: V/PhoneInfo(15919): NetworkOperatorName = 中国移动  
01-29 10:44:11.319: V/PhoneInfo(15919): NetworkType = 2  
01-29 10:44:11.319: V/PhoneInfo(15919): PhoneType = 1  
01-29 10:44:11.319: V/PhoneInfo(15919): SimCountryIso = cn  
01-29 10:44:11.319: V/PhoneInfo(15919): SimOperator = 46000  
01-29 10:44:11.319: V/PhoneInfo(15919): SimOperatorName =   
01-29 10:44:11.319: V/PhoneInfo(15919): SimSerialNumber = 8986008019031505****  
01-29 10:44:11.319: V/PhoneInfo(15919): SimState = 5  
01-29 10:44:11.319: V/PhoneInfo(15919): SubscriberId = 46000886810****  
01-29 10:44:11.319: V/PhoneInfo(15919): VoiceMailAlphaTag = 语音信箱  
01-29 10:44:11.319: V/PhoneInfo(15919): VoiceMailNumber = null  
01-29 10:44:11.319: V/PhoneInfo(15919): ----------------------------------------------------------------  
01-29 10:44:11.319: V/PhoneInfo(15919): Build.VERSION.Codename = REL  
01-29 10:44:11.319: V/PhoneInfo(15919): Build.VERSION.Incremental = 1318359360  
01-29 10:44:11.319: V/PhoneInfo(15919): Build.VERSION.Release = 2.3.6  
01-29 10:44:11.319: V/PhoneInfo(15919): Build.VERSION.SdkInt = 10  
01-29 10:44:11.319: V/PhoneInfo(15919): Build.Device = umts_jordan  
01-29 10:44:11.319: V/PhoneInfo(15919): Build.Display = 4.5.1-134_DFP-137  
01-29 10:44:11.319: V/PhoneInfo(15919): Build.Fingerprint = MOTO/MB526_RTNORD/umts_jordan:2.3.6/4.5.1-134_DFP-137/1318359360:user/release-keys  
01-29 10:44:11.319: V/PhoneInfo(15919): Build.Hardware = mapphone_umts  
01-29 10:44:11.319: V/PhoneInfo(15919): Build.Host = il93lnxdroid54  
01-29 10:44:11.319: V/PhoneInfo(15919): Build.ID = 4.5.1-134_DFP-137  
01-29 10:44:11.319: V/PhoneInfo(15919): Build.Manufacturer = motorola  
01-29 10:44:11.342: V/PhoneInfo(15919): Build.Model = MB526  
01-29 10:44:11.342: V/PhoneInfo(15919): Build.Product = MB526_RTNORD  
01-29 10:44:11.342: V/PhoneInfo(15919): Build.Type = user  
01-29 10:44:11.342: V/PhoneInfo(15919): Build.User = hudsoncm  
 
 
这是程序代码(MainActivity.java):
 
[java]  
package com.example.phoneinfo;  
  
import java.util.ArrayList;  
import java.util.List;  
  
import android.os.Bundle;  
import android.app.Activity;  
import android.content.Context;  
import android.os.Build;  
import android.telephony.TelephonyManager;  
import android.util.Log;  
import android.view.Menu;  
import android.widget.ArrayAdapter;  
import android.widget.ListView;  
  
public class MainActivity extends Activity {  
  
    @Override  
    protected void onCreate(Bundle savedInstanceState) {  
        super.onCreate(savedInstanceState);  
        setContentView(R.layout.activity_main);  
          
        initInfoList();  
    }  
  
    @Override  
    public boolean onCreateOptionsMenu(Menu menu) {  
        getMenuInflater().inflate(R.menu.activity_main, menu);  
        return true;  
    }  
  
      
    private void initInfoList() {    www.zzzyk.com
        TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);  
          
        List<String> infos = new ArrayList<String>();  
          
        infos.add("DeviceID = " + tm.getDeviceId());  
        infos.add("DeviceSo
补充:移动开发 , Android ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,