hanging up/terminating a call in an automated fashion

by dreamerBoy » Tue, 28 Oct 2008 02:50:25 GMT


Sponsored Links
 Hi -

I am looking for a way to terminate a call in an automated fashion.
(I realize it can be done manually - the application requires that it
have control over the call so that it can hang up automatically.)

To initiate a call, one starts an Activity with the ACTION_CALL
Intent.

However, there does not appear to be any corresponding way to end it
with a corresponding Intent, or using the Telephony or
TelephonyManager interface/package.

The only thing I can thing of is calling finish() on the Activity used
to start the call - but that doesn't seem right at all.

Can anyone shed light on this issue?

Thanks much.

Paul
--~--~---------~--~----~------------~-------~--~----~



hanging up/terminating a call in an automated fashion

by dreamerBoy » Tue, 28 Oct 2008 07:35:02 GMT


 Second question is how to hang up an ~incoming~ call after it has been
answered ....



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


hanging up/terminating a call in an automated fashion

by legerb » Wed, 29 Oct 2008 16:42:23 GMT


 You can use a BroadcastReceiver to catch the Intent, and terminate it
with abortBroadcast().



--~--~---------~--~----~------------~-------~--~----~



hanging up/terminating a call in an automated fashion

by dreamerBoy » Thu, 30 Oct 2008 04:32:21 GMT


 ...Interesting....

Thanks so much for the reply.

Perhaps I have misunderstood but I have some questions about this
approach.

i)  A Broadcast receiver is a passive entity.   What would be the
active entity that will be generating the Intent?  Remember, my code
is supposed to be the one to initiate end-of-call NOT a human user.
Why would there be an event out there at any given moment waiting for
my code to capture?  Is there some kind of heart-beat message sent out
every so often to indicate an active call?

ii)  Which Intent is the one of interest?  I couldn't find anything
that matches in the Standard Broadcast Actions of Google's
android.content.Intent write-up page.

You might be talking about the ACTION_NEW_OUTGOING_CALL broadcast.
However, I don't want to prevent an outgoing call, I want to hang up a
call that is already connected  - whether the call originated from or
is answered by the g-phone.

Paul




--~--~---------~--~----~------------~-------~--~----~



hanging up/terminating a call in an automated fashion

by legerb » Thu, 30 Oct 2008 18:19:13 GMT


 Oh sorry, I should've been more clear.
I was talking about the ACTION_NEW_OUTGOING_CALL.
Hanging up incoming call programmaticaly is currently impossible.
As for the outgoing call - it can be terminated only when initiated,
because only then we can catch the Intent. After that there seems to
be no access to the call.
There is also no heart-beat message sent out every so often to
indicate an active call.
PhoneStateListener is also not helpful in this matter, as it receives
only "state changes" events.




Other Threads

1. Full screen activity

I'm writing an Activity that should take up the entire screen.  I
therefore call

requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);

at the beginning of onCreate().  But it doesn't work correctly.  What
happens is that the window title and notification bar are both visible
for just a moment when the activity starts up.  Then they slide off,
leaving my activity with a messed up layout: a blank space the size of
the notification bar gets left at the top of the screen, and a little
bit of my layout gets cut off at the bottom of the screen.  It appears
that it's laid out the activity the size of the full screen, but then
pushed it down a bit so part of it gets cut off.

If I remove either one of the two lines above, everything works
correctly and nothing gets cut off.  But then I have a title bar or
notification bar at the top of the screen, which I don't want.

I'm sure I must be missing something simple, but I've had no success
figuring out what.

Peter

-- 

2. Whats first onCreate or the constructor

Firstly I hope this isn't too basic a question, I'm new to Java (and
be extension Android) so please forgive me if it's obvious to everyone
else, but I couldn't find the answer via Google.

I have a simple app I'm writing primary because I and at least one of
my friends want it but also to learn Java. Part of this application
pulls a database from the resources and copy's it so it can be
accessed via SQLite, and I use a class that extends SQLiteOpenHelper
to copy the database.

And here lies the problem, as soon as this class exists (the
constructor is called) I get a runtime exception, comment it out it
runs fine.

I think this is because the constructor is setting a String (db_path)
that is used by onCreate, and so if onCreate is fired before the
constructor it tries to use db_path and fails because it's not set.

-- 

3. VTD-XML 2.9 (not spam!!

4. Application state when Home pressed

5. Javadoc for ContactContract.RawContacts

6. Challenges moving to the Android platform ?

7. Saving PNG files to the SDCard