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 8366731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:59:18+00:00 2026-06-09T12:59:18+00:00

I would love is someone could point me to some good resources or in

  • 0

I would love is someone could point me to some good resources or in the right direction, or even better pump out some code snippets/pseudo code to help me here.

I’m new to android devel and I’ve been tasked to create an app which uses a sip library to make/recieve sip calls. The library is fairly abstracted and all works with a ‘phone’ instance which I can call .rejectCall(), .answerCall() and so on and so forth. To get the instance of the phone, i use this line:

AbtoPhone abtoPhone = ((AbtoApplication)getApplication()).getAbtoPhone();

Thats all fine and dandy, but not understanding Activities and Services properly I’m not sure how to go about turning it into an app.

I want the ability for a user to log in, register with a sip server and then let the phone will listen for calls.

I want it to continue to listen for calls when put into the background. And when in background I want to pop up a dialog that allows someone to answer or reject call, and on answer I want the intial activity to wake up (or if its been killed then i want it to start up) and be brought to the foreground so the user can chat away merrily.

How do I best go about it? At the moment I’m getting the AbtoPhone in the main activity, adding the account, adding all the listeners, and then when a user hits the register button it starts a sticky service which gets its own instance of the phone, with the same command as before.

Then, within the service, I register the user with the sip client. Now when I close the main activity this continues to run and it will receive a call, however it will crash with an exception:

android.view.WindowManager$BadTokenException: Unable to add window 
-- token android.os.BinderProxy@4154ebb0 is not valid; 
is your activity running?

I get that my problem is the original activity that called the service is dead and I’m trying to wake it. But I just don’t know how to do that properly.

I get that Services and Activities is a repeated question, and I have looked around read tutorials however I cant see how to properly apply them to my case, and just hoping someone will be able to say Do X, Start service, Pass this, When you get a call do Y and VOILA! But any help what so ever will be greatly, greatly appreciated!!!

Cheers,

DJOodle

>>>> EDIT

Ok, I’ve moved all handling of the AbtoPhone to a service. When i get a call i then invoke the MainActivity, bind it to the service, so i can invoke the correct methods to answer the call.

This is fine and it works however this means I’ve got a persistent service that is always running, and i get the feeling that’s a bad, bad thing. How can i keep an instance of AbtoPhone listening away for incomming calls without draining the resources of the phone?

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-09T12:59:20+00:00Added an answer on June 9, 2026 at 12:59 pm

    This is a big topic. I think you should give Sip-Droid which is an open-source application a chance. so you can use anything related to it.

    http://code.google.com/p/sipdroid/
    

    this is a Sip based application that does everything you asked for. I think you can use the source code and redeveloped anything you want from it.
    this application uses JNI which is more complicated topic than Sip. so use all JNI’s in this app and you will find lots of lib that you can use and make the works faster.

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

Sidebar

Related Questions

I need some help now. I would love if someone could help we with
I am not good in math and geometry, so I would love if someone
Would love some opinions on this problem I'm trying to workout. I'm trying to
I would love to get some tips from other people that have had this
I am in the midst of a short thought experiment and would love some
This is for a job interview and I'd love it if someone could put
Could someone be kind enough to point me to a comprehensive manual (preferably a
I would love to be able to do >>> A = numpy.array(((1,2),(3,4))) >>> idx
I would love to sort an embedded MongoDB object using PHP Lithium. I have
Working on a movie website and would love to find an API that I

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.