Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8680781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:20:16+00:00 2026-06-12T21:20:16+00:00

I wish to detect if a user has enabled both background data (settings->accounts and

  • 0

I wish to detect if a user has enabled both background data (settings->accounts and sync->background data) and packet data (settings->wireless and network->mobile networks->use packet data) so I can inform the user how to enable them.

This link says how to test the background data but it has been deprecated. The recommendation says to use getActiveNetworkInfo() but this might return the WIFI connection and therefore not display if background data is enabled or not.

I have not found any links on how to detect if packet data is enabled or not.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T21:20:17+00:00Added an answer on June 12, 2026 at 9:20 pm

    I had this exact same question and I had to start a bounty to get the answer. Cost me a third of my reputation, but well worth it.

    boolean mobileDataEnabled = false; // Assume disabled
            ConnectivityManager cm1 = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
            try {
                Class cmClass = Class.forName(cm1.getClass().getName());
                Method method = cmClass.getDeclaredMethod("getMobileDataEnabled");
                method.setAccessible(true); // Make the method callable
                // get the setting for "mobile data"
                mobileDataEnabled = (Boolean)method.invoke(cm1);
            } catch (Exception e) {
                // Some problem accessible private API
                // TODO do whatever error handling you want here
            }
    

    As I say, I cant claim credit for know this, my question was answered by https://stackoverflow.com/users/769265/david-wasser

    but it cost me, so if you want to accept this as an answer I can start to get me some of my reputation points back! 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wish fetch data in a XML file, where Tag is a variable.. My
I wish to capture data from http://www.kitco.com/texten/texten.html : <html> <head> <title>Text Only Market Page</title>
I am writing a mobile detect script to use across multiple projects and I
I have a web application which I wish to configure via settings in an
I wish to achieve content load when the user scrolls to the bottom of
I wish to detect the call state after my app resumes the active state
I have a PageControl on my form and i wish to detect when the
I wish to detect adblocking software on my website and ask users to disable
Using Java, is it possible to detect user actions, such as key-presses, mouse-button-presses, and/or
I need to develop a process that will detect if the users computer has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.