mobile - How to retrieve IMSI using PhoneGap? -
i'm working on cross platform mobile app using phonegap , need retrieve imsi code.
here's question: there way via phonegap?
i appreciate comments.
hi android can find via native code , phonegap need write plugin, java code given bellow
public string finddeviceid() { string deviceid = null; string servicename = context.telephony_service; telephonymanager m_telephonymanager = (telephonymanager) getsystemservice(servicename); int devicetype = m_telephonymanager.getphonetype(); switch (devicetype) { case (telephonymanager.phone_type_gsm): break; case (telephonymanager.phone_type_cdma): break; case (telephonymanager.phone_type_none): break; default: break; } deviceid = m_telephonymanager.getdeviceid(); return deviceid; }
for creating phonegap plugin check http://docs.phonegap.com/en/edge/guide_platforms_android_plugin.md.html#android%20plugins
Comments
Post a Comment