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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:36:57+00:00 2026-05-16T14:36:57+00:00

I need help with server and I’m new with it. Got a help from

  • 0

I need help with server and I’m new with it. Got a help from my friend but still can’t work. I can’t login. There is no error so called ‘detected’ when running the application. I can’t login. Somehow the connection wasn’t properly established.

This is my java file open in eclipse;

package log1.log2;



import java.io.ObjectOutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Vector;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import java.io.ObjectInputStream;





public class Login extends Activity {


 DBAdapter db = new DBAdapter(this);
/** Called when the activity is first created. */

 private EditText etUsername;
 private EditText etPassword;
 private Button btnLogin;
 private Button btnRegister;
 private TextView lblResult;
 private String username;
 private String password;
 private String user;
 private String value;
 Vector SendVEctor = new Vector();
 Vector receiveVEctor = new Vector(); 

    @Override

    public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        setContentView(R.layout.main);

        // Get the EditText and Button References
        etUsername = (EditText)findViewById(R.id.usernametxt);
        etPassword = (EditText)findViewById(R.id.passwordtxt);
        btnLogin = (Button)findViewById(R.id.btnLogin);
        btnRegister = (Button)findViewById(R.id.btnRegister);
        lblResult = (TextView)findViewById(R.id.msglbl);

        //Cursor c = (Cursor) db.getAllTitles();

        //Button btnArrival = (Button) findViewById(R.id.btnRegister);
     //btnArrival.setOnClickListener(this);


    // Set Click Listener

        btnRegister.setOnClickListener(new OnClickListener() {
         @Override
         public void onClick(View v) {
          Intent intent=new Intent(Login.this,Register.class);
            startActivity(intent);

         }
        });

    btnLogin.setOnClickListener(new OnClickListener() {
 @Override
 public void onClick(View v) 
 {


  String a = "http://172.27.32.251:9090/jsp-examples/ferryhub";
   URL url = null;
      HttpURLConnection httpurlconnection = null;
      try {
       url = new URL(a);
       httpurlconnection = (HttpURLConnection) url
         .openConnection();
       httpurlconnection.setDoOutput(true);
       httpurlconnection.setRequestMethod("POST");



      Toast.makeText(Login.this, a, Toast.LENGTH_SHORT).show();
       Toast.makeText(Login.this, "Toast1", Toast.LENGTH_SHORT).show();
       ObjectOutputStream dos = new ObjectOutputStream(httpurlconnection.getOutputStream());
       SendVEctor.add(etUsername.getText().toString());//foodname
       SendVEctor.add(etPassword.getText().toString());//foodname

       dos.writeObject(SendVEctor);

                 dos.close();


                 ObjectInputStream ois = new ObjectInputStream(httpurlconnection.getInputStream());

                 receiveVEctor = (Vector)ois.readObject();

       Toast.makeText(Login.this, receiveVEctor.get(0).toString(), Toast.LENGTH_SHORT).show();

       if(receiveVEctor.equals("Login Success"))
       { etUsername.setText("");
        etPassword.setText("");
         Toast.makeText(Login.this, receiveVEctor.get(0).toString(), Toast.LENGTH_SHORT).show();
        Intent myIntent = new Intent(((View) v).getContext(),Register.class);
     startActivityForResult(myIntent, 1);

       }//end inner if
       else if(receiveVEctor.equals("Login Fail"))
       { etUsername.setText("");
        etPassword.setText("");
         Toast.makeText(Login.this, receiveVEctor.get(0).toString(), Toast.LENGTH_SHORT).show();


       }//end inner if



       else
       {
        Toast.makeText(Login.this, "error", Toast.LENGTH_SHORT).show(); 
       }


      }//end try
      catch (Exception e) {
       e.printStackTrace();
       Toast.makeText(Login.this, "error2", Toast.LENGTH_SHORT).show();

      }//end catch 
      finally {
       if (httpurlconnection != null)
        httpurlconnection.disconnect();
      }//end finally
  }//end else






   });
 }

}

Everytime when I run my application, the toast will appear with the message error2 after showing http://172.27.32.251:9090/jsp-examples/ferryhub and toast1.

If I’m not wrong the problem is that there is no successful connection to the servlet. I hope to hear from good tips soon. Thank you for reading my question.

-Dayne


Hello again

I’ve run the program again without editing and check the logcat. I can’t find any errors..

here’s how it looks like:

08-24 07:52:37.875: INFO/NotificationService(54): enqueueToast pkg=log1.log2 callback=android.app.ITransientNotification$Stub$Proxy@43904308 duration=0
08-24 07:52:37.895: INFO/NotificationService(54): enqueueToast pkg=log1.log2 callback=android.app.ITransientNotification$Stub$Proxy@43925200 duration=0
08-24 07:52:37.945: WARN/System.err(216): java.net.SocketException: Permission denied (maybe missing INTERNET permission)
08-24 07:52:37.975: WARN/System.err(216):     at org.apache.harmony.luni.platform.OSNetworkSystem.createSocketImpl(Native Method)
08-24 07:52:37.975: WARN/System.err(216):     at org.apache.harmony.luni.platform.OSNetworkSystem.createSocket(OSNetworkSystem.java:85)
08-24 07:52:37.975: WARN/System.err(216):     at org.apache.harmony.luni.net.PlainSocketImpl2.create(PlainSocketImpl2.java:59)
08-24 07:52:37.975: WARN/System.err(216):     at java.net.Socket.checkClosedAndCreate(Socket.java:829)
08-24 07:52:37.975: WARN/System.err(216):     at java.net.Socket.connect(Socket.java:984)
08-24 07:52:37.975: WARN/System.err(216):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>(HttpConnection.java:67)
08-24 07:52:37.975: WARN/System.err(216):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionManager$ConnectionPool.getHttpConnection(HttpConnectionManager.java:151)
08-24 07:52:37.975: WARN/System.err(216):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionManager.getConnection(HttpConnectionManager.java:73)
08-24 07:52:37.975: WARN/System.err(216):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getHTTPConnection(HttpURLConnection.java:826)
08-24 07:52:37.975: WARN/System.err(216):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:812)
08-24 07:52:37.975: WARN/System.err(216):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1153)
08-24 07:52:37.984: WARN/System.err(216):     at log1.log2.Login$2.onClick(Login.java:95)
08-24 07:52:37.984: WARN/System.err(216):     at android.view.View.performClick(View.java:2344)
08-24 07:52:37.984: WARN/System.err(216):     at android.view.View.onKeyUp(View.java:3939)
08-24 07:52:37.984: WARN/System.err(216):     at android.widget.TextView.onKeyUp(TextView.java:4413)
08-24 07:52:37.984: WARN/System.err(216):     at android.view.KeyEvent.dispatch(KeyEvent.java:895)
08-24 07:52:37.984: WARN/System.err(216):     at android.view.View.dispatchKeyEvent(View.java:3647)
08-24 07:52:37.984: WARN/System.err(216):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:746)
08-24 07:52:37.984: WARN/System.err(216):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:746)
08-24 07:52:37.984: WARN/System.err(216):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:746)
08-24 07:52:37.984: WARN/System.err(216):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:746)
08-24 07:52:37.984: WARN/System.err(216):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:1708)
08-24 07:52:37.984: WARN/System.err(216):     at com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1197)
08-24 07:52:37.994: WARN/System.err(216):     at android.app.Activity.dispatchKeyEvent(Activity.java:1967)
08-24 07:52:37.994: WARN/System.err(216):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1684)
08-24 07:52:37.994: WARN/System.err(216):     at android.view.ViewRoot.deliverKeyEventToViewHierarchy(ViewRoot.java:2329)
08-24 07:52:37.994: WARN/System.err(216):     at android.view.ViewRoot.handleFinishedEvent(ViewRoot.java:2299)
08-24 07:52:37.994: WARN/System.err(216):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1621)
08-24 07:52:37.994: WARN/System.err(216):     at android.os.Handler.dispatchMessage(Handler.java:99)
08-24 07:52:37.994: WARN/System.err(216):     at android.os.Looper.loop(Looper.java:123)
08-24 07:52:37.994: WARN/System.err(216):     at android.app.ActivityThread.main(ActivityThread.java:4203)
08-24 07:52:37.994: WARN/System.err(216):     at java.lang.reflect.Method.invokeNative(Native Method)
08-24 07:52:37.994: WARN/System.err(216):     at java.lang.reflect.Method.invoke(Method.java:521)
08-24 07:52:37.994: WARN/System.err(216):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
08-24 07:52:37.994: WARN/System.err(216):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
08-24 07:52:37.994: WARN/System.err(216):     at dalvik.system.NativeStart.main(Native Method)
08-24 07:52:38.004: INFO/NotificationService(54): enqueueToast pkg=log1.log2 callback=android.app.ITransientNotification$Stub$Proxy@438ad2c8 duration=0
08-24 07:52:38.206: INFO/ARMAssembler(54): generated scanline__00000077:03515104_00001A01_00000000 [ 46 ipp] (68 ins) at [0x2ac120:0x2ac230] in 1976229 ns

I hope you can point out the actual error and tell me what I should do.

Thank you for reading my post.

-Dayne


Hi again

As for the internet permission statement, I did at that line in my manifest xml file. I insert it under login activity as shown below:

<activity android:name="Login">
            <intent-filter>
                <action android:name="android.intent.action.EDIT" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <uses-permission android:name="android.permission.INTERNET"/>
         <activity android:name="AdminMain">
            <intent-filter>
                <action android:name="android.intent.action.EDIT" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

Is there any other possible things that I might missed? I hope you have a thing or two to tell me. Thank you.

-Dayne

  • 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-16T14:36:58+00:00Added an answer on May 16, 2026 at 2:36 pm

    It’s all there:

    java.net.SocketException: Permission denied (maybe missing INTERNET permission)

    Check this page: http://developer.android.com/reference/android/Manifest.permission.html

    You need to add “android.permission.INTERNET” to your manifest.xml-file, the whole line should look this this <uses-permission android:name="android.permission.INTERNET" />.

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

Sidebar

Related Questions

I am new to SQL Server 2008, and I need some help in query
I need help displaying this image which I'm pulling from a JSON server. JSON
I need help in writing queries which will update MySql tables from SQL server.
this is probably trivial but I need help in making my server listen on
I need help from the Regex wizards out there. I am trying to write
I need help on this. I got this error while inserting/updating a number of
I need help with how to write a SQL Server 2005 query to handle
I need connect to server git. http://help.github.com/win-set-up-git/ I do everything to the point, 4
Need help writing a script downloads data from google insight using c# this is
I need help with downloading from webserver... What i currently do is get XML

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.