loopj

How to return response to calling function? (Android-App calling Java REST-Server via JSON)

余生长醉 提交于 2019-12-11 18:22:21
问题 I'm rewriting some pieces of an Android App to call a REST-Server I've written in Java, using the Spring-Boot Framework. To summarize, let's say in the app, function A calls a function B in my MainController (which is supposed to manage the Client-Server Communication). Function B calls (with a few extra steps) calls my Server. When function B makes the call, it uses an anonymous inner class overriding a method to define how to handle the response. I struggle to get that response from the

Bad Request when trying to connect to ISS 7 Express from android emulator

最后都变了- 提交于 2019-12-11 06:29:56
问题 In my IIS i have created Web Api and it's Project Url is http://localhost:54444. I am albe to connect to this Url from my browser in Windows8, however I am not able to do so in my android emulator browser via http://10.0.2.2:54444 . My android browser is able to connect to google.com. I am also trying to make an client in Eclipse using http://loopj.com/android-async-http/ library: Log.v("bopzy_debug", "Testing HTTP Connectivity"); System.out.println("123"); AsyncHttpClient client = new

Trying to display url in Web View

青春壹個敷衍的年華 提交于 2019-12-11 03:17:57
问题 I am experimenting with the loopj package. I am trying to make a HTTP request to a website and display the website in the webview. I am successfully getting a result back, however the web view does not display the page as desired, instead chrome opens up and displays the page. Am I missing something or is there a way I can override this unwanted behaviour? Below is my oncreate method where I am making the request: public class MainActivity extends Activity { Button connectBtn; TextView status

Make a call synchronously with loopj Android Asynchronous Http Client

自作多情 提交于 2019-12-10 13:47:29
问题 I'm trying to use setUseSynchronousMode on loopj to wait for results of http call before continuing in one case. I tried: AsyncHttpResponseHandler responseHandler = new AsyncHttpResponseHandler() { @Override public void onSuccess(int statusCode, Header[] headers, byte[] response) { Log.d("TEST", "Got results"); } }; AsyncHttpClient client = new AsyncHttpClient(); responseHandler.setUseSynchronousMode(true); client.get("http://www.google.com", responseHandler); Log.d("TEST", "Don't want to get

Loopj Android Async Http - onFailure not fired

ε祈祈猫儿з 提交于 2019-12-09 11:29:58
问题 I am using the great async http library from loopj, but I have run into a small snag. If the user has no internet connection or loses their connection, the app just won't return anything. This part is expected, but it also doesn't fire the onFailure method. Also, the code I have used when there is an internet connection does work so there is no problem on the server end. Here is some code that is stripped down to the minimum. It also doesn't work (I have tested this too) String url =

SSL Pinning with loopj in Android

半世苍凉 提交于 2019-12-09 06:38:09
问题 I want to use my self-signed certificate in my Android app, instead of relying on Certificate Authorities. I've found this link (thoughcrime.org) with the reasons to do so, and some examples, but couldn't adapt it to my loopj scenario (I get no answer from server, see below). Then I've come to these other links (sproutsocial and Antoine's blog) that address the same problem, including loopj and volley snippets. Finally I used the code below: private static SSLSocketFactory getSSLSocketFactory

Getting SocketTimeoutExceptions using loopj AsyncHttpClient… is there a timeout value I can set?

◇◆丶佛笑我妖孽 提交于 2019-12-04 10:11:42
问题 When using the loopj AsyncHttpClient library, I keep getting java.net.SocketTimeoutExceptions when making requests (see below). Is there some timeout value I can set? Note : I'm posting this to hopefully provide some help for other people. I (stupidly) struggled to find the solution for some time. Stack trace: java.net.SocketTimeoutException at java.net.PlainSocketImpl.read(PlainSocketImpl.java:491) at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46) at java.net.PlainSocketImpl

Loopj messing special characters before sending them through a request

做~自己de王妃 提交于 2019-12-04 02:35:33
问题 I'm trying to send special characters through an http request, now I'm using Loopj as my http client. The problem is that when I try to send special characters i.e. "áéíóú" the request goes out with the characters "·ÈÌÛ˙", this is causing some issues on the server sider. I've gone through the Loopj code and couldn't find anything relative to recoding my string or anything like it. In the worst case it seems like it would be encoded in UTF-8 which actually supports this characters. Hope anyone

Loopj Android Async Http - onFailure not fired

[亡魂溺海] 提交于 2019-12-03 13:13:07
I am using the great async http library from loopj, but I have run into a small snag. If the user has no internet connection or loses their connection, the app just won't return anything. This part is expected, but it also doesn't fire the onFailure method. Also, the code I have used when there is an internet connection does work so there is no problem on the server end. Here is some code that is stripped down to the minimum. It also doesn't work (I have tested this too) String url = getString(R.string.baseurl) + "/appconnect.php"; client.getHttpClient().getParams().setParameter(ClientPNames

Android loopj Async Http crashes after 1.4.5 update

安稳与你 提交于 2019-12-02 22:53:12
The new update for Android loopj Async Http lib is out and they changed a lot. Now you need to manually set Looper.prepare() otherwise it uses synchronious mode instead of async by default. I don't get where I need to set it. Logcat 07-09 08:16:18.775: W/AsyncHttpResponseHandler(6606): Current thread has not called Looper.prepare(). Forcing synchronous mode. After that message it totally crashes 07-09 08:16:18.835: E/AndroidRuntime(6606): FATAL EXCEPTION: AsyncTask #1 07-09 08:16:18.835: E/AndroidRuntime(6606): java.lang.RuntimeException: An error occured while executing doInBackground() 07-09