Questions tagged [android-trafficstats]

27 questions
1
vote
0 answers

TrafficStats : concerning Tx and Rx data consumption (getUidRx/TxBytes)

time for me to appear ^^ Well, I'm kinda new into programming, but I grow fast ^^ I hope, I won't give you a headache with my English '-' So I'm here to talk about the "TrafficStats" function, and specially about Rx. In fact, actually I'm developing…
A. Icleanu
  • 45
  • 1
  • 10
1
vote
0 answers

Android code, How do i measure the data usage of an App on mobile data

I want to measure the data consumed by my APP through mobile data[not Wifi] on each session launch. The amount of data consumed on each session = amount of data consumed [at the end of session] - amount of data consumed [at the start of…
sri
  • 31
  • 2
1
vote
0 answers

Network state change listener

I need to listen to change (connect/disconnect) of a network (mobile data in particular). I know the method using broadcast receiver and ConnectivityManager to know the type of connection. But, in a broadcast receiver, an intent is received after…
1
vote
1 answer

network connection speed using TrafficStats

I am working on an android app that uses internet connectivity to work.I want to monitor the network speed using an indicator which will be red for poor connection, yellow for fair and green for good strength, and show it on the status bar so that…
the_unknown_spirit
  • 2,518
  • 7
  • 34
  • 56
0
votes
0 answers

How to find the data usage of system software update in android?

In my application i want to show the data usage of software update. When the user's device update is available and user download and install the device update over the wifi or mobile data. Is there any way to calculate the data usage of system…
0
votes
1 answer

I'm trying to get а real traffic stats data. But, When i count `TrafficStats.getMobileTxBytes()` for whole day its more than my data pack?

eg. I have a 1.5 GB data pack. It gives the total sum of 2.0 GB or more than that . any idea about how to get correct speed every second.
Saurabh Dhage
  • 1,478
  • 5
  • 17
  • 31
0
votes
1 answer

TrafficStats API's getMobileRxBytes() and getMobileTxBytes() not working properly

The issue is known: when wifi is up, TrafficStats.getMobileRxBytes() and getMobileTxBytes() return 0 since Lollipop (https://issuetracker.google.com/issues/37009612). I found a workaround ignoring zero values, except that on some devices (e.g…
Paul Ouch
  • 21
  • 2
0
votes
1 answer

TrafficStats.getUidRxBytes return -1

I try get the total Tx and Tr Bytes per installed apps, but always returns -1, except in my app. This is my code: val pm = context.packageManager val apps = HashMap() for( app in pm.getInstalledApplications(0) ) { …
Pablo DbSys
  • 532
  • 1
  • 7
  • 17
0
votes
1 answer

How to get Overall (not application specific)data usage from particular time period?

I am working on a wifi data usage research and want to develop a program like,When user click on a button the device is already connected to wifi will start computing data usage and on same button click it will stop computing data usage and give me…
0
votes
0 answers

Calculate data usage UDP in Android

How to calculate data usage only in UDP in Android devices? I use TrafficStats.getTotalRxBytes() to get TCP but I need only UDP
0
votes
1 answer

How to monitor other apps network usage?

I use TrafficStats.getUidRxBytes to get network usage. It works fine for my app but for other apps always returns -1 (UNSUPPORTED). How can i get network usage for other apps without root permission?
0
votes
1 answer

Get data usage over some given period of time

I need to get the amount of data i.e. internet usage over periods of one month. I have been doing some research and found the TrafficStats class. However, it seems confusing. What is the difference between getUidRxBytes() and getUidRxPackets(). How…
Gerardo Soriano
  • 69
  • 1
  • 10
1
2