Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow invoking on Android client #11

Closed
blackspiritus opened this issue Apr 18, 2013 · 12 comments
Closed

Slow invoking on Android client #11

blackspiritus opened this issue Apr 18, 2013 · 12 comments

Comments

@blackspiritus
Copy link

Hi,

I am using your library for an Android app. When I get data on my Android app from my SignalR server invoked from a C# form, the data comes almost instantly. But when I send data from my Android client to my SignalR server, it takes a while before the server gets the data. Now I can't seem to find any solution for it. Do you know any solution? I have also a website that can communicate with the server and this works perfectly.

Regards,
Gillan

@erizet
Copy link
Owner

erizet commented Apr 18, 2013

Hi, I'm sorry but I don't know why invoking the server is slow. Try to use fiddler to analyze the traffic. Look for a Send message from your Android app.

Btw, I'm curious, what kind of app have you developed? Is it published?

@blackspiritus
Copy link
Author

I'll try analyzing the traffic. It's an app to communicate with a machine, which has code written in C++, the code sends data to a C# form and the C# form uses signalR to send the button states to the client and vice versa. it's not published yet because it is in an early development state, searching for the best method to do this.

@erizet
Copy link
Owner

erizet commented Apr 18, 2013

I have the same issue as you when running from a real device. :( It's working as expected in the emulator.

@blackspiritus
Copy link
Author

I only tried it on a real device. But I'm relieved it has nothing to do with the app itself.

@robfe
Copy link

robfe commented Jun 16, 2013

Erizet, What version of the SDK is your emulator running? If it's below honeycomb then try something higher.

I think i've solved this (if you're getting the same problem as me). This affects versions of the SDK above Honeycomb. In the basic http client's com.turbomanage.httpclient.android.DoHttpRequestTask, put a breakpoint on execute and doInBackground. When the "send" url is used, I get the execute being called but not the doInBackground.

I tried the fix from http://stackoverflow.com/a/11977186/21433 (plenty of links to deeper discussions):

public void execute(HttpRequest httpRequest) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
        super.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, httpRequest);
    else
        super.execute(httpRequest);
}

And I get instant performance!

Note that I had to upgrade the basic http client to use a min SDK version of 11. There is already some discussion up at basic-http-client (https://code.google.com/p/basic-http-client/issues/detail?id=15) with some suggestions on workarounds for users of basic-http-client that doesn't involve editing the basic-http-client source code.

@erizet
Copy link
Owner

erizet commented Jun 16, 2013

Yes, you have solved it. :) The discussion over at basic-http-client is "my" discussion. :)
I have implemented a paralell version of basic-http-client. I'll commit the changes soon.

@erizet erizet closed this as completed Jun 16, 2013
@robfe
Copy link

robfe commented Jun 16, 2013

Have you pushed the changes up yet? (I thought that if you'd closed the issue, you would have already)

@erizet
Copy link
Owner

erizet commented Jun 17, 2013

My bad! I forgot it. I'll do it tonight.

@erizet erizet reopened this Jun 17, 2013
@erizet
Copy link
Owner

erizet commented Jun 18, 2013

Look at the para branch!

@erizet
Copy link
Owner

erizet commented Jun 27, 2013

Included in the new release..

@erizet erizet closed this as completed Jun 27, 2013
@inventde
Copy link

inventde commented Jul 7, 2015

erizet i love this library and it works perfect for my project, but the only issue i'm having is that my application crashes when i'm offline. how can i resolve this issue?

@erizet
Copy link
Owner

erizet commented Jul 7, 2015

First of all, please open a new issue. Then if possible include a stacktrace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants