1

I am using the Async Http library from loopj.com and also the sample code from the site.

The problem is that when the request is made I don't get a response. I have even overridden the onFinish() function which isn't getting fire either.

I am using the sample code from their site which is as follows:

import com.loopj.android.http.AsyncHttpClient;
import com.loopj.android.http.AsyncHttpResponseHandler;

    Log.v("bopzy_debug", "Testing HTTP Connectivity");
    System.out.println("123");
    AsyncHttpClient client = new AsyncHttpClient();

    client.get("http://www.google.com",
            new AsyncHttpResponseHandler() {
                @Override
                public void onSuccess(String response) {
                    Log.v("bopzy_debug", response);
                }
                @Override
                public void onFinish() {
                    Log.v("bopzy_debug", "Finished..");
                }
            });

Any ideas on how to solve would be greatly appreciated, not really sure what is going on here.

4
  • 1
    Do you have internet permissions in your Manifest? Commented Sep 10, 2012 at 15:41
  • Nope. Thank you! Coming back from iOS so i'm only getting used to the Manifest again.. still feel rather stupid though. Post as an answer and i'll accept for you :) Commented Sep 10, 2012 at 15:49
  • Are you having trouble with POST/PUT requests? Commented Jun 18, 2013 at 13:49
  • I'm having trouble with PUT/DELETE requests Commented Jun 27, 2013 at 20:05

1 Answer 1

5

You need to add <uses-permission android:name="android.permission.INTERNET"/> to your AndroidManifest

Note: this needs to be added outside the <application> tag

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.