robertzagorski / networkstats Goto Github PK
View Code? Open in Web Editor NEWA sample comparison app between TrafficStats and NetworkStatsHelper for Android
A sample comparison app between TrafficStats and NetworkStatsHelper for Android
Hi Robert, thanks for sharing this experimental app. We've noticed that both numbers for Rx and Tx for NetworkStatsManager are equal and remains the same. Not sure how to operate the app.
Thanks,
Martins
Hello,
Could you explain the prams that are displayed on screen per app. I see that for all the apps the Network Stats are similar.
Also when I compare the Data usage from Settings vs on app what needs to be considered ?
I can see you used getSubscriberId(context, ConnectivityManager.TYPE_MOBILE)
for fetching out Mobile Data but for dual sim phones how can I categorise or differentiate that which SubscriberId is being used ? Is it for Sim 1 or Sim 2 !!
Hi,
By using trafficstats API, is there any way to differentiate mobile data usage for sim 1 & sim 2 programmtaically?
to know the bytes transferred using queryDetailsForUid, the start time mentioned with 0 and end time is system.currentTimeMillis().
How to get the recent data in bytes (i read in the closed issues where you mentioned bucket will take every 30 minutes info)
this is my code and when i get the start and end time stamp of bucket it's just last two hours.
how i get the bucket:
networkStats = networkStatsManager.queryDetailsForUid( ConnectivityManager.TYPE_WIFI, "", 0, System.currentTimeMillis(), packageUid); NetworkStats.Bucket bucket = new NetworkStats.Bucket(); networkStats.getNextBucket(bucket); return bucket;
and the bucket's stats:
D/since: 27 July 2017 - 20:30:00 D/until: 27 July 2017 - 22:30:00 E/stat: Slack down = 55.93 KB = 57270 up = 23.53 KB = 24093
when i get stats for all packages which has internet permission i get this error many times!
Uncaught exception thrown by finalizer
and
java.lang.IllegalStateException: Binder has been finalized!
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:503)
at android.net.INetworkStatsSession$Stub$Proxy.close(INetworkStatsSession.java:463)
at android.app.usage.NetworkStats.close(NetworkStats.java:297)
at android.app.usage.NetworkStats.finalize(NetworkStats.java:110)
at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:217)
at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:200)
at java.lang.Thread.run(Thread.java:818)
Robert,
First of all, thank you so much for putting this project together. It has been immensely helpful as I work on my own app on Google Play, NetLive.
My question: I am seeing that the NetworkStatsManager for a given uid
has much less frequent updates than provided by TrafficStats
. Is this the case in your experience as well? Is there a way to have NetWorkStatsManager return updated values faster?
Thank you for your help.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.