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

  • Home
  • SEARCH
  • 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 6477543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:57:40+00:00 2026-05-25T06:57:40+00:00

I’ve been writing code on a HTC Desire Z running 2.3.3 and it works

  • 0

I’ve been writing code on a HTC Desire Z running 2.3.3 and it works fine – now I’ve come to test it on another device (Nexus One running 2.3.4), and it crashes. Here’s the code:

if (me == null || sipManager == null || listener == null){
    Log.e("OH","NO");
}

sipManager.register(me, 30, listener);

None of the things I pass to sipManager.register are null (the log is never called), but here’s my stack trace:

FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to create service com.myapp.Service: java.lang.NullPointerException
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:1955)
    at android.app.ActivityThread.access$2500(ActivityThread.java:117)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:985)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:130)
    at android.app.ActivityThread.main(ActivityThread.java:3683)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
    at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
    at android.net.sip.SipManager.register(SipManager.java:474)
    at com.myapp.Service.onCreate(Service.java:159)
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:1945)
    ... 10 more

Looking at the Android source doesn’t seem to reveal anything obvious either – everything I’m passing to it is valid on another device.

Both devices are running 2.3+ and both have the SIP stack enabled:

if (SipManager.isVoipSupported(this) && SipManager.isApiSupported(this)){

EDIT:

Here’s a full activity which replicates the issue:

public class SIPTest extends Activity {

    public SipManager sipManager = null;
    SipProfile me = null;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);


        if (SipManager.isVoipSupported(this) && SipManager.isApiSupported(this)){
            // SIP is supported, let's go!
            Log.e("SIP", "SUPPORTED");
            sipManager = SipManager.newInstance(this);


            String username = "username";
            String password = "password";
            String domain = "example.org";

            try {
                SipProfile.Builder builder = new SipProfile.Builder(username, domain);
                builder.setPassword(password);
                builder.setDisplayName(username);
                builder.setProfileName(username + "@" + domain);
                me = builder.build();

                sipManager.register(me, 30, new SipRegistrationListener() {
                        public void onRegistering(String localProfileUri) {
                            Log.e("SIP","Registering with SIP Server...");
                        }

                        public void onRegistrationDone(String localProfileUri, long expiryTime) {
                            Log.e("SIP","Ready!");
                        }

                        public void onRegistrationFailed(String localProfileUri, int errorCode,
                                String errorMessage) {
                            Log.e("SIP","Registration failed. " + errorMessage + " ("+errorCode+") - " + localProfileUri);
                        }
                    });
            } catch (ParseException pe) {
                Log.e("SIP","Connection Error.");
            } catch (SipException se) {
                Log.e("SIP","Connection error.");
            }

        }

    }
}
  • 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-05-25T06:57:41+00:00Added an answer on May 25, 2026 at 6:57 am

    You shall just place sipManager.open(me); before sipManager.register() is executed as new sip session needs to be created.

    take care!

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I am currently running into a problem where an element is coming back from
I am writing an app with both english and french support. The app requests

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.