3

I want to block few mobile numbers from my application.

I mean can receive the blocked mobile number call or message... but want it rejected right away, without the phone ringing.

Is it possible to do this from my application? If it is, please give me some samples..

 Class c = Class.forName(telephony.getClass().getName());
 Method m = c.getDeclaredMethod("getITelephony");
 m.setAccessible(true);
 telephonyService = (ITelephony) m.invoke(telephony);
 telephonyService.silenceRinger();
 telephonyService.endCall();
 } catch (Exception e) {
 e.printStackTrace();
lucian.pantelimon
  • 3,673
  • 4
  • 29
  • 46
Venkat
  • 3,447
  • 6
  • 42
  • 61

1 Answers1

2

@venkat goto this http://androidsourcecode.blogspot.in/ link it provide working sorce code to block o/g calls and also tested by me.

Ronak Mehta
  • 5,971
  • 5
  • 42
  • 69
  • is it works for emulator... i want to block only one number how is it? – Venkat Mar 28 '12 at 09:54
  • dude i am using this in my working application means on live project now want to say anything ? – Ronak Mehta Mar 28 '12 at 10:14
  • i try the same code for two emulator but it is not working what wrong with me? – Venkat Mar 28 '12 at 10:17
  • i copy the same code and executed with out any modifications but it gives me nothing??? – Venkat Mar 28 '12 at 10:21
  • see this http://stackoverflow.com/questions/9904426/how-to-block-a-mobile-number-call-and-message-receiving-in-android-application-d/9904826#9904826 i just give source to prasad – Ronak Mehta Mar 28 '12 at 10:21