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 7427943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:39:56+00:00 2026-05-29T08:39:56+00:00

Using Android TelephonyManager an application can obtain the state of data activity over the

  • 0

Using Android TelephonyManager an application can obtain the state of data activity over the cellular network. For example, activity is coming in, going out, or both. I am wondering if anyone knows of a way to obtain the same information for when the device is connected using Wifi? In Ice Cream Sandwich (4.0.3, I think) they have this information available for both Wifi and Telephone, but prior to that it is only for the phone (WifiManager wasn’t updated with this information until the Ice Cream Sandwich release).

Basically, I want to be able to check if data is actively being transferred by the phone/tablet when connected to a Wifi network (not just that the Wifi is connected). This data does not have to be initiated by me; I just want to know if data is actively moving.

Does anyone have any ideas how this can be achieved? I am fairly new to Android and would like this information to make sure my application doesn’t do anything bad. Thanks in advance for any thoughts.

  • 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-05-29T08:39:57+00:00Added an answer on May 29, 2026 at 8:39 am

    I too have been looking for this and I haven’t got a perfect answer, but you can get some sort of approximate data using the TrafficStats API.

    I have a piece of code which is fired off occasionally by a timer and a couple of class variables called totalDownload and totalUpload…

    long newTotalDownload = TrafficStats.getTotalTxBytes();
    long newTotalUpload = TrafficStats.getTotalRxBytes();
    
    long incDownload = newTotalDownload - totalDownload;
    long incUpload = newTotalUpload - totalUpload;
    
    if (incUpload > 0)
    {
        //data was being uploaded in the last time period
    }
    if (incDownload > 0)
    {
        //data was being downloaded in the last time period
    }
    //set up for the next iteration
    totalDownload = newTotalDownload;
    totalUpload = newTotalUpload;
    

    it works, though I would like a better answer if you find one.

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

Sidebar

Related Questions

i am using android:imeOptions=actionSearch in editText and my question is can i write my
I am using the Android Emulator to debug my application, first off it is
i am using following code in android to get IMEI number of phone TelephonyManager
I'm developing an Android application using Android 1.5. I'm using an older version of
I'm using Android, and I have a strange question: how can I parse JSON
I'm using android:shadowDx and android:shadowDy .. for a text and they work fine, can
I've been using Android for only a little while. In my application, I have
I'm using android-cmake to compile an application for Android. This essentially creates a CMake
I am doing an android application. In my project I am checking phonestates using
Is it possible to detect SIM number using TelephonyManager in android at boot startup

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.