I am facing a rather weird problem with my android app. It is a very basic app which connects to a server and posts requests.
When the phone is switched on initially, and the app is started with only a 3G connection - the server connection times-out each and every time. The moment i connect to a wifi network it works. And to top it off - if i switch back to 3G after this , it works fine. I am very confused as to what is going on.
Do I need to turn on some parameter in order for the app to work without wifi and only 3G in the first try? Any insight would be appreciated :)
Related
Hello there long time reader of Stack Overflow but first time poster,
I am a bit new to android development but we decided to build a Xamarin.Forms app which consumes our ASP.NET REST service. When running the app on an emulator on my computer, connected via ethernet, I am able to connect to the service. However, when running on a tablet or phone that is connected on our work wifi, the connection just hangs and times out.
Interesting enough, when the device is switched to mobile data it can connect to the endpoints again, and iPhones can connect to the endpoints on mobile data or wifi.
I'm curious what I'm missing here. Please let me know what you think or additional information I should include.
While this thread has been opened for some time, we have found our problem resolved: it was a mixture of our network support changing some settings on our routers (though I can unfortunately not remember what settings) and also our tablets do a system update.
I am not sure which of these factors was the cause of our success now but the issue is done. I just wanted to post this in case anyone else ran into something similar.
I am working on an Ionic 2 application. My use case is quite simple, I display a page, and I use the angular2's Http service to retrieve a string on a remote API, and I display this string on my page. Every seconds, I did the same "GET" request, and I display this string.
If I start my application with WiFi activated and connected to a network, every things works fine. Then when I disable WiFi, I except my HTTP Packets to be sent through mobile network, but my HTTP request never get out of my phone (I check in my backends logs, and I can't see any trace of them).
Of course, this problem doesn't occurs with my development phone (on Android 5.x), but only on my customer's phone (on Android 4.4)... I guess that the old android version can't switch the network interface of an already opened TCP connection.
Does some one have already experienced this kind of problem ? And is there some solutions I can develop in my app ?
I have a simple async client application for android that connects to a server on my desktop. Now over wifi the application works fine(unless the client network is super slow). But when I try to use it over the mobile network it randomly disconnects with the classic "connection reset by peer" error. I think the highest chance of it happening is connecting and then leaving it for a few seconds to do nothing over the connection. But the thing is sometimes it "survives" and happens later on, and maybe one in a hundred times doesn't disconnect at all. It makes no sense and there are a lot of applications on the appstore that work fine across mobile network so it can't be that hard...
EDIT: This also happens if i just put my phone on a table, great signal, no movement, or anything that would distrubt the connection.
This is not because of mobile's movement. You should check your setting in mobile network and keep only one setting 3g or 4g. Don't put this on "Both" connections.
Hope this will help.
Hi everyone I have a question for you. I have a project that is using xamarin forms and in this project we are using the signalr client. Whenever I switch from Wi-Fi to cellular data my signal are times out. However the weird thing is that no statechanged events ever fire on a client side not even the disconnect, and I can still send messages with the proxy to other clients but it doesn't receive messages from the other clients. I had a question last week where servicestack was timing out when I switched from Wi-Fi to mobile and the solution was to put a connection header in the request that was set to close. I tried that with the signalr connection but it doesn't work. I've also tried to use the project modernhttpclient and that doesn't work either. On the server side I've even tried saying the keepalive to know so that way it only uses the connection timeout and the disconnect timeout.
Some other weird information about this problem is that it doesn't happen on all Android devices. It seems to work on the Samsung and a different Android device possibly a Nexus device. The reason I know this is that my coworkers have these phones and it works perfectly fine for them. However my device, which is a samsung galaxy s6 edge comma does not work with the code that was implemented for reconnecting when did not work changes
I have and Android device to connect to a BLE Device. If I restart the android device it connects straight away and works fine. After If I close the app and start again, It will connect but never get any characteristic change notification.
When I close the app and start again it mostly works.
And if I go to Bluetooth settings and turn off the Bluetooth and turn it on back, In this case as well the application connects directly and works fine.
I close and clean all related resources properly and exit properly, and I don't see the app in DDMS as well.
But it seems even then the at driver level, it is still connected and BLE device still sending data.
Thanks
when reconnecting a remote device the connection remains inside of onClientRegistered() method and it takes a lot of time to reconnect or does not finish to establish the connection, I think is probably an android issue. Regards
It has been a long time and this was a bit frustrating. The problem is because of the Notifications.
The problem can be on either/both ends that is Android or BLE Device.
But the rule is as the best thing I figured out is to make sure I disable all notifications before exiting the application. So, the driver level or BLE device doesn't keep hanging in the older connection...
One should do that not only for Android side but also disable on BLE device side using
protected static final UUID CHARACTERISTIC_UPDATE_NOTIFICATION_DESCRIPTOR_UUID = UUID.fromString("00002902-0000-1000-8000-00805f9b34fb");
This worked for me :)