Kindly note, this approach uses Java Reflection to call methods of an internal class of Android Telephony Framework and might not work with all versions of Android OS. The core concept has been explained in this Android open code.
1st thing 1st, Give the permission.
You need to define 3 User Permissions to handle call related functionality-
- android.permission.READ_PHONE_STATE
- android.permission.MODIFY_PHONE_STATE (For answerRingingCall() method)
- android.permission.CALL_PHONE (For endCall() method)
Define a Receiver...
Create a Receiver which accepts broadcasts with intent action android.intent.action.PHONE_STATE, define following in the Manifest-
[receiver android:name=".PhoneCall"]
[intent-filter]
[action android:name="android.intent.action.PHONE_STATE"/]
[/intent-filter]
[/receiver]
Handle Broadcast inside your Receiver...
Override onReceive() method and using Java Reflection try to get the Instance of one of hidden class of Android Telephony Framework- com.android.internal.telephony.ITelephony
ITelephony defines a set of useful methods to control the Call state, which are hidden from general Android API.
private void getTeleService() {
TelephonyManager tm = (TelephonyManager) context
.getSystemService(Context.TELEPHONY_SERVICE);
try {
// Java reflection to gain access to TelephonyManager's
// ITelephony getter
Log.v(TAG, "Get getTeleService...");
Class c = Class.forName(tm.getClass().getName());
Method m = c.getDeclaredMethod("getITelephony");
m.setAccessible(true);
com.android.internal.telephony.ITelephony telephonyService = (ITelephony) m.invoke(tm);
} catch (Exception e) {
e.printStackTrace();
Log.e(TAG,
"FATAL ERROR: could not connect to telephony subsystem");
Log.e(TAG, "Exception object: " + e);
}
}
Now, you can use telephonyService (which is an instance of com.android.internal.telephony.ITelephony) to "Accept"/ "Reject" call and many other operations.
// Accept Call
telephonyService.answerRingingCall();
// Reject Call
telephonyService.endCall();
Flow to create a Call blocking Application
1. Create option to add and store Phone Numbers to be Blocked
2. Read incoming phone number
String incommingNumber;
@Override
public void onReceive(Context context, Intent intent) {
Bundle b = intent.getExtras();
incommingNumber = b.getString(TelephonyManager.EXTRA_INCOMING_NUMBER);
// Additional Step
// Check whether this number matches with your defined Block List
// If yes, Reject the Call
}
3. Reject this Call- telephonyService.endCall();Hope this helps! I have developed one widget App (PhoneAway) following above mentioned concept, feel free to download source and explore.
Mute Call:
To mute an ongoing call, you can use com.android.internal.telephony.ITelephony.setMute(boolean ). You need to make sure the Call State is CALL_STATE_OFFHOOK. I couldn't test below code properly. Please let me know if the Mute functionality works.
if(tm.getCallState() == TelephonyManager.CALL_STATE_OFFHOOK){
// mute the call
telephonyService.setMute(true);
}
Hi there,
ReplyDeleteHow to mute an incoming call by clicking a mute button which i placed on screen when i get an incoming call?
How to do it programatically?
Please, if you can, write on your blog.
Thanks,
Mark
Mark,
ReplyDeletei'll definitely give a try and let you know.
-Prasanta
Hi there,
ReplyDeleteHow to do outgoing call barring in android programatically?
Please, if you can, write on your blog.
Thanks,
David
Hi,
ReplyDeleteWith which version of OS have you tested the solution ?
Anyone can please post any results ?
Thanks,
Karlos
Hi Karlos,
ReplyDeletethis sample is tested with Android 2.1. Are you facing problem ?
Thanks,
Prasanta
Good stuff, I've been looking for info on how to do this through reflection. Have you played around with placing a call on hold?
ReplyDeletePrasanta,
ReplyDeleteam in error on that line.
com.android.internal.telephony.ITelephony telephonyService = (ITelephony) m.invoke(tm);
The Andriod not find the class ITelephony
This class does not exist in the SDK 2.1!
Jaison,
ReplyDeleteyou need to have an internal framework JAR file to run this-
framework_intermediates-classes-full-debug.jar
This JAR you will get when you do complete build of Android OS.
prasanta..,
ReplyDeleteCan u tell me how to get jar u have specified to
access , can u please help me ?
com.android.internal.telephony.ITelephony telephonyService = (ITelephony) m.invoke(tm);
You can get the JAR from here-FW_JAR
ReplyDeleteYou need to use this as Eclipse User Library.
hi Prasanta ,
ReplyDeleteI copied ITelephony.aidl from google open source , and i h got how to reject and accept calls . Thank u much for ur input .
I need one more help i.e; can u please tell me how to send mms directly from code , i mean with no further user input.
Thank u
Can you please tell me how you done to reject call?
Deletecan you share code at umer.tech5@gmail.com
i cannot understand,i am beginer,could you give me this example thank you
ReplyDeleteHi,
ReplyDeleteI having the same issue.
Where did you put the file "ITelephony.aidl" ?
how do i use the .jar file in eclipse ?
When i go to Project/Properties/Libraries - I can see under android.jar/access rules:
Forbidden: com/android/internal/**
any idea ?
Thanks,
Hi,
ReplyDeleteif you are using the attached JAR, you need to include that as User Library in Eclipse-
Your Project Folder->Build Path->Add Libraraies...->User Library
Hope it helps.
-Prasanta
Hi Pransanta,
ReplyDeleteThanks for your reply.
Adding the jar caused to memory heap error.
How can i add just the ITelephony.aidl
To use ITelePhony.aidl
ReplyDelete- copy and past ITelePhony.aidl under com.android.internal.telephony package of your Eclipse Project
- It should generate automatically ITelephony.java under gen folder.
hope it helps.
hi prasanta,
ReplyDeleteConversion to Dalvik format failed: Unable to execute dex: null
i got this problem after attach that JAR file. i clear my work space and rebuild it then also i got the same problem. can you please help me.
Modify the -XmsAm and -XmxBm paremeters in eclipse.ini so that they are large enough. The default is -Xms40m -Xmx384m. Try changing them both to -Xms512m -Xmx512m and restart eclipse to see if that helps. If not, continue to increase the values and restart eclipse until either one of two things happens:
DeleteYour build completes.
Eclipse won't restart because you don't have enough memory.
Refer link: http://stackoverflow.com/questions/5943712/conversion-to-dalvik-format-failed-unable-to-execute-dex-java-heap-space
You need to include the JAR as "User Library". In Eclipse-
ReplyDeleteYour Project Folder->Build Path->Add Libraraies...->User Library
Prasanta thanks for replying.
ReplyDeleteI did everything you said and bugs out, but when run the app, get the following exception:
10-16 23:26:08.375: VERBOSE/TEST CALL(1700): Get getTeleService...
10-16 23:26:08.405: WARN/System.err(1700): java.lang.NoSuchMethodException: getlTelephoney
Awesome post !! very informatory and helpful . Everything worked except telephonyService.setMute(true); .
ReplyDeletethanks a lot for this
Hai prasanta , i used ur code , to detect phone call, in ddms am getting , prasanta-phone call as tag
ReplyDelete10-19 10:32:23.303: VERBOSE/Prasanta-PhoneCall(253): Incoming Call BroadCast received...
10-19 10:32:23.303: VERBOSE/Prasanta-PhoneCall(253): Intent: [android.intent.action.PHONE_STATE]
10-19 10:32:23.303: VERBOSE/Prasanta-PhoneCall(253): Bundle: Bundle[mParcelledData.dataSize=48]
10-19 10:32:23.303: VERBOSE/Prasanta-PhoneCall(253): Phone Number: null
10-19 10:32:23.303: VERBOSE/Prasanta-PhoneCall(253): Phone State: OFFHOOK
10-19 10:32:23.303: VERBOSE/Prasanta-PhoneCall(253): Get getTeleService...
10-19 10:32:23.303: VERBOSE/Prasanta-PhoneCall(253): answerCall...
10-19 10:32:23.303: VERBOSE/Prasanta-PhoneCall(253): silenceRinger... Over
I want to change that ? i mean ddms message ? how can i change that in my code ?
Thank u,
Sai srinivas
@ Jaison:
ReplyDeletepls try with the ITelePhony.aidl
@ Srinivas:
you need to write your own Application following the steps that i have explained.
But am not using single line of code of yours. still am getting debugging messages with name as tag. how to avoid it ?
ReplyDeleteBoss.... Really very good stuff... its very helpul with my telephony app.... Keep it up...
ReplyDeleteHi, great job...The telephonyService.answerRingingCall() works for me but not the telephonyService.endCall(). Is there any other permissions that need to be set or anything else that needs to be done? Thanks!
ReplyDeleteHi Charlie,
ReplyDeletethanks. I forgot to mention, for endCall() you need to add a User Permission-
android.permission.CALL_PHONE
hope it helps.
hiiiiiii prasanta can u help me in a project of android app Tablet Application.....
ReplyDeletei have some problems in it
can u help me in this concern
whats ur id
where i can mail u application apk file
Regards
Tushar SAHNI
Thanks Prasanta, the android.permission.CALL_PHONE worked for thetelephonyService.endCall().
ReplyDeleteThanks again!!!
Could you please share the source code with me.
DeleteThanks.
Many thanks for amazing post.
ReplyDeleteKeep up the good work...
hi Prasanta,
ReplyDeleteI am android beginner. I need exact usage of this ITelephony.aidl or ITelephony.jar. i totally confused.
Awaiting for ur reply at earliest.
Great post Prasanta !
ReplyDeleteIt's working very well in my application.
I've tested with the new Android 2.3 emulator and I get an security exception about android.permission.MODIFY_PHONE_STATE.
Android is saying that this permission is missing for the current user or process.
I've checked it my manifest and it's in there.
Is it working for you with Android 2.3 ?
Hi,
ReplyDeleteI haven't yet tested this with Android 2.3
Tested versions 2.1, 2.2
BR,
Prasanta
Great post Prasanta, quick question, this all runs fine in the emulators, however when I test them on the phone it only works after I restart the phone. Are you aware of this being a requirement? Thanks for the post again.
ReplyDeleteHi.. I have added the android.permission.CALL_PHONE. but its not working... Please help me...
ReplyDeletepls be more specific and let me know the actual problem you are facing.
ReplyDeleteits not giving any error for "com.android.internal.telephony.ITelephony telephonyService = (ITelephony) m.invoke(tm);"
ReplyDeletebut not implementing this line...
pls check my implementation-
ReplyDeletehttp://prasanta-paul.blogspot.com/2010/12/phone-away-widget.html
and make sure you are following everything correctly.
hope it helps.
Thanks prasanta....
ReplyDeleteHi..ur post is great but am having an issue.
ReplyDeleteAs u said I saved my block numbers in an array and compared with number and used endcall method. But It doing nothing...
Please help..
Hi,
ReplyDeleteyou can look into the code base of
http://prasanta-paul.blogspot.com/2010/12/phone-away-widget.html
This might help you.
Cheers,
Prasanta
I tested on Android 2.1, 2.2, 2.3. Worked perfectly on the first two, but the last one. Any one had successfully tested on Android 2.3?
ReplyDeleteendCall seems will kill not only the incoming call but exists call (if any) too, any good way to reject only the ringing call ?
ReplyDeleteHi Prasanta,
ReplyDeleteI'm an android beginner. This stuff meade me learnt alot. can you please suggest me how to intercept an incoming and outgoing call.
hi,
ReplyDeleteIm trying to develop an app which automatically receives an incoming call,plays a pre-recorded message pretending the caller to pass his message and the app should alert the user and should be able to play the phone conversation.............
can i do this???
how to go about?
send me the entire sample code for receiving an incoming call???
ReplyDeleteonly the .java file
Thanks in advance
how can I use com.android.internal.telephony.ITelephony
ReplyDeleteIts not available in the SDK.
Hi,
ReplyDeleteAmazing post. I tried the app and its working but before blocking for a fraction of second call screen used to come. I don't want that also. Is there any way to acheive this.
Thanks in advance :)
Hi,
ReplyDeleteyou can get ITelephony from-
http://groups.google.com/group/blogresources/web/ITelephony.aidl
Or you can try my PhoneAway widget source code-
http://prasanta-paul.blogspot.com/2010/12/phone-away-widget.html
Thanks,
prasanta
Hey Prasanta,
Deletedid u find a way to handle conference call??
just as you handled the ITelephony interface class via AIDL I've just tried the same with the com.android.internal.telephony.Phone interface because this one includes the void conference() (for gsm mode). I need to get access to it but unlike the ITelephony class (TelephonyManager has getITelephony() ) i can't find a getPhone() anywhere... maybe another way to implement??? that would save my future as android developer :))) so I'd be very grateful to you if you'd give me a hint.
Also if you knew any way to start a conference while having an active call and a call on hold without user interaction on the phone (maybe with bluetooth headset or some other device) - this would also be helpful in some way.
with kind regards
bossoss
I do not get your files
Deleteguide me how to take away your
Hi BossOss,
DeleteI have also tried to make use of com.android.internal.telephony.Phone interface to make conference call but it is not working.
If you could share if you get any solution or any other way to achieve this , i would be great full...
Thanks,
chandu
Hi Sumit,
ReplyDeletethanks. When call comes, broadcast is sent and as we are handling it, at the same time PhoneApp (Android Call App) also does the same. So, if you want to block the complete broadcast, probably this need to be "Ordered Broadcast".
I'm not sure whether the Call Broadcast is ordered or not.
Thanks,
Prasanta
First thank you very much for this blog, I am a novice programmer android and helping me a lot. Second sorry for my English is pretty bad ...
ReplyDeleteMy question is whether this example of call control, it would be possible to remove missed call notification Automatic android.
Thank you very much
Great post, Thanks!
ReplyDeleteI'm looking for the following solution:
Keep the incoming call ringing in the background and keep the running application running (with user permission of course..)
Does anyone has an idea?
Thanks,
Voper
Thanks,
ReplyDeletevery good job.
Has somebody an idea how to check if a call is established.
I have tried a lot without success.
Thanks
Chris
Hey!
ReplyDeleteI'm sorry, but I have read your post, and I've read all comments on here, and searched Google, and tried many different approaches, but I cannot get my project to include ITelephony.aidl.
I'm fairly new to java, so I'm sorry if I'm missing something simple, but I may need you to explain it in simpler terms for me.
I have tried the jar, and copying the aidl, etc. I followed your link to your Phone Away Widget, but didn't see any source code available.
Thank you, I appreciate it!
Paul
Hey, nevermind, I figured it out finally. All I did was create a new blank java file in my project that I'm working on, and called it ITelephony.java. Then I copied and pasted the code from here into that file, and saved it: http://www.google.com/codesearch/p?hl=en#LQbkWtxul78/gen/com/android/internal/telephony/ITelephony.java&q=file:(/%7C%5E)com/android/internal/telephony/ITelephony%5C.java$&sa=N&cd=1&ct=rc
ReplyDeleteIt gave me an error, since it was using the wrong import, so I used the auto-create method that Eclipse suggested, which created a new package within my project, and moved the java file there. All is working now!
P.S. I have it working with emulators on ALL versions of Android higher than API level 5, which is Android 1.6. In other words, from 2.0 up to 2.3.3 (API levels 6 through 10) it is working!
can you please provide the package for 2.3.3. I cannot make it work for 2.3.3. It would be really nice if you help me.
DeleteHi Paul,
ReplyDeletepls follow this to include ITelePhony.aidl
- copy and past ITelePhony.aidl under com.android.internal.telephony package of your Eclipse Project
- It should generate automatically ITelephony.java under gen folder.
Regarding PhoneAwayWidget - you need SVN client to download the source-
http://code.google.com/p/phoneaway/source/checkout
If you still face same problem, drop me mail.
Thanks,
Prasanta
hi prasanta i just use ur code but it completely in emulator but not in real device,do you have some suggestions
ReplyDeletePrasanta,
ReplyDeleteI've tried the code on HTC Hero with OS 1.5 as well as on HTC Desire HD with OS 2.2 and it worked great but on Samsung Nexus S with OS 2.3 i can see during the installation that the application didn't get the permission:
"Not granting permission android.permission.MODIFY_PHONE_STATE to package test.phone (protectionLevel=3 flags=0x8446)"
and on run time i get an exception when i attempt to answer the call.
Do you think there's a workaround for it (without being root application)?
Hi prasanta,
ReplyDeletei am new to android my name is Rajesh.i saw your blog it is very help full to me but i have a small problem,
user press dial button in android i need to place a conformation button.how to do this can u help me..
Prasanta,
ReplyDeleteI have tried all of your instructions, and still don't understand what you mean by "copy and paste ITelephony into com.android.internal.telephony package of your Eclipse project". How do you create that package in the first place, and is that package within my application project? I've tried copying and pasting the aidl into quite a few places, and it never generates the ITelephony.java file. Thanks for the help in advance!
It looks like you need MODIFY_STATE_PHONE even if you are just ending a call:
ReplyDelete04-10 16:15:20.065: ERROR/DeclineCallsReceiver(1524): ERROR: Neither user 10025 nor current process has android.permission.MODIFY_PHONE_STATE.
Thanks for the blog!
@Paul - look at Tedd's Droid Tools example that Prasanta reference:
ReplyDeletehttp://code.google.com/p/teddsdroidtools/source/browse/#svn%2Ftrunk%2Fteddsdroidtools%2Fsrc%253Fstate%253Dclosed
It shows where the ITelephony.aidl should be in order to get it to be generated in /res for the project. I have that part working.
endCall ending the call on receiver part(on android phone that receives the incoming call), but not at the caller side. Caller hear busy line sound before network timeout expires or redirected to voice mail (in case android has voice mail setup). Any solution to correctly terminate the call ?
ReplyDeletePrasanta ,
ReplyDeleteThanx alot !!! this was a really very useful post for me , it helped me in my project and now my project has been selected fr best project of my clg , credit goes 2 u!!!
Tejas
Hi Prasanta
ReplyDeleteThanks for your all great help. Your opinion and code really help me a lot. I have stuck in one place when i am using switchHoldingAndActive() method in ITelephony.aidl it is implemented well and good, but at run time it is throwing exception "No Such Element Found". Do you have any right idea to help me out.
Thanks & Regards
Hi Prasanta,
ReplyDeleteI have used these two methods
void switchHoldingAndActive();
boolean canConference();
in ITelephony.aidl but geting error like ---
05-12 22:03:34.486: ERROR/dalvikvm(17603): Could not find method com.android.internal.telephony.ITelephony.switchHoldingAndActive
Thanking you,
Regards,
Saj
Hi Prasanta,
ReplyDeleteI tried to work with the setMute function , in the way you described above, but it threw an exception: NoSuchMethodError...
Notice that I succeed to work with some other function, such as endCall() and it worked fine.
Any Idea why it knows endCall method but not setMute?
Thank,
Tomer
Hello Excellent post, I have an application that have all the names and address in my city, I can find a name with a phone number, with your application I can intercept the number, but will be possible to draw my info in the incoming call of android??
ReplyDeleteThanks Rodney
Hi,
ReplyDeleteThis works.Thanks.
Now can you suggest something for outgoing calls?
Hello Prasanta,
ReplyDeleteCan you please explain to me why the application reject calls on the emulator and do not work on a real device?
Thanks in advance. :)
Regards,
Hello Pransanta,
ReplyDeleteI am working with a calling application and i have to first dial a number and after 20 seconds i have to disconnect the call. I understand that API does not allows to control calls. i am trying to make somehtign like this and put a timer but i need your help thanks.
if(tm.getCallState() == TelephonyManager.CALL_STATE_OFFHOOK){
// end the call after 20 seconds :-(
telephonyService.endcall;
}
Hello Prasanta,
ReplyDeleteI have a clarification.
You have mentioned about the mute on going call.
Is it possible to mute/Silence mode the incoming call ring before the call is picked.
Thanks in Advance.
Sanjeev.O.J
Hi,
ReplyDeleteVery useful post.
facing a problem, when using the setMute and getCallerName methods, shows NoSuchMethodError. Please help me in this
Thanks in advance
Hi Prasanta,
ReplyDeletehow would you suggest to recognize phonecall connect and dial - I need to recognize the event of call start and call connect- the first one is easy OFFHOOK state is called - but what about call connect 10x
Elad
See https://devmaze.wordpress.com/2011/01/18/using-com-android-internal-part-1-introduction/ for a detailed description of creating your own .jar file for internals thus avoiding use of Java Reflection and the need for attaching the large and heap-error prone framework_intermediates-classes-full-debug.jar
ReplyDeleteIt also describes how to eliminate the prohibition against using internal's.
I have it setup now to try.
Hi i am very new in android. Can u please provide me the source code of this (actually i want to block incoming and outgoing call)
ReplyDelete@Prasanta Paul
ReplyDeleteOut standing !!! Great !!! Salute to you !!!
Works well, one issue I'm having on 2.3 even with the android.permission.MODIFY_PHONE_STATE permission added to my app I still get a SecurityException when I try to turn of the ringer on incoming calls. I am able to hang up on calls though.
ReplyDeleteBecause of security reasons gingerbread has removed the endcall from ITelephony AIDL exposed to app developers. So you cant end the call :(.
ReplyDeleteGirish
This is good stuff , but i m not getting how can we pass the array of phone no. for block call !
ReplyDeleteHi,It is a good blog guys..But in Android 2.3 we dont have Modify phone state Permission.
ReplyDeleteSo this code will only work till Android 2.2
Hi Prasanta,
ReplyDeleteI tried with the sample code that u have provided...it defintely ends the call but not before the call is received for a very short duration...so can we some how change the priority of the receiver so that it gets the first broadcast and then the other oredered broadcasts are called....
Waiting for your KT on this...
Thanks~
Phil
http://code.google.com/p/android/issues/detail?id=15031
ReplyDeleteWhat about newer versions? Does this approach work in 3.0, 3.2 etc OR it's blocked there also - anyone tried this?
ReplyDeleteAlso in 2.2 this works, then can an app play some audio to the incoming call?
Any help on this is appreciated.
Thanks.
Hi Prasanta Paul,
ReplyDeleteThanks for the code. I am trying to get it to work using Netbeans android plugin. I copied/pasted the ITelephony.aidl text above my main class definition. So I can use it as a Nested Interface. And then I copied/pasted this code into my main class:
[code]
case TelephonyManager.CALL_STATE_RINGING:
stateString = "Ringing";
locked=false;
try{
Context context = getBaseContext();
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
audioManager.setSpeakerphoneOn(true);
Class c = Class.forName(telephonyManager.getClass().getName());
Method m = c.getDeclaredMethod("getITelephony");
m.setAccessible(true);
ITelephony telephonyService = (ITelephony) m.invoke(telephonyManager);
// Silence the ringer and answer the call!
telephonyService.silenceRinger();
telephonyService.answerRingingCall();
}catch(Exception e){System.out.println("Answer Call Error: "+e);}
break;
[/code]
I also added the permissions to the manifest.xml
I dont get any errors and the program is running on my phone.
All I'm trying to do right now is answer the call automatically when case is: TelephonyManager.CALL_STATE_RINGING
Do you not have to provide an implementation of AnserRingingCall()? Because it is only an interface, am I right?
Do I have to add the whole jar framework aswell?
Pls help,
Regards
Aubrey.
I seem to be getting a "ClassCastException: com.android.internal.telephony.ITelephony$Stub$Proxy"
ReplyDeleteI'm lost here,
Regards
Aubrey.
Ahh, got it. There was no need to use the framework jar!
ReplyDeleteAll I had to do was save the ITelephony interface code as ITelephony.java - Then, create folders in the project "root"/src/ folder: (/src/com/android/internal/telephony/)
Thankyou Pransanta
Regards
Aubrey.
Hi Prasantha! I need ur help regarding some application in android .Please reply to this comment so that i can discuss my problem.
ReplyDeletePrasanta, hi your post was of great help to me, i was wondering if there is also a way to get the call time, when the person on the other side actually answered the call, using reflection..... thank in advance..
ReplyDeletetelephonyservice.answerCall(); is not working and
ReplyDeleteNeither user 10025 nor current process has android.permission.MODIFY_PHONE_STATE.
this error show in logcat
Hi Prasanta
ReplyDeleteThanks a million for your post
I have tried it and worked perfect for me on a small call intent and using your ITelephony endcall method on android 2.3.3
Rgds,
Christian
given code is perfectly working on till Android 2.2 but not working with Android 2.3.
ReplyDeletein Android 2.3 Modify_Phone_State permission has been removed soo give any possible solution so that we can do block incoming calls on Android 2.3.
pls..! send reject call project source code link....!
ReplyDeleteThanks
hi prasanta ,
ReplyDeleteit was very elegantly handled, can u help me out to write a code by which one can set voicemail for different callers....
Hi,
ReplyDeleteFor my application i need that whenever during the call in android phone, as the conference starts(when more then two line are joint) the phone go on hold automatically or the headphone and speaker goes mute cant able to hear or talk any thing. i try but can get the solution please give me the solution. my mail address gauravbtl.sitm@gmail.com
Worked. Thanks for this!
ReplyDeleteAny hints on how to determine if an outgoing call resulted in a busy signal?
on a separate note, how well does this work with different OS versions? ie 2.2, 2.3 or 4.0?
Hi,
ReplyDeleteendcall() is not working on the target 2.3 onwords version. Can you please help me to implement work around.
Thanks,
Naresh
Hi,
ReplyDeleteI am not able to access CallManger class from com.android.internal.telephony package. I downloaded framework_intermediates-classes-full-debug.jar file and I added this to my project but am unable to access CallManger class. I think this jar file does't containd CallManger.java class. From where I will get this class?
Hi,
ReplyDeleteI want to use com.android.internal.telephony API's for that I downloaded "framework_intermediates-classes-full-debug" jar file and added this to my project in eclipse. But I am unable to import CallManager.java class of that package into my project. I am able to import Call.java class of telephony API but not CallManger.java. Then how to import this class to my project? is there any jar file? plz help me.
Thanks in advance
hello everybody
ReplyDeleteCan I Hide Native Phone App GUI When Incoming Call Comes.can someone show me how to do it ?
( my phone is android )
Hi Guys,
ReplyDeletenobody answered the MODIFY_PHONE_STATE issue then I'll do:
Since Gingerbread (2.3) this permission can be replaced with READ_PHONE_STATE to get anserRingingCall() working....
Hi guys
ReplyDeleteCan we use the above to issue a
disableDataConnectivity()
?
st
thanks , really helpful.
ReplyDeleteHi i am able to disconnect the call but the phone rings atleast for 1-2 seconds before the call gets disconnected.Please help.
ReplyDeletebro...could you mail me the call blocking workspace on lokesh_technocrat@hotmail.com...plz....
DeleteHey. It is a really great article. But I cannot seem to download anything. All the links give me a 404 error. Please help
ReplyDeleteHi,
ReplyDeleteYour tutorial is quite helpful. Would you be willing to write one on sending AT commands (suct as at+csq?) as well?
Thanks
hi Prasanta
ReplyDeletei am working my project.When have an incoming phone call, the screen has not changed its.How to do it (can you give me a little code for this problem ) ? please help me!
Thanks. Good job! :)
ReplyDeletevery nice yar after finding a lot i got it.......
ReplyDeleteHello Prasanta, Nice tutorial... But my requirement is quite different.. I want to receive incoming call automatically that was I done already now I want to play my own created sound to my caller rather than android will use its default mike.. Can you tell me is it possible or not and how?
ReplyDeleteI am waiting for your reply... :)
Thanks.
Hello Prasanta, Nice tutorial... But my requirement is quite different.. I want to receive incoming call automatically that was I done already now I want to play my own created sound to my caller rather than android will use its default mike.. Can you tell me is it possible or not and how?
ReplyDeleteI am waiting for your reply... :)
Thanks.
Hey mansi i am also waiting for the same ... if you got the solution please help me..
Deletebro...could you mail me the call blocking workspace on if09033@students.del.ac.id ...plz....
ReplyDeleteHi prasanta can you please help me out here., actually i have done every like you only but how to make a active call to hold through programming.. please help me.... is this possible by changing the mode (Audiomanager.setmode(variable)).
ReplyDeleteplease yar its very urgent for me.. i am searching for this from last one month//...
Hi Prasanta,its usefule article. but i want to know if i want to give automatic call to any number(Ex. 989898989) on particular time then is it possible? scenario is like this i have set message,date,time for particular number from my contact list and now without my/user interaction call should get occurred. is it possible? i did R&D but i confused about the same. you can mail me directly on dhane.onkar@gmail.com thanks in advance.
ReplyDeleteGreat Stuff!! Prasanta.. Thanks a Tonn :)
ReplyDeleteHi,
ReplyDeleteCan you tell how to put call on Hold?
is it possible?
You should be able to do that while the incomin call. You see that option on the screen. http://www.intellectsoft.net/windows_phone_development_services.html
ReplyDeletePlease tell the solution for 2.3+
ReplyDeleteHi,
ReplyDeleteit seems to be blocked since 2.3
http://code.google.com/p/android/issues/detail?id=15031#makechanges
well, it seems that this solution using com.android.internal.telephony.ITelephony is great for lower version os builds... I implemented and tested this solution on real devices, where this solution works for android 2.2 os built devices but on higher version of os(upper than v2.3) the part -> Answering incoming call using answerRingingCall() doesn't work at all.
ReplyDeleteCan anyone give me any suggestion on this issue?
Hi Prasant
ReplyDeleteI am novice in Android development , could u help me writing a code which takes a phone number and duration as argument and then call that number for that a particular duration or if you could point me to some api by using which i can do that would also be fine , till now i am able to give number as argument and then call that number but not able to control time.
thanks in advance.
Great tutorial , Prasanta.
ReplyDeleteI was able to achieve the call control you explained a few days ago.
Then moving ahead, i wanted to perform call conferencing programmatically using the hidden com.android.internal.telephony.Phone interface.
But there's no any method to get a reference to this Interface from TelephoneManager like the getITelephony() method.
Please let me know if you have worked with that hidden Phone interface.
Hi,
ReplyDeletecan you please explain me how to detect the incoming call is ended by remote party?
Thanks & Regards,
Durgesh Patel
Java / Android Software Engineer
Cygnet Infotech Pvt. Ltd.
Ahmedabad, Gujarat, India.
mute functionality doesn't work as it do is not already available in Itelephony.aidl. Anywaz tuorial is good.
ReplyDeleteHi , I'm unable to use this feature. Can you please send me this code
ReplyDeletesumit.sharma@mail.vinove.com
Itelephony.aidl is giving an error, due to which code is not running. Please help to get out of this.can you please send me call block code to this mail.
ReplyDeletesumitsharma1900@gmail.com
Hi,
ReplyDeleteI'm trying to use your approach to end the call, but I'm facing some issues. In my phone (LG Optimus) running on android 2.2, I could successfully receive the call but couldn't end it. The endCall() method returns false. Can you please inform whether this works in android 4.0 onwards.
Can anybody tell me how to convert this widget into android app
ReplyDeletesumitsharma1900@gmail.com
Hi
ReplyDeletecan it is possible in Android mobile App to detrack Control from mic to other App when call recived and Connection established?????
Did not work in 4.2.1. Any idea how to accomplish these in 4.x? Thanks in advance.
ReplyDeleteHey this is not working in ICS. Do you have any idea how to get this work?
ReplyDeleteI searched on internet, few are saying that its not possible now. Is it ?
Dear All,
ReplyDeleteto provide more Android internal and Hidden method support, I have created one project "InDroid". In this project I'll work on to expose Android's hidden API and important utility methods to empower Application developers with rich Native access.
Initial version of this Library (1.0) supports hidden APIs of Telephony, Graphics and View system. Please try this Library and let me know your feedback-
http://code.google.com/p/indroid/
BR,
Prasanta
Hi Prasanta
ReplyDeletethanks for posting Idroid Jar but the method answerRingingCall is not working for android 2.3.3
Hi Prasanta,
ReplyDeleteThanks for this tutorial. I have got exception when i run the code "No Method found getITelePhony". Please tell me how to end call in android 4.0
i am getting this error
ReplyDeletejava.lang.SecurityException: Neither user 10045 nor current process has android.permission.MODIFY_PHONE_STATE.
can u please help me ..
Thanks for the tutorial. In this world where almost all people have their own mobile phones, it is good to have a refresher on the latest trends in this type of technology.
ReplyDeleteThanks for such nice and useful post.
ReplyDeleteI am trying to auto answer and dial number but its not working, can you help me in that ?
http://stackoverflow.com/questions/21019975/neither-user-10056-nor-current-process-has-android-permission-modify-phone-state
Thanks
Juned Khan
Thanks Prasanta,
ReplyDeleteI am actually waiting for this type of explanation.
You are awesome... :)
Thanks prasanta
ReplyDeleteIt's very useful for me
It doesn't working for me.
ReplyDelete