I already tried to use TrafficStats but it s not the answer of my problem, cause it only gets total data since device reboot, but in my project i must continue to keep data usage even before reboot, i also consider that to write total data in a file regularly (ex. to get total usage in every our and keeping it up-dated so that i can compare it with the last result of getTotalRxBytes(), if it s higher than from the files that means device didnt reboot. else means device rebooted. which means i can get total byte value from the file i wrote before. But in this case i can not seperate data usage daily or weekly.
Ps: We can't get higher level of 5.0 cause our device is only useable for 5.0 max.Thats why i cant use Network Stats Manager library.
Thanks.