Questions tagged [telephonymanager]

Telephony class for Android devices

A class that provides access to information about the telephony services on an Android device

781 questions
9
votes
2 answers

Since Android 6.0 listening to the PhoneStateListener.LISTEN_DATA_CONNECTION_STATE changes seems to no longer require READ_PHONE_STATE permission

I'm applying Android 6.0 runtime permissions into an app which listens to carrier data connection state changes. I first tried to just remove the READ_PHONE_STATE from the manifest to check where the app requires the permission. To my surprise the…
9
votes
3 answers

Reject a call programmatically without a ring

I am creating an app to reject calls from specific numbers without even getting a single ring to the calling person. I have a code that rejects the call after a partial ring. Please don't say this question is repeated. I have been searching code to…
user1537462
  • 197
  • 3
  • 9
8
votes
4 answers

how to resolve this error "com.android.internal.telephony cannot be resolved to a type" in android

i am creating simple call filter application which restrict unwanted calls. i use following code to restrict call but i am unable to resole problem of this line in below code " com.android.internal.telephony.ITelephony telephonyService =…
Prashant Kadam
  • 1,207
  • 4
  • 18
  • 30
8
votes
5 answers

get both simcard operator name in dual SIM mobile

I want to know Both sim card's operator name when mobile is dual sim.In single SIM I got operator name programmatically But For duel SIM I can't although after so many search and try. If I run My app in dual sim phone than I can get both sim card…
Krishna Kachhela
  • 773
  • 1
  • 7
  • 24
8
votes
3 answers

getAllCellInfo returns null in android 4.2.1

My Android version is 4.2.1 and I am trying to make use of TelephonyManager.getAllCellInfo() method. In my manifest file I have the ACCESS_COARSE_UPDATES, ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION permissions. However that method returns null.
mkd156
  • 435
  • 3
  • 5
  • 16
7
votes
1 answer

TelephonyManager Crashs on Android 10

I am getting the below stack trace in my Crashlytics for wide range of android 10 devices. Fatal Exception: java.lang.NullPointerException Attempt to invoke virtual method 'java.lang.Throwable android.os.ParcelableException.getCause()' on a null…
Sahar
  • 301
  • 1
  • 6
7
votes
2 answers

Detecting incoming and outgoing calls in android API29+

There are many questions about detecting incoming and outgoing calls in android, but all of them are old and also android deprecates the useful functions, and google play rejects my application because I'm using them. For detecting outgoing calls I…
7
votes
5 answers

How to get the mobile number of my device programmatically?

I have tried using 2 methods for retrieving my phone number but both of them don't work. I used: TelephonyManager SubscriptionManager I do get Network name, Country iso, and IMEI but whenever I try to return Number it returns nothing. I have also…
7
votes
0 answers

How to retrieve disconnect cause of android call?

I have registered a broadcast receiver for PHONE_STATE so whenever a call is disconnected I can execute code. I am trying to find the cause of the disconnection which I believe it can be found by calling Call.Details.getDisconnectCause. The problem…
Hamed
  • 297
  • 3
  • 21
7
votes
2 answers

Android Handle phone call

I have audio recording, when a phone call come I need to stop the recording, how can I do this?
Bytecode
  • 6,551
  • 16
  • 54
  • 101
7
votes
4 answers

Android dual SIM signal strength

I have been trying to get access to some features on my android dual sim phone (the brand is LKD). I have managed to get the functions for TelephonyManager and ITelephony through java reflection, and got them to run. However i want to get the signal…
7
votes
1 answer

How to get android signal strength

I just started developing for android and I am trying to figure out how to get a users signal strength. The following code gives me the Dbm for a GSM network: TelephonyManager telephonyManager =…
RockPaperScissors
  • 171
  • 1
  • 2
  • 11
7
votes
2 answers

How can I send a pre-recorded(wav) file during a voice call?

I want to develop an application through which if the caller calls you, the call should be answered automatically without user's involvement and the caller could hear a pre-recorded voice which is already recorded and saved.The audio file should be…
6
votes
0 answers

Android: subscriptionManager.getActiveSubscriptionInfoList() gives null, although SIM is present

Using SubscriptionManager for fetching sim details, but for few users subscriptionManager.getActiveSubscriptionInfoList() is returning null(READ_PHONE_STATE permission is granted), even if sim is present in the device. val subscriptionManager:…
6
votes
0 answers

Android TelephonyManager requestCellInfoUpdate returning stale data on API 29

I've been encountering a problem for some time using Android's TelephonyManager. We use the TelephonyManager for phone signal live surveying purposes but in an attempt to move up to targeting API 29 it has become a problem. On API 28 and under, we…
1 2
3
52 53