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

Apps Cannot download pdf file from my app via mobile data

Hello, I am new to Android programming.I have a very simple basic application where i can download some pdf files and provide information to my clients. Now currently the pdf files gets downloaded if my mobile has wifi on but if it is on mobile data then the pdf files do not get downloaded. please help me with why this could be happening

Any help appreciated as I have to get this out soon

Regards
 
Welcome to Android Forums.

This thread was moved to this forum where development subjects are discussed.

Can you show the code that you are using?

... Thom
 
Try this a see what happens,
This will tell if you are connected via wifi and mobile data. So see if you mobile data is even doing anything

Java:
private static final String DEBUG_TAG = "NetworkStatusExample";
...     
ConnectivityManager connMgr = (ConnectivityManager)
        getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connMgr.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
boolean isWifiConn = networkInfo.isConnected();
networkInfo = connMgr.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
boolean isMobileConn = networkInfo.isConnected();
Log.d(DEBUG_TAG, "Wifi connected: " + isWifiConn);
Log.d(DEBUG_TAG, "Mobile connected: " + isMobileConn);
 
Back
Top Bottom