HTTP request much slower on android than desktop

I have an ionic app which uses a service to fetch JSON from a nodejs backend and render it into views.
When viewing the app served on a desktop, the request resolves very quickly. Once I compile to an Android app and run it on a device, its much slower.

I’m using the full path and it eventually resolves, so i’m having a hard time pinpointing the issue. I’ve tried this both with full 4g connection and on wifi. I recently updated to the new version of Ionic but I’m not sure if the issue existed before then.

Anyone have ideas on how I can troubleshoot this, or have you seen it before?

I can definitely post code samples if helpful

Hi @dupe - did you ever get a solution to this. I’m tearing my hair out on this one. My app was working great but now $http requests are taking a loooooong time on Android. Here’s my set up:

Cordova CLI: 5.1.1
Gulp version:  CLI version 3.8.11
Gulp local:   Local version 3.8.11
Ionic Version: 1.0.0
Ionic CLI Version: 1.6.1
Ionic App Lib Version: 0.3.3
ios-deploy version: 1.5.0 
ios-sim version: 3.1.1 
OS: Mac OS X Yosemite
Node Version: v0.12.2
Xcode version: Xcode 6.4 Build version 6E35b 

I have the following plugins installed:

com.unarin.cordova.beacon 3.3.0 "Proximity Beacon Plugin"
cordova-plugin-android-support-v4 21.0.1 "Android Support v4"
cordova-plugin-console 1.0.1 "Console"
cordova-plugin-crosswalk-webview 1.2.0 "Crosswalk WebView Engine"
cordova-plugin-device 1.0.1 "Device"
cordova-plugin-dialogs 1.1.1 "Notification"
cordova-plugin-geolocation 1.0.1 "Geolocation"
cordova-plugin-inappbrowser 1.0.1 "InAppBrowser"
cordova-plugin-network-information 1.0.1 "Network Information"
cordova-plugin-splashscreen 2.1.0 "Splashscreen"
cordova-plugin-statusbar 1.0.1 "StatusBar"
cordova-plugin-whitelist 1.0.0 "Whitelist"
phonegap-plugin-barcodescanner 4.0.1 "BarcodeScanner"

My config.xml has the following snippet in it (for the whitelist plugin):

<allow-navigation href="http://*/*"/>
<allow-navigation href="https://*/*"/>
<access origin="*"/>
<allow-intent href="http://*/*"/>
<allow-intent href="https://*/*"/>
<allow-intent href="tel:*"/>
<allow-intent href="sms:*"/>
<allow-intent href="mailto:*"/>
<allow-intent href="geo:*"/>
<platform name="android">
  <allow-intent href="market:*"/>
</platform>
<platform name="ios">
  <allow-intent href="itms:*"/>
  <allow-intent href="itms-apps:*"/>
</platform>  <allow-navigation href="http://*/*"/>
<allow-navigation href="https://*/*"/>
<access origin="*"/>
<allow-intent href="http://*/*"/>
<allow-intent href="https://*/*"/>
<allow-intent href="tel:*"/>
<allow-intent href="sms:*"/>
<allow-intent href="mailto:*"/>
<allow-intent href="geo:*"/>
<platform name="android">
  <allow-intent href="market:*"/>
</platform>
<platform name="ios">
  <allow-intent href="itms:*"/>
  <allow-intent href="itms-apps:*"/>
</platform>

My index.html has the following meta tag an attempt to avoid conflicts:

<meta http-equiv="Content-Security-Policy" content="default-src *; frame-src * 'self' 'unsafe-inline'; style-src * 'self' 'unsafe-inline'; script-src * 'self' 'unsafe-inline' 'unsafe-eval'">

I’m testing the app on a Nexus 5 and it’s connected to the wifi. I use the $cordovaNetwork plugin to print the status to the console to confirm that’s the case. I can use other apps on the device without any problem
so I’m very confident it’s not a connection issue. This is reinforced by the fact that the requests do return what they’re supposed to (“success” is received) it just takes a long time!

I read something about the default authentication of $http requests causing problems but couldn’t make any changes that helped.

Any ideas what could be going on?

Same problem here…

hi, I have the same problem ! :confused: did anyone find a solution ?! thnx