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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:53:37+00:00 2026-05-24T18:53:37+00:00

As you may know, there’s not a single organized documentation on how to properly

  • 0

As you may know, there’s not a single organized documentation on how to properly login to Facebook using the asmack library. I’ve somehow managed to find some codes in the net to at least allow me to login to my account but why do I keep getting the following exception:

XMPPError connecting to chat.facebook.com:5222.: remote-server-error(502) XMPPError connecting to chat.facebook.com:5222. — caused by: java.net.SocketException: Permission denied

Here’s the code:

((Button) findViewById(R.id.login_btn)).setOnClickListener(
      new OnClickListener() {
         @Override
         public void onClick(View v) {
            ConnectionConfiguration config =
                  new ConnectionConfiguration("chat.facebook.com", 5222,
                  "chat.facebook.com");
            config.setSASLAuthenticationEnabled(true);

            Connection conn = new XMPPConnection(config);
            try {
               conn.connect();
               SASLAuthentication.supportSASLMechanism("PLAIN", 0);

               ProgressDialog loading = ProgressDialog.show(instance,
                     "", "Loading...");
               conn.login(login_field.getText().toString(),
                     pwd_field.getText().toString(),
                     login_field.getText().toString() + "/fbchat");
               loading.hide();

               new AlertDialog.Builder(instance).setMessage(conn.getUser())
                  .create().show();
            } catch (XMPPException e) {
               new AlertDialog.Builder(instance).setMessage(e.toString())
               .setPositiveButton("OK", new DialogInterface.OnClickListener() {
                  @Override
                  public void onClick(DialogInterface dialog, int which) {
                     dialog.cancel();
                  }
               })
               .create().show();
            }
         }
});
  • 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-24T18:53:37+00:00Added an answer on May 24, 2026 at 6:53 pm

    Obvious potential explanation – do you have the INTERNET permission in your AndroidManifest.xml?

        <uses-permission android:name="android.permission.INTERNET"/>
    

    Without this, you will be unable to access network resources.


    EDIT:

    Where in the manifest are you requesting the INTERNET permission? It’s location can make a difference, and it will fail silently. It needs to be at the top-level (under the <manifest> tag, not attached to an activity, for example). Of course, if you added it via Eclipse, it’s probably in the correct place already:

    <manifest
        xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.example.android.samplesync"
        android:versionCode="1"
        android:versionName="1.0">
        <uses-permission android:name="android.permission.INTERNET" />
        <activity>
            ...
        </activity>
    </manifest>
    

    Alternatively, how are you connecting to the internet? This may also indicate that the required ports are being blocked by a firewall (see here)

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

Sidebar

Related Questions

I am working on files n folder using C#....May I know is there any
for website that embed flash to capture camera (red5..etc). may i know is there
As you may know, in many occasions, there is a need to flag some
This may be a silly question I don't know. Is there a way to
May I know is there any way to determine parent class from boost::any? #include
May I know is there any plug-in for eclipse with which I can access
May I know if there are any issues running a Java 5-compiled code (with
As You may know, there are higher order functions in OCaml, such as fold_left,
As you may know, in Latin alphabet there was no difference between u/v and
may i know is there any good Linq to Sql C# framework available out

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.