telephonymanager

Android: get CellID and RSS for Base Station and Neigboring Cells

蹲街弑〆低调 提交于 2019-12-03 14:19:44
I'm trying to get the following data: Base station: CellID and RSS (recognition which one is the base station) For all neigbouring stations: CellID and RSS There are various APIs and it looks like i'd have to use different APIs telephonyManager and PhoneStateListener. I'm a littlebit confused, as I think this should be available in one interface. Also I think that it should be possible to poll the CellID of the current Base Station instead of having to listen to State Changes to determine int, since the Neighbouring Cell Stations cal also be polled from the telephonyManager. Can you tell me

Android - How to detect outgoing call is answered or received?

你。 提交于 2019-12-03 13:55:26
问题 Is there any way to detect outgoing call is successfully received or answered ? I am using Intent.ACTION_CALL for dialing a call and PhoneCallListener to find the state of a call when outgoing call answered but I couldn't have been achieving this. Is this possible in android ? 回答1: After deeply working on this issue, I reached this conclusion: PhoneStateListener won't work for outgoing calls, it calls OFFHOOK instead of RINGING and OFFHOOK is never called on ANSWER. Using

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

▼魔方 西西 提交于 2019-12-03 12:50:55
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 app didn't crash at all. After this I've tried the same installation on two pre 6.0 devices which did actually crash on it. To me it seems like Android 6.0 does no longer require the permission. Is there any way to confirm this? The line below is the one on which the pre 6.0 devices crashes: tm(TelephonyManager).listen(this, PhoneStateListener.LISTEN

How to know callee is answered the call (What is the phone state when he lift the call)

半世苍凉 提交于 2019-12-03 09:52:38
I am trying to know how to alert when the callee lifts the call. I have used PhoneStateListener along with BroadcastReceiver . Generally it has three states CALL_STATE_IDLE , CALL_STATE_OFFHOOK, CALL_STATE_RINGING . CALL_STATE_OFFHOOK state was calling when call is connecting, No state of the above three states was called after callee answered call. Here is my BroadcastReceiver. public class PhoneStateBroadcastReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService

Disable Proximity Sensor during call

戏子无情 提交于 2019-12-03 06:36:55
问题 I dropped my phone and looks like my proximity sensor no longer works reliably. It returns Near all the time. The problem is, the display turns off during call and I wont be able to use the number pad to enter pin or conference another call, or even disconnect the call. I found the Power button disconnect option in Accessibility settings and uses that now. I tried to create an app that tries to obtain a full wakelock when a call is received hoping that it will keep the display on. Created a

Android - How to detect outgoing call is answered or received?

风流意气都作罢 提交于 2019-12-03 03:48:26
Is there any way to detect outgoing call is successfully received or answered ? I am using Intent.ACTION_CALL for dialing a call and PhoneCallListener to find the state of a call when outgoing call answered but I couldn't have been achieving this. Is this possible in android ? Mohammad Qandeel After deeply working on this issue, I reached this conclusion: PhoneStateListener won't work for outgoing calls, it calls OFFHOOK instead of RINGING and OFFHOOK is never called on ANSWER. Using NotificationListenerService , you can listen to posted notifications related to outgoing calls. You can do

How to provide customized vibration on specific incoming calls

若如初见. 提交于 2019-12-03 01:25:45
The program functions like this: the user has a list of phone numbers, for which the cellphone could vibrate upon an incoming call only when no other system-wide application would provide vibration (such as in mute mode). I know that this is somehow against the rules, for that an application should respect the users' settings, but the application is limited to some certain users with this need. I have tried two ways but neither of them are satisfying: Listen to the telephony state and directly trigger the vibration service with my own pattern (with Vibrator.vibrate() ). This method is

How to verify the phone number similar to Whatsapp? [closed]

柔情痞子 提交于 2019-12-02 22:07:56
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . Can anyone please tell me how to verify the phone number. Once you've installed the app, some random code will be generated and sent as a text message to your phone. Then you enter that code the phone number will be verified. How is this done? 回答1: There are different services for things like this. They require

How to Block a call when first call is ongoing?

痞子三分冷 提交于 2019-12-02 10:47:23
I have created an application for call blocking which is working fine but it's stuck in one scenario: Scenario: When the first call is ongoing(user talking with the first caller) in between second caller call to same user & that new caller is in my Blocklist when my call blocking logic runs both calls ended immediately. In the above case, I want to end call of second caller only. How to achieve this? Is there any way to identify & block the particular call? Here is my call blocking logic: TelephonyManager telephony = (TelephonyManager) context .getSystemService(Context.TELEPHONY_SERVICE);

Retrieving Line1 number from TelephonyManager in Android

怎甘沉沦 提交于 2019-12-02 06:50:32
问题 TelephonyManager manager1 = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE); String strMobile1 = manager1.getLine1Number(); This is my code for getting mobile number of but its not working. I have also take necessary permission in manifest file 回答1: We had the same problem in our project. The conclusion was that it depends on the SIM card. What happened to us: Galaxy S with AT&T SIM card: can read phone number, Settings shows number Same Galaxy with an European SIM card: cannot