phone-state-listener

SignalStrength - getSignalStrength() - getLevel()

馋奶兔 提交于 2021-02-07 20:29:35
问题 I can easily get the sigalStrength in Android via callback onSignalStrengthsChanged(SignalStrength signalStrength) and retrieve the signalStrength trough the passed object int signal_strength = signalStrength.getGsmSignalStrength(); and according to the documentation the value varies between 0 and 39.99 Now I want to display this in my app in an indicator that updates as the signalStrenght varies - exactly what you can see in the statusbar on your phone. So my question - how can I use the

How can I make this phone call states Broadcast receiver to work all the times?(non-stops)

﹥>﹥吖頭↗ 提交于 2020-08-20 06:38:19
问题 I'm creating an application, which will show toast messages before and after the call states. I generated and installed my application on my mobile. it was working well after a few days or sometimes a few hours. but after that, it's stopped, in order to run the application I need to open the application again. how can I modify my application to work very well? Thank you manifest <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android

Can't do heavy work on broadcast receiver which is inside the Service

岁酱吖の 提交于 2020-08-15 06:00:05
问题 I created a Broadcast Receiver Which is inside the Service Class (Because of the Android Broadcast receiver restrictions Broadcast receiver stops after while, So I created Background Service , with foreground Service Notification Restriction in Android Oreo=< ). This Broadcast Receiver Listens to Phone Call States Changes IDLE, OFFHOOK, RINGING . According to the Phone call states changes(If the call ends), I get the last call details in the Cursor and Send to that details into the Firebase

Can't do heavy work on broadcast receiver which is inside the Service

不想你离开。 提交于 2020-08-15 05:59:51
问题 I created a Broadcast Receiver Which is inside the Service Class (Because of the Android Broadcast receiver restrictions Broadcast receiver stops after while, So I created Background Service , with foreground Service Notification Restriction in Android Oreo=< ). This Broadcast Receiver Listens to Phone Call States Changes IDLE, OFFHOOK, RINGING . According to the Phone call states changes(If the call ends), I get the last call details in the Cursor and Send to that details into the Firebase

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

亡梦爱人 提交于 2020-02-26 14:41:29
问题 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

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

点点圈 提交于 2020-02-26 14:37:42
问题 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

Start Service from BroadcastReceiver phoneListener

主宰稳场 提交于 2020-01-25 20:37:12
问题 I want to stop the the running service when the phone is ringing and I want to restart the service when the call is answered or just after ringing. I always get an java.lang.NullPointerException if the phone call ends. In the CALL_STATE_RINGING the alarmManager cancels and the service stops without any error. Starting the Service again, does not work. I get all the time following NullPointerException. 03-18 19:08:30.280 15795-15795/de.app.test E/AndroidRuntime﹕ FATAL EXCEPTION: main Process:

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

南楼画角 提交于 2020-01-12 07:55:24
问题 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

ACTION_PHONE_STATE_CHANGED not called on network cell changes

*爱你&永不变心* 提交于 2020-01-05 03:23:20
问题 I am trying to make my broadcast receiver fire when the phone goes in and out of reception areas. The issue is the receiver never gets called when the cell reception changes. The BroadcastReceiver works fine for getting phone call states (call idle, started ect...), and also for getting the airplane mode switched on and off because the broadcast receiver handles both. I added the permissions and intent filter to the receiver in the manifest and they are working fine. Here is what I have for