Android data usage history

Hello everyone.
I have some question for getting android data usage history programmatically.
I'm now writing an App for analyzing the data usage.
When app is installed , app have to retrieve the historic data usage information.
But I couldn't find any ways.
Once the app is installed, app can manage the data usage itself.
But I want to read the android device data usage history.
Is it possible? Please help me.
Best Regards
xiao mingmingAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

btanExec ConsultantCommented:
Good to check out the Android SDK and the main class you'll need is

You can use getUid{Rx|Tx}Bytes(int uid) for the given process user ID (which you can get from ActivityManager.getRunningAppProcesses()). Though I am not sure if it can run for all Android build OS but overall this has been the norm mean to quickly get some sensing to implement using the TraficStats API and track the number of bytes sent/received per UID (application). Key is that specific UID is assigned to each app (package) as an arbitrary but distinct OS user ID at each apps installation time. This make each app process runs under its own unique UID so that any apps signed with same certificate can share data, user ID, as well as run in a single process. Some info for on the details tying to the stat class

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
xiao mingmingAuthor Commented:
Thank you for your Answering.
It was helpful to me.
I like your answer.
Best Regards.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.