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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:31:16+00:00 2026-05-13T15:31:16+00:00

Hay Guy, I’m using org.apache.commons.net.nntp to connect to a nntp server, however running a

  • 0

Hay Guy, I’m using org.apache.commons.net.nntp to connect to a nntp server, however running a simple nntp.connect(host, port) crashes the android.

Anyone got any ideas? Do java packages work with android straight out of the box? or do they need editing?

Thanks

import org.apache.commons.net.nntp.*;

public class newsdroid extends Activity {
    NNTP usenet; /** Called when the activity is first created. */

    @Override public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        try {
            usenet.connect("ssl-eu.astraweb.com", 563);
        } catch (SocketException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}
  • 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-13T15:31:17+00:00Added an answer on May 13, 2026 at 3:31 pm

    You need to initialize your variable usenet, by just using NTTP usenet its called declaring the variable. It just declares the variable to type NTTP and it has a reference to nothing, which is commonly defined as being null, hence the NullPointerException.

    You might need to check out NTTPClient instead, so add this into your code

    NTTPClient usenet = new NTTPClient();
    

    That is initializing the variable usenet to a NTTPClient.

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

Sidebar

Related Questions

Hay guys, i've made a simple drawing application using the canvas tag. However i
Hay Guys, i want to write a simple NNTP client, which can connect to
Hay, how do i import org.apache.commons packages into android so i can use them
Hay all im using a simple look to get file names from a dir
Hay, I'm using mod_rewrite with apache, and want URLS from http://www.DOMAN.com/course/course-a/ to actually serve
Hay, I'm using django 1.2 and i want to know how to count rows
Hay guys, I'm making a simple preload function (function($) { $.fn.preload = function(settings) {
Hay, i'm using this script function preloader(images){ var i = 0; imageObj = new
Hay, i have a simple model class Manufacturer(models.Model): name = models.CharField() car_count = models.IntegerField()
Hay, i can't seem to send emails using send_mail(), and I'm not sure why.

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.