phone-state-listener

How to start PhoneStateListener programmatically?

不羁岁月 提交于 2019-12-25 04:20:23
问题 There's an activity in my application. It contains a button. By clicking the button it should be start PhoneStateListener (and BroadcastReceiver?) to catch incoming and outgoing calls. It seems it should be a service. Does anyone can explain how to start PhoneStateListener (and BroadcastReceiver?) programmatically? 回答1: you have to used this code and it is 100% work. (1) you have to start services startService(new Intent(this, CallServices.class)); (2) you have to make CallServices class and

How to start PhoneStateListener programmatically?

余生颓废 提交于 2019-12-25 04:20:05
问题 There's an activity in my application. It contains a button. By clicking the button it should be start PhoneStateListener (and BroadcastReceiver?) to catch incoming and outgoing calls. It seems it should be a service. Does anyone can explain how to start PhoneStateListener (and BroadcastReceiver?) programmatically? 回答1: you have to used this code and it is 100% work. (1) you have to start services startService(new Intent(this, CallServices.class)); (2) you have to make CallServices class and

Android, TelephonyManager, the joys of PhoneStateListener and incoming numbers

空扰寡人 提交于 2019-12-22 02:03:30
问题 I've very newly gotten into Android development, and decided that my first conquest on this fresh field would be to grasp how the phone reacted to incoming calls. A little googling later led me to http://www.compiletimeerror.com/2013/08/android-call-state-listener-example.html#.Vi3Ren4vfwM (so my code shares a striking resemblance to his/hers). My main (and only) activity looks like this: import android.app.Activity; import android.content.Context; import android.os.Bundle; import android

Android, TelephonyManager, the joys of PhoneStateListener and incoming numbers

笑着哭i 提交于 2019-12-22 02:02:09
问题 I've very newly gotten into Android development, and decided that my first conquest on this fresh field would be to grasp how the phone reacted to incoming calls. A little googling later led me to http://www.compiletimeerror.com/2013/08/android-call-state-listener-example.html#.Vi3Ren4vfwM (so my code shares a striking resemblance to his/hers). My main (and only) activity looks like this: import android.app.Activity; import android.content.Context; import android.os.Bundle; import android

Get RSRP from CellSignalStrengthLte for Android app API 17+

我与影子孤独终老i 提交于 2019-12-19 04:12:46
问题 A few people over the past decade have asked similar questions but none have ANY answers. I need to write an android app that collects and stores RSRP, RSRQ, CINR, and Cell ID. The answers need to be as accurate as the phones hardware allows (I am testing on Samsung Galaxy S5) because I need to do post processing statistics with those values. Does anyone know how to use telephonyManager or CellSignalStrengthLte to get RSRP? Or is there another, perhaps better way to get RSRP? So far the best

Problem on PhoneStateListener to listen to OnCellInfoChanged in delphi firemonkey

爱⌒轻易说出口 提交于 2019-12-13 04:01:22
问题 It will be appreciated if help me. i am writing a program with delphi firemonkey that show mobile cell informations. i need to listen on cell info changes with JPhoneStateListener class. At First i write a class for implement main class as below : type TPL = class(TJavaGenericImport<JPhoneStateListenerClass, JPhoneStateListener>) public constructor create; Destructor Destroy; Override; procedure onCallForwardingIndicatorChanged(cfi: Boolean); cdecl; procedure onCallStateChanged(state: Integer

PhoneStateListener() isn´t finished

依然范特西╮ 提交于 2019-12-11 06:54:35
问题 I implemented a PhoneStateListener how stops audio if you are called and starts it again after you finished. When i exit my app by finish() the PhoneStateListener seems to be still active. After finishing a call the music starts to play. Even if I set the listener=null in onDestroy() it keeps working... 回答1: Quoting the documentation for listen() on TelephonyManager: To unregister a listener, pass the listener object and set the events argument to LISTEN_NONE (0). You must do this before your

Incoming number is null after ending the call in android PIE 9

岁酱吖の 提交于 2019-12-11 06:10:52
问题 I have been working on this problem since weeks. I am making an app which picks the incoming number and shows it in a dialog box after the call is ended. Everything is working fine below android PIE 9.0. The number is always null in android PIE. I have given all permissions including READ_CALL_LOGS but same problem. The incoming number is null. So please anyone help me... Here is my manifest file : <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com

PhoneStateListener doesn't call

一笑奈何 提交于 2019-12-11 04:06:33
问题 Here is My Whole Code....... BroadcastExample.java package com.example.broadcast; > import android.app.Activity; import > android.content.Context; import > android.os.Bundle; import > android.telephony.*; import > android.util.Log; import > android.widget.TextView; public class BroadcastExaple extends Activity { TextView textOut; TelephonyManager telephonyManager; PhoneStateListener listener; /** Called when the activity is first created. */ @Override public void onCreate(Bundle

Get phone number of incoming call in all android versions

我只是一个虾纸丫 提交于 2019-12-11 02:41:54
问题 I am trying to fetch incoming number of incoming call. I searched and found this Retrieve incoming call's phone number in Android. My issue is that I am not able to "incoming number" in version above 4.0.3. Please guide me if I am doing anything wrong ,or how to get the incoming number in version above 4.0.3. Thanks in advance. Here is code : TelephonyManager telephony = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE); telephony.listen(new PhoneStateListener(){ public