AnswerCall problem

brelto85

Active Member
Licensed User
Longtime User
Hi,

I'm trying to use the AnswerCall library but with my "HTC ONE S" not work, while the "endCall" method works perfectly

B4X:
Sub KillCall
    Dim r As Reflector
    r.Target = r.GetContext
    Dim TelephonyManager, TelephonyInterface As Object
    TelephonyManager = r.RunMethod2("getSystemService", "phone", "java.lang.String")
    r.Target = TelephonyManager
    TelephonyInterface = r.RunMethod("getITelephony")
    r.Target = TelephonyInterface
    r.RunMethod("endCall")
End Sub

Looking on the android sdk, i' ve found the answerCall method in the same section of endCall method.
The difference is that the answerCall method, needs 2 parameters

is possibile to call answerCall method with the same mode of endCall?

thanks
Alberto
 

brelto85

Active Member
Licensed User
Longtime User
Third attempt....

there's a way to answer call that works on all smartphone using for example a reflector?
with my "HTC ONE S" library AnswerCall do not works
 
Upvote 0

madSac

Active Member
Licensed User
Longtime User
May be samsung has disabled answering call in HTC ONE S in your country.

like reading call is allowed in some phone in some countries.....
 
Upvote 0

NeoTechni

Well-Known Member
Licensed User
Longtime User
I'm having problems on HTC devices too

This library simulates a headset button press:
AutoAnswerIntentService.java - auto-answer - Android AutoAnswer - Google Project Hosting

Perhaps we could try that? Or is that how the answer call lib does it?

Using my media player library we should be able to do it

http://www.b4x.com/forum/additional...lib-control-system-media-player-your-app.html

Or this one http://www.b4x.com/forum/basic4andr...-simulate-hardware-keypress-2.html#post120246

Intent answer = new Intent(Intent.ACTION_MEDIA_BUTTON);
answer.putExtra(Intent.EXTRA_KEY_EVENT, new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_HEADSETHOOK));
sendOrderedBroadcast(answer, null);
 
Last edited:
Upvote 0

NeoTechni

Well-Known Member
Licensed User
Longtime User
Yup, my media controller library works

B4X:
dim keyg As MediaController 
keyg.MediaButton(KeyCodes.KEYCODE_HEADSETHOOK)
 
Upvote 0
Top