telephonymanager

MNC and MCC of a secondary SIM

一世执手 提交于 2019-12-02 05:20:48
I know that using TelephonyManager we can get MNC and MCC of our network provider, TelephonyManager tel = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); String networkOperator = tel.getNetworkOperator(); if (networkOperator != null) { int mcc = Integer.parseInt(networkOperator.substring(0, 3)); int mnc = Integer.parseInt(networkOperator.substring(3)); } But I was able to get MNC and MCC data of only primary sim. I would like to know is there a way to fetch mnc,mcc,lac and cellid's of Secondary sim of a device in android. W0rmH0le Before API 22, it will be hard to achieve what

Getting reliable MSISDN from Android Phone? VoiceMailNumber Line1Number [duplicate]

纵饮孤独 提交于 2019-12-02 05:13:38
This question already has an answer here: MSISDN : Is it a SIM Card Data? Why all The Provided Function (from Blackberry and Android) to fetch MSISDN not reliable? 3 answers First off the MSISDN is the same as the phone number. I have been looking into seeing if it if possible to get the phone number off of an Andoid phone. The result of my research was yes and no. It is possible using TelephonyManager and getLine1Number() . However this is unreliable. I have tested the above with a Motorola Atrix and this does not retrieve a valid phone number. So dead in the water right? Well I was able to

How to detect a call Drop in android

混江龙づ霸主 提交于 2019-12-01 23:56:07
I'm writing an app that runs on background during a telephone conversation and logs the coordinates to a file after the conversation has end,I know Android telephony API can detect a call manual disconnect by user*(correct me,if I'm wrong)*, But what I want is to know whether the service disconnection have caused due to call drop,is there a way or an API I can use to achieve this, All what I need is to programmatically differentiate a disconnected call and a dropped call. Please help. jobin Try this code, but I am not sure.. private getCallFailedString(Call call) { Phone phone = PhoneApp

getNeighboringCellInfo() returning null list

ぃ、小莉子 提交于 2019-12-01 17:08:12
问题 I'm struggling a little trying to get neighbour cells info (for the current cell info, everything works fine): mTelephMgr=(TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); neighbours=mTelephMgr.getNeighboringCellInfo(); I've tried with 2G/3G networks, with Galaxy S (2.2.1) & Nexus S (2.3.1), and two different carriers but I always get an empty list for neighbours. The networks are GSM based (Spain). I've been googling for a while, and whereas some people are reporting the same

Android call answering programmatically

笑着哭i 提交于 2019-12-01 13:41:49
Is it possible to answer call in android programmatically? I found some where that its not possible but then installed app https://play.google.com/store/apps/details?id=com.a0softus.autoanswer its working fine. I have searched a lot and tried many things, moreover call rejection is working fine but call answering not working. I have tried the following code for call answering as shown below: import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.res.AssetFileDescriptor; import android.media.AudioManager; import android

Voice Call recording in android using MediaRecorder

不打扰是莪最后的温柔 提交于 2019-12-01 11:03:05
I have a problem in recording a call I have made a service and called a BroadcastReceiver to get the call state. In TelephonyManager.EXTRA_STATE_OFFHOOK when the call is received. I am using following code to record the call recorder.setAudioSource(MediaRecorder.AudioSource.MIC); recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT); recorder.setOutputFile(audiofile.getAbsolutePath()); try { recorder.prepare(); recorder.start(); } catch (IllegalStateException e) { e.printStackTrace(); } catch (IOException e) { e

How to send fake call broadcast on android

和自甴很熟 提交于 2019-12-01 01:04:36
I am trying to send a broadcast to simulate an incoming call. I added the permission in AndroidManifest.xml file, <uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission> When I try to run the program, the phone reboots.(Emulator too). Intent intent = new Intent(); intent.setAction("android.intent.action.PHONE_STATE"); intent.putExtra(TelephonyManager.EXTRA_STATE, TelephonyManager.CALL_STATE_RINGING); intent.putExtra("EXTRA_INCOMING_NUMBER", "923982398"); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); sendBroadcast(intent); I may be wrong as I can't find anything

Interrupt incoming call in android

天大地大妈咪最大 提交于 2019-11-30 23:14:18
How to open a custom UI on incoming call with answer and reject button on it,I want to show custom UI instead of default dialer. I am using below code but dialer is open and my activity is not opened: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.callintruptdemo" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="17" /> <uses-permission android:name="android.permission.READ_PHONE_STATE"/> <application android:allowBackup="true" android:icon="

Detect target phone number on incoming call

别来无恙 提交于 2019-11-30 22:47:17
I have an Android phone with 2 SIM card and I want to detect the target of the incoming call — is it for SIM 1 or for SIM 2. Is it possible to get the target number from call info? Finally i got the solution its working fine for me. Hope it should helpful for everyone who wants to handle Duel SIM in mobile applications. public class IncomingCallInterceptor extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { String callingSIM = ""; Bundle bundle = intent.getExtras(); callingSIM =String.valueOf(bundle.getInt("simId", -1)); if(callingSIM == "0"){ //

TelephonyManager returns null for IMEI number: what can cause this?

我是研究僧i 提交于 2019-11-30 20:03:13
I'm working on an Android app and am getting null back for the IMEI number when using TelophonyManager . This is happening on several Huawei phones. (All of them are Ascend Y530s). The phones all have sim cards and otherwise seem to be operating normally. I was under the impression that only a broken phone would return null IMEI. Clearly this is not the case.. Questions. What exactly is this IMEI number - i.e where is it stored on the device? And what does it mean when a seemingly fine phone returns its value as null ? EDIT I should mention that the IMEI number is not always null . About half