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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:22:37+00:00 2026-05-22T02:22:37+00:00

I have set my proxy settings in emulator and I can access normal internet

  • 0

I have set my proxy settings in emulator and I can access normal internet on emulator’s browser. But when I try to run my application, it gives error
But when I change my URL to services running inside my organisation I can fetch data!!!

What is the issue here and how could I connect to URLs outside my org through my app???

Thanks
Abhinav Tyagi

ERROR:

05-11 17:12:28.867:
WARN/System.err(847):
java.io.FileNotFoundException:
http://google.co.in 05-11
17:12:28.917: WARN/System.err(847):
at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:1162)
05-11 17:12:28.917:
WARN/System.err(847): at
com.xml.xml_test.getXML(xml_test.java:65)
05-11 17:12:28.928:
WARN/System.err(847): at
java.lang.reflect.Method.invokeNative(Native
Method) 05-11 17:12:28.939:
WARN/System.err(847): at
java.lang.reflect.Method.invoke(Method.java:521)
05-11 17:12:28.957:
WARN/System.err(847): at
android.view.View$1.onClick(View.java:2067)
05-11 17:12:28.957:
WARN/System.err(847): at
android.view.View.performClick(View.java:2408)
05-11 17:12:28.968:
WARN/System.err(847): at
android.view.View$PerformClick.run(View.java:8816)
05-11 17:12:28.968:
WARN/System.err(847): at
android.os.Handler.handleCallback(Handler.java:587)
05-11 17:12:28.989:
WARN/System.err(847): at
android.os.Handler.dispatchMessage(Handler.java:92)
05-11 17:12:28.989:
WARN/System.err(847): at
android.os.Looper.loop(Looper.java:123)
05-11 17:12:29.007:
WARN/System.err(847): at
android.app.ActivityThread.main(ActivityThread.java:4627)
05-11 17:12:29.007:
WARN/System.err(847): at
java.lang.reflect.Method.invokeNative(Native
Method) 05-11 17:12:29.007:
WARN/System.err(847): at
java.lang.reflect.Method.invoke(Method.java:521)
05-11 17:12:29.007:
WARN/System.err(847): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-11 17:12:29.007:
WARN/System.err(847): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
05-11 17:12:29.037:
WARN/System.err(847): at
dalvik.system.NativeStart.main(Native
Method)

here is my code:

         StringBuffer b = new StringBuffer();
         System.out.println("try");
         String registrationUrl = "http://google.com";
         url = new URL(registrationUrl);  
         System.out.println("url");
         URLConnection connection = url.openConnection(); 
         System.out.println("open connection");
         conn = (HttpURLConnection) connection;         
         int responseCode = conn.getResponseCode();  
         System.out.println(responseCode);
         is = conn.getInputStream();
         long len = 0;
         int ch = 0;
         len = conn.getContentLength();
         if (len != -1) {
             // Read exactly Content-Length bytes
             System.out.println("IF...");
             for (int i = 0; i < len; i++) {
                 System.out.println("For Loop...");
                 if ((ch = is.read()) != -1) {
                     System.out.println("Appending");
                     b.append((char) ch);
                 }
             }
         } else {
             // Read till the connection is closed.
             System.out.println("Else...");
             while ((ch = is.read()) != -1) {
                 System.out.println("When...");
                 len = is.available();
                 System.out.println("append");
                 b.append((char) ch);
             }
         }


         String data = b.toString();
         AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setMessage(data).setCancelable(false).setPositiveButton("OK", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int id) {
                xml_test.this.getParent();
            }
        });
  • 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-22T02:22:37+00:00Added an answer on May 22, 2026 at 2:22 am

    I dont have much time to go through what you actually need but if you wanna apply proxy to your application check the following examples..

    http://www.jguru.com/faq/view.jsp?EID=13186

    http://www.rgagnon.com/javadetails/java-0085.html

    http://www.java2s.com/Code/Java/Network-Protocol/URLconnectionandproxy.htm

    they’re pretty much the same. sorry.. and good luck 🙂

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

Sidebar

Related Questions

Is there a way of getting internet connection settings (proxy information) being used by
I have some proxy settings that I only occasionally want to turn on, so
I have Fiddler2 listening on 0.0.0.0:8888. try: data = '' proxy = urllib2.ProxyHandler({'http': '127.0.0.1:8888'})
I've set up Nginx as my main web server and have two Mochiweb based
I have 2 questions for you. Im creating an Application for Chat that relies
I have a simple form interface set up that send username and password information
I have a lot of trouble with the internet connectivity in the program I
I have installed Visual Studio .NET 2005. But when I am trying to execute
it seems that HtmlUnit uses it's own centralized ProxyConfig object to set up proxy
I am developing an application to run on the client PC (Win) which is

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.