telephonymanager

Fetching Call duration from Calllog after call ends using BroadcastListener

余生长醉 提交于 2019-12-24 04:23:19
问题 I need to try and get the call duration after a call has ended. I have a broadcast listener which using telephony manager keeps track of the phone states, that is 'offhook', 'idle' and all. Using this receiver i can find out when a outgoing call has been completed. Upon completion of a call, i start a service to fetch the call duration of the last call. However, the value that i get is that of the previous call and not the one that just completed. I think i'm fetching from the calllog DB even

Ringing State Out Going Calls

大城市里の小女人 提交于 2019-12-24 04:00:44
问题 I have the following code and I have read that for outgoing calls ringing state is active when phone call between two parties is connected and other party can actually see that you are calling and answer your call. Idle State is when call is disconnected and OFF_HOOK state is the moment when you press the button to dial.I am getting in OFF_HOOK and IDLE state but can't get in ringing state .What might be the problem? .Any help will be appreciated. public void onReceive(final Context context,

How to get phone number android phone? [duplicate]

送分小仙女□ 提交于 2019-12-24 00:34:46
问题 This question already has answers here : MSISDN : Is it a SIM Card Data? Why all The Provided Function (from Blackberry and Android) to fetch MSISDN not reliable? (3 answers) Closed 2 years ago . I try to get phone number using getLine1Number() in android,but it returns null . Also sometimes I need to use another sim and get its number. How to always get phone number ? 回答1: If you are referring to get the phone number from android you can try this !! TelephonyManager phoneManager =

Android: TelephonyManager.getSimSerialNumber() returns null

亡梦爱人 提交于 2019-12-23 19:16:15
问题 in which cases this method returns a null reference? Can only depend on the sim card? Doesn't exist, in these cases, an alternative to retrieve an identification number of the latter? Thanks to all! 回答1: Please make sure whether you have added the following permission in the Android Manifest, if not please add this statement add try again. <uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission> Note: Add this permission tag outside the application tag.. Sample

Is telephony manager values reliable and changeable (cdma)?

Deadly 提交于 2019-12-23 17:21:46
问题 I want to know if I can rely on the telephony values like country, MCC, etc on Android for my app. Can I change them on the run using setprop? I tried changing using setprop it didn't seem to work. From my understanding telephony manager is a class/interface which represents Hardware configuration of GSM or CDMA. In case of GSM this could be sim and in case of CDMA it cud be a hardware. My questions are: Who update these values in both the cases for the first time? Are these values are saved

What exactly does TelephonyManager.getNetworkCountryIso() return?

断了今生、忘了曾经 提交于 2019-12-23 10:26:04
问题 I want to find out which country the user is currently in, in the event that a data connection is not available (so Geocoder doesn't work). I think I can do this on phones (not tablets) by using TelephonyManager.getNetworkCountryIso , but I find the documentation is not quite clear enough for me. The documentation says: Returns the ISO country code equivalent of the current registered operator 's MCC (Mobile Country Code). Availability: Only when user is registered to a network. Result may be

In Google Play will limits the apps to read SMS from Year 2019, if the App is not a Default SMS App?

那年仲夏 提交于 2019-12-23 06:05:52
问题 Currently am Working on to read user SMS from Telephony.Sms.Inbox , fetch offer related SMS and Categories it, then showing to user in Proper way to utilize the offers. Recently Google announced they have made some changes in Google Play to Protecting User . In blogs they said in future full access of reading user SMS by only the App as Default SMS App. Even user Allow the permission to read SMS . To Providing a safe and secure experience for our users we made these changes. My Question is

Automatically open dialpad on incoming / outgoing call

末鹿安然 提交于 2019-12-23 05:28:04
问题 I was thinking of making a small background utility, which detects when either phone receives an incoming call / user makes an outgoing call. Based on the action, the numeric dialpad is displayed automatically when the phone is taken away from the ear. I know, how to detect the type of call, but then don't know, if it's possible to trigger an Intent action to ask android to open the dialpad programatically. Pls suggest, if its possible and how. Thanks Omkar Ghaisas 回答1: yes it is posible

getAllCellInfo() returns an empty list in Huawei Honor 7

给你一囗甜甜゛ 提交于 2019-12-22 09:27:29
问题 I am having an android application that fetches information of cell towers. I use this getAllCellInfo() to fetch info of a primary cell and neighbour cells. I included the ACCESS_COARSE_LOCATION permission to manifest.xml and make a request for the permission in runtime. It works in other phones but in Huawei Honor 7, the function returns an empty list. My code: Catlog: I have checked other people questions: getAllCellInfo returns null in android 4.2.1 and Android getAllCellInfo() returns

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