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
497
votes
22 answers

Programmatically obtain the phone number of the Android phone

How can I programmatically get the phone number of the device that is running my android app?
jkap
  • 5,172
  • 3
  • 16
  • 9
65
votes
4 answers

How can I check whether the Sim Card is available in an android device?

I need help checking whether a device has a sim card programatically. Please provide sample code.
Senthil Mg
  • 3,301
  • 4
  • 32
  • 49
54
votes
10 answers

Getting telephone US local area code with Android

I would like to know how can i get the device/user area code from within my android app I know there is a lib named TelephonyManager but i couldn't find the country code feature To make myself clear: I have an activity which asks the user to enter…
IB.
  • 1,019
  • 3
  • 13
  • 21
48
votes
8 answers

How to hang up outgoing call in Android?

I am developing an application where one of the things we need is to control the outgoing call, at least to be able to stop it from our application. I've tried using Intent.ACTION_CALL from an existing activity: Intent callIntent = new…
Tilek
  • 636
  • 1
  • 8
  • 14
47
votes
5 answers

How to get current SIM card number in Android?

I want to know user mobile number in Android. I used this code but I'm not getting number. TelephonyManager tm = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE); String n = tm.getLine1Number(); Permission:
User
  • 1,251
  • 1
  • 14
  • 19
46
votes
3 answers

Retrieve incoming call's phone number in Android

I would like to retrieve the incoming call's phonenumber and do something with it like the do in http://blog.whitepages.com/2009/02/27/caller-id-by-whitepages-a-new-android-app-that-puts-telemarketers-on-alert/ Could you please help me because I…
jakob
  • 5,979
  • 7
  • 64
  • 103
37
votes
9 answers

Disable Proximity Sensor during call

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…
33
votes
4 answers

How to know whether I am in a call on Android?

I want to know whether I am in a call. If I am in a call then start the service (service part is clear). How do I do this? While attending the call I need to call the service... I am unaware of how to do this? Any help?
Rockin
  • 723
  • 4
  • 25
  • 51
32
votes
2 answers

Why ITelephony.aidl works?

I saw some SO posts which discussed about how to end a phone call programmtically, for example, this one. Yep, people focus on the result but no one actually explain the reason why it works? I tried the code, it works well. But I would like to know…
Mellon
  • 37,586
  • 78
  • 186
  • 264
28
votes
3 answers

How to monitor SIM state change

I'd like to be able to do some stuff when the SIM state change, i.e. play a sound when SIM PIN is required, but I think there are no Broadcast events that can be intercepted by a broadcast receiver for this... registering for…
24
votes
3 answers

end incoming call programmatically

This is a familiar question in SO. and what I need is to end call programmatically. I have searched a…
RuntimeException
  • 1,201
  • 3
  • 14
  • 25
22
votes
1 answer

How to provide customized vibration on specific incoming calls

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…
peter
  • 1,034
  • 1
  • 9
  • 23
22
votes
6 answers

tm.getDeviceId() is deprecated?

I'm getting the IMEI and device Id's, so here I am getting a problem getDeviceId() is deprecated. TelephonyManager tm = (TelephonyManager) getSystemService(this.TELEPHONY_SERVICE); imei = tm.getDeviceId(); device =…
ravi
  • 474
  • 1
  • 3
  • 11
22
votes
3 answers

Make call using a specified SIM in a Dual SIM Device

I have been searching for this from past few days and I came to know that: "Dual SIM is not supported in Android out of the box. It is a custom modification by manufacturers, and there is no public API to control it." There is a solution provided in…
class Android
  • 762
  • 1
  • 6
  • 17
21
votes
2 answers

Get the current speed of internet (mobile & Wifi) using Android

I have an app that has to work in offline and online mode. Application has to make requests to the app server based on the internet speed of the current network connection (Wifi or Data). If Wifi is connected, I can get the Wifi signal strength of…
user198530
  • 331
  • 1
  • 3
  • 10
1
2 3
52 53