0

I want to write a program in android will ask for a password when an incoming call is detected. The program will only allow the call to be answered if the password is correct.

How should I implement that?

For example, I found a program that does this: App Lock

...but I have no idea where I should start. Should I write a service?

Thanks and regards.

David Olsson
  • 8,085
  • 3
  • 30
  • 38
M.Movaffagh
  • 1,284
  • 5
  • 20
  • 33

1 Answers1

2

This may help you: https://web.archive.org/web/20210127130519/http://www.tutorialforandroid.com/2009/01/get-phone-state-when-someone-is-calling_22.html

You have to register a broadcast receiver in order to catch the events (call ringing, etc, etc..) and based on the various states, you can perform any operations you may want.

Also check this link: How to block calls in android

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
Dimitris Makris
  • 5,183
  • 2
  • 34
  • 54