• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

My app working on Wifi but not on mobile data

Hello,
I am an android developer. My app/ server details are:
App:
Gradle:
minSdkVersion=17
targetSdkVersion=26
Using 'com.loopj.android:android-async-http:1.4.9', and json.
Manifest:
<uses-permission android:name="android.permission.INTERNET" />

Server: Java Spring MVC.
Problem: when I invoke any API using wifi connection, it works fine. But when I invoke using mobile data, the HTTP connection timer expires. In fact, packets are lost between my app client and Spring MVC server.
I tried 8080 port, and 80 port. Also, I reconfigured the APN from getting network config message from my telecom provider Idea Cellular, Delhi.
 
Someone else was having app development server problems with a carrier in India. App can connect to server on WiFi but not cellular. Their carrier is JIO, and problem was to do with a proxy that the carrier uses apparently. Maybe Idea Cellular is doing the same thing as JIO?
https://androidforums.com/threads/my-app-working-on-wifi-but-not-on-mobile-data.1241527/
Apparently it's fixed by using a VPN service. Other than that, don't know.
 
Last edited:
Someone else was having app development server problems with a carrier in India. App can connect to server on WiFi but not cellular. Their carrier is JIO, and problem was to do with a proxy that the carrier uses apparently. Maybe Idea Cellular is doing the same thing as JIO?
https://androidforums.com/threads/my-app-working-on-wifi-but-not-on-mobile-data.1241527/
Apparently it's fixed by using a VPN service. Other than that, don't know.
What was the configuration for RJIO network?
 
Just to add: The packets are not dispatched to the mobile network, "TCP Connection Error: Connection refused" is what I am getting.
My assumption is that the HTTP:Header:Host IP address is supposed to be used as Destination IP address. But for my app these values do not match. However, if I use the Chrome browser or any other HTTP client utility on my phone, these UP addresses are exactly same, and I get expected response as JSON object.
 
Finally I was able to locate the bug. Its in the loopj library. I changed the library to okhttp3.OkHttpClient and it is working fine. Thanks Mikedt for enlighten me about various dimensions of the problem.
 
Back
Top Bottom