Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8817053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:45:29+00:00 2026-06-14T04:45:29+00:00

So as the subject states I need to be able to answer a phone

  • 0

So as the subject states I need to be able to answer a phone call programmatically in Android 4.0.3 on an HTC OneX. I have read several places that the MODIFY_PHONE_STATE permission has been revoked by Google so to do this task you need a work around.

I have looked into two avenues so far:

(1) Following Guy’s post here and using a BroadcastReceiver

(2) Using the following code to try and hit a key event through a shell command.

final Runtime r = Runtime.getRuntime();
    try {
        Process process = r.exec("input keyevent 5");
        InputStream stream = process.getErrorStream();
        log.v("Process Error Stream: " +stream.toString());
        log.v("Sending shell command to Answer Call");
    } catch (Exception e) {
        log.v("Stack Trace: " + e.getStackTrace().toString());
        e.printStackTrace();
    } 

I use this because keyevent 5 is KeyEvent.CALL according to Google and it works in adb using

adb shell input keyevent 5

My question is, what am I doing wrong? Because logically both of these methods makes sense but neither are working or even generating runtime errors of any kind.

Cheers

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T04:45:30+00:00Added an answer on June 14, 2026 at 4:45 am

    After days of research, I found that using both a broadcast receiver route and a runtime.exec() route it is simply not possible to answer a phone call in Android 4.0.3 using the Android API.

    For those of you still wondering, I did find some useful information…You CAN answer a call through adb using the command adb shell input keyevent 5 5 is the key code for the call button and in Android it is the KEYEVENT_CALL

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a plain text file that I need to read in using C#,
I read spring docs on this subject several times, but some things are still
Well - exactly as the question subject states - any ideas on how you
Subject of discussion: User security on non rooted Android phones. Is it possible to
I'd like your opinion on the following subject: Imagine we have a method that
I'm new to Django... I need to start a project that will have subdomains,
I've done a search on this subject already, and have found the same data
I have the following situation and I know have a lot of this subject
I think I just need someone to show me the obvious. I have a
I have the following XML: <tickets> <ticket> <subject>ABC</subject> <entries-field> <entry-field> <field-id>12345</field-id> <value>New</value> </entry-field> <entries-field>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.