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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:15:15+00:00 2026-05-16T01:15:15+00:00

public void Connect() throws Exception { InetAddress dest; dest = InetAddress.getByName(192.168.1.100); DatagramSocket socket =

  • 0
public void Connect() throws Exception
{
 InetAddress dest;
 dest = InetAddress.getByName("192.168.1.100");
 DatagramSocket socket = new DatagramSocket();
 socket.connect(new InetSocketAddress(15900));
 byte[] message = "Oh Hai!".getBytes();
 DatagramPacket packet = new DatagramPacket(message, message.length,dest,15900);
 socket.send(packet);
}

Using the above code on Android SDK 1.5, when attaching the debugger to the android emulation, I step through the above sample (obtained from a tutorial), and the debugger returns control to the user when it reaches the DatagramSocket line… as soon as I hit F8 (Eclipse Galileo) to continue, I immediately have control again.. basically it never reaches socket.connect…. What is going wrong here? If I surround it in a try/catch block, nothing is caught so it’s not an exception. Why is it dying like this?

Thanks!

  • 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-16T01:15:16+00:00Added an answer on May 16, 2026 at 1:15 am

    Ah, Socket Permission Error… nevermind!

    For the people wondering how I solved it:
    The manifest needs to have a uses-permission added, permission being internet.

    Add the following to the manifest:

    <uses-permission android:name="android.permission.INTERNET"></uses-permission>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

public void GrabData() throws IOException { try { BufferedReader br = new BufferedReader(new FileReader(data/500.txt));
Here's my HTTP Get method to connect to the URL: public void executeHttpGet() throws
I am trying to connect to a MySQL 5.5 database as follows: public void
public void openOptions() { Intent intent=new Intent(this,Game.class); //intent.putExtra(razmer, level); startActivity(intent); // Intent intent=new Intent(this,Options.class);
public void swap(Point var1, Point var2) { var1.x = 100; var1.y = 100; Point
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Init(); backthread tr=new backthread(); tr.execute(0,0,0); } backthread
public void EditAndSave(String fileName) { Bitmap b = new Bitmap(fileName); /** * Edit bitmap
public void printList( ){ Node<E> p ; System.out.printf( [ ) ; for ( p=head.next
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.map); TextView lattv=(TextView)findViewById(R.id.lat); TextView lngtv=(TextView)findViewById(R.id.lng); JSONParstring jParser =
public void test(Object obj){ //Here i have to set the values of the obj

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.