1. Download our Official Android App: Forums for Android!

Apps Cannot download pdf file from my app via mobile data

Discussion in 'Android Development' started by Aparna Ghate, Jun 13, 2016.

  1. Aparna Ghate

    Aparna Ghate Lurker
    Thread Starter
    Rank:
    None
    Points:
    6
    Posts:
    1
    Joined:
    Jun 13, 2016

    Jun 13, 2016
    1
    1
    6
    Female
    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
     

    Advertisement

    vdraq likes this.
  2. Thom

    Thom  
    VIP Member
    Rank:
     #24
    Points:
    1,318
    Posts:
    11,896
    Joined:
    Feb 16, 2011

    Feb 16, 2011
    11,896
    4,907
    1,318
    Male
    Software Developer
    Keene, NH USA
    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
     
    vdraq likes this.
  3. HeavensSentSword

    HeavensSentSword Well-Known Member
    Rank:
    None
    Points:
    93
    Posts:
    134
    Joined:
    Jan 19, 2016

    Jan 19, 2016
    134
    36
    93
    Male
    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

    Code (Java):
    1. private static final String DEBUG_TAG = "NetworkStatusExample";
    2. ...    
    3. ConnectivityManager connMgr = (ConnectivityManager)
    4.         getSystemService(Context.CONNECTIVITY_SERVICE);
    5. NetworkInfo networkInfo = connMgr.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
    6. boolean isWifiConn = networkInfo.isConnected();
    7. networkInfo = connMgr.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
    8. boolean isMobileConn = networkInfo.isConnected();
    9. Log.d(DEBUG_TAG, "Wifi connected: " + isWifiConn);
    10. Log.d(DEBUG_TAG, "Mobile connected: " + isMobileConn);
     
    vdraq likes this.

Share This Page

Loading...