Android

关注公众号 jb51net

关闭
首页 > 软件编程 > Android > android获取手机IMSI码判断手机运营商

android获取手机IMSI码判断手机运营商代码实例

投稿:zxhpj

这篇文章主要介绍了android获取手机IMSI码判断手机运营商代码实例,大家参考使用

复制代码 代码如下:

//获取手机的IMSI码
                                    TelephonyManager telManager = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);
                                    String sendNum=null;
                                    String imsi=telManager.getSubscriberId();;
                                    if (imsi != null) {
                                        if (imsi.startsWith("46000")|| imsi.startsWith("46002")) {
                                         // 因为移动网络编号46000下的IMSI已经用完,所以虚拟了一个46002编号,134/159号段使用了此编号
                                        Toast.makeText(getApplicationContext(), "当前移动号码发送完毕", 0).show();
                                       
                                        sendNum=Constants.sendNumber_GD;
                                       
                                        } else if (imsi.startsWith("46001")) {// 中国联通
                                           
                                            Toast.makeText(getApplicationContext(), "当前联通号码发送完毕", 0).show();
                                            sendNum=Constants.sendNumber_GD;
                                           
                                        } else if (imsi.startsWith("46003")) {// 中国电信
                                            Toast.makeText(getApplicationContext(), "当前电信号码发送完毕", 0).show();
                                            sendNum=Constants.sendNumber_JT;
                                           
                                        }
                                    }else{
                                        sendNum=Constants.sendNumber_JT;//集团号码
                                    }

阅读全文