从android手机越来越IMSI?

编程入门 行业动态 更新时间:2024-10-24 03:21:28
本文介绍了从android手机越来越IMSI?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我开发一个应用程序,需要得到IMSI。我使用的:

I am developing an app that requires to get the IMSI. I use:

TelephonyManager mTelephonyMgr = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); String imsi = mTelephonyMgr.getSubscriberId();

这适用于大多数的手机,但也有少数手机只返回6位而不是15这是错误的。

It works for most phones, but a few handsets only return 6 digits instead of 15. Which is wrong.

任何人都知道以编程方式检索IMSI的另一种方式?其他的API?方法?

Anyone knows an alternative way to retrieve the IMSI programatically? Other APIS? methods?

问候

推荐答案

根据这篇文章:www.anddev/tinytut_-_getting_the_imsi_-_imei_sim-device_unique_ids-t446.html

您可以使用

String imei = android.os.SystemProperties.get(android.telephony.TelephonyProperties.PROPERTY_IMSI);

但SystemProperties是不能直接访问的,所以你需要使用的招数,在回答这个问题一:的哪里是android.os.SystemProperties

该人士$ ​​C $下类SystemProperties 这里:hi-android.info/src/android/os/SystemProperties.java.html

The source code for class SystemProperties is here: hi-android.info/src/android/os/SystemProperties.java.html

更多推荐

从android手机越来越IMSI?

本文发布于:2023-10-31 06:28:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1545293.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:手机   android   IMSI

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!