Fixed throughput calculation.
Added local download and upload images.
4
.idea/libraries/GraphView_3_1_2.xml
generated
|
|
@ -4,6 +4,8 @@
|
||||||
<root url="jar://$PROJECT_DIR$/app/libs/GraphView-3.1.2.jar!/" />
|
<root url="jar://$PROJECT_DIR$/app/libs/GraphView-3.1.2.jar!/" />
|
||||||
</CLASSES>
|
</CLASSES>
|
||||||
<JAVADOC />
|
<JAVADOC />
|
||||||
<SOURCES />
|
<SOURCES>
|
||||||
|
<root url="jar://$PROJECT_DIR$/app/libs/GraphView-master.zip!/GraphView-master/src/main/java" />
|
||||||
|
</SOURCES>
|
||||||
</library>
|
</library>
|
||||||
</component>
|
</component>
|
||||||
|
|
@ -129,10 +129,10 @@ public class UeControlExecutor implements Runnable, UeBehaviour.DataHandledListe
|
||||||
}
|
}
|
||||||
protected boolean setRealDataUsage(){
|
protected boolean setRealDataUsage(){
|
||||||
boolean ret = false;
|
boolean ret = false;
|
||||||
//long currentRxBytes = TrafficStats.getUidRxBytes(MainActivity.getUID());
|
long currentRxBytes = TrafficStats.getUidRxBytes(MainActivity.getUID());
|
||||||
//long currentTxBytes = TrafficStats.getUidTxBytes(MainActivity.getUID());
|
long currentTxBytes = TrafficStats.getUidTxBytes(MainActivity.getUID());
|
||||||
long currentRxBytes = TrafficStats.getTotalRxBytes();
|
//long currentRxBytes = TrafficStats.getTotalRxBytes();
|
||||||
long currentTxBytes = TrafficStats.getTotalTxBytes();
|
//long currentTxBytes = TrafficStats.getTotalTxBytes();
|
||||||
|
|
||||||
if (currentRxBytes != TrafficStats.UNSUPPORTED && currentTxBytes != TrafficStats.UNSUPPORTED
|
if (currentRxBytes != TrafficStats.UNSUPPORTED && currentTxBytes != TrafficStats.UNSUPPORTED
|
||||||
&& previousRxBytes != TrafficStats.UNSUPPORTED && previousTxBytes != TrafficStats.UNSUPPORTED){
|
&& previousRxBytes != TrafficStats.UNSUPPORTED && previousTxBytes != TrafficStats.UNSUPPORTED){
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ public class ThroughputCalculator {
|
||||||
long currentTimeStamp = System.nanoTime();
|
long currentTimeStamp = System.nanoTime();
|
||||||
data_amount += bytes;
|
data_amount += bytes;
|
||||||
if(currentTimeStamp - (NANOSEC_PER_SECOND/UPDATES_PER_SEC) > previousTimeStamp) {
|
if(currentTimeStamp - (NANOSEC_PER_SECOND/UPDATES_PER_SEC) > previousTimeStamp) {
|
||||||
throughput = data_amount / ((currentTimeStamp - previousTimeStamp) / (NANOSEC_PER_SECOND/UPDATES_PER_SEC));
|
throughput = data_amount / ((currentTimeStamp - previousTimeStamp) / NANOSEC_PER_SECOND);
|
||||||
previousTimeStamp = currentTimeStamp;
|
previousTimeStamp = currentTimeStamp;
|
||||||
data_amount = 0;
|
data_amount = 0;
|
||||||
updated = true;
|
updated = true;
|
||||||
|
|
|
||||||
BIN
app/src/main/res/drawable-hdpi/arrow_down_24.png
Normal file
|
After Width: | Height: | Size: 692 B |
BIN
app/src/main/res/drawable-hdpi/arrow_up_24.png
Normal file
|
After Width: | Height: | Size: 714 B |
30
app/src/main/res/drawable-hdpi/stat_download.xml
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
/* //device/apps/common/res/drawable/status_icon_background.xml
|
||||||
|
**
|
||||||
|
** Copyright 2008, The Android Open Source Project
|
||||||
|
**
|
||||||
|
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
** you may not use this file except in compliance with the License.
|
||||||
|
** You may obtain a copy of the License at
|
||||||
|
**
|
||||||
|
** http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
**
|
||||||
|
** Unless required by applicable law or agreed to in writing, software
|
||||||
|
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
** See the License for the specific language governing permissions and
|
||||||
|
** limitations under the License.
|
||||||
|
*/
|
||||||
|
-->
|
||||||
|
<animation-list
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:oneshot="false">
|
||||||
|
<item android:drawable="@drawable/stat_sys_download_anim0" android:duration="200" />
|
||||||
|
<item android:drawable="@drawable/stat_sys_download_anim1" android:duration="200" />
|
||||||
|
<item android:drawable="@drawable/stat_sys_download_anim2" android:duration="200" />
|
||||||
|
<item android:drawable="@drawable/stat_sys_download_anim3" android:duration="200" />
|
||||||
|
<item android:drawable="@drawable/stat_sys_download_anim4" android:duration="200" />
|
||||||
|
<item android:drawable="@drawable/stat_sys_download_anim5" android:duration="200" />
|
||||||
|
</animation-list>
|
||||||
|
|
||||||
18
app/src/main/res/drawable-hdpi/stat_download_static.xml
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Copyright (C) 2011 The Android Open Source Project
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:src="@drawable/stat_sys_download_anim0" />
|
||||||
BIN
app/src/main/res/drawable-hdpi/stat_sys_download_anim0.png
Normal file
|
After Width: | Height: | Size: 695 B |
BIN
app/src/main/res/drawable-hdpi/stat_sys_download_anim1.png
Normal file
|
After Width: | Height: | Size: 675 B |
BIN
app/src/main/res/drawable-hdpi/stat_sys_download_anim2.png
Normal file
|
After Width: | Height: | Size: 697 B |
BIN
app/src/main/res/drawable-hdpi/stat_sys_download_anim3.png
Normal file
|
After Width: | Height: | Size: 688 B |
BIN
app/src/main/res/drawable-hdpi/stat_sys_download_anim4.png
Normal file
|
After Width: | Height: | Size: 660 B |
BIN
app/src/main/res/drawable-hdpi/stat_sys_download_anim5.png
Normal file
|
After Width: | Height: | Size: 673 B |
BIN
app/src/main/res/drawable-hdpi/stat_sys_upload_anim0.png
Normal file
|
After Width: | Height: | Size: 690 B |
BIN
app/src/main/res/drawable-hdpi/stat_sys_upload_anim1.png
Normal file
|
After Width: | Height: | Size: 681 B |
BIN
app/src/main/res/drawable-hdpi/stat_sys_upload_anim2.png
Normal file
|
After Width: | Height: | Size: 634 B |
BIN
app/src/main/res/drawable-hdpi/stat_sys_upload_anim3.png
Normal file
|
After Width: | Height: | Size: 704 B |
BIN
app/src/main/res/drawable-hdpi/stat_sys_upload_anim4.png
Normal file
|
After Width: | Height: | Size: 697 B |
BIN
app/src/main/res/drawable-hdpi/stat_sys_upload_anim5.png
Normal file
|
After Width: | Height: | Size: 669 B |
30
app/src/main/res/drawable-hdpi/stat_upload.xml
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
/* //device/apps/common/res/drawable/status_icon_background.xml
|
||||||
|
**
|
||||||
|
** Copyright 2008, The Android Open Source Project
|
||||||
|
**
|
||||||
|
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
** you may not use this file except in compliance with the License.
|
||||||
|
** You may obtain a copy of the License at
|
||||||
|
**
|
||||||
|
** http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
**
|
||||||
|
** Unless required by applicable law or agreed to in writing, software
|
||||||
|
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
** See the License for the specific language governing permissions and
|
||||||
|
** limitations under the License.
|
||||||
|
*/
|
||||||
|
-->
|
||||||
|
<animation-list
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:oneshot="false">
|
||||||
|
<item android:drawable="@drawable/stat_sys_upload_anim0" android:duration="200" />
|
||||||
|
<item android:drawable="@drawable/stat_sys_upload_anim1" android:duration="200" />
|
||||||
|
<item android:drawable="@drawable/stat_sys_upload_anim2" android:duration="200" />
|
||||||
|
<item android:drawable="@drawable/stat_sys_upload_anim3" android:duration="200" />
|
||||||
|
<item android:drawable="@drawable/stat_sys_upload_anim4" android:duration="200" />
|
||||||
|
<item android:drawable="@drawable/stat_sys_upload_anim5" android:duration="200" />
|
||||||
|
</animation-list>
|
||||||
|
|
||||||
18
app/src/main/res/drawable-hdpi/stat_upload_static.xml
Executable file
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Copyright (C) 2011 The Android Open Source Project
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:src="@drawable/stat_sys_upload_anim0" />
|
||||||
|
Before Width: | Height: | Size: 295 B |
BIN
app/src/main/res/drawable-mdpi/stat_sys_download_anim0.png
Normal file
|
After Width: | Height: | Size: 574 B |
BIN
app/src/main/res/drawable-mdpi/stat_sys_download_anim1.png
Normal file
|
After Width: | Height: | Size: 571 B |
BIN
app/src/main/res/drawable-mdpi/stat_sys_download_anim2.png
Normal file
|
After Width: | Height: | Size: 576 B |
BIN
app/src/main/res/drawable-mdpi/stat_sys_download_anim3.png
Normal file
|
After Width: | Height: | Size: 575 B |
BIN
app/src/main/res/drawable-mdpi/stat_sys_download_anim4.png
Normal file
|
After Width: | Height: | Size: 557 B |
BIN
app/src/main/res/drawable-mdpi/stat_sys_download_anim5.png
Normal file
|
After Width: | Height: | Size: 567 B |
BIN
app/src/main/res/drawable-mdpi/stat_sys_upload_anim0.png
Normal file
|
After Width: | Height: | Size: 580 B |
BIN
app/src/main/res/drawable-mdpi/stat_sys_upload_anim1.png
Normal file
|
After Width: | Height: | Size: 577 B |
BIN
app/src/main/res/drawable-mdpi/stat_sys_upload_anim2.png
Normal file
|
After Width: | Height: | Size: 545 B |
BIN
app/src/main/res/drawable-mdpi/stat_sys_upload_anim3.png
Normal file
|
After Width: | Height: | Size: 586 B |
BIN
app/src/main/res/drawable-mdpi/stat_sys_upload_anim4.png
Normal file
|
After Width: | Height: | Size: 582 B |
BIN
app/src/main/res/drawable-mdpi/stat_sys_upload_anim5.png
Normal file
|
After Width: | Height: | Size: 573 B |
BIN
app/src/main/res/drawable-xhdpi/stat_sys_download_anim0.png
Normal file
|
After Width: | Height: | Size: 798 B |
BIN
app/src/main/res/drawable-xhdpi/stat_sys_download_anim1.png
Normal file
|
After Width: | Height: | Size: 811 B |
BIN
app/src/main/res/drawable-xhdpi/stat_sys_download_anim2.png
Normal file
|
After Width: | Height: | Size: 819 B |
BIN
app/src/main/res/drawable-xhdpi/stat_sys_download_anim3.png
Normal file
|
After Width: | Height: | Size: 821 B |
BIN
app/src/main/res/drawable-xhdpi/stat_sys_download_anim4.png
Normal file
|
After Width: | Height: | Size: 783 B |
BIN
app/src/main/res/drawable-xhdpi/stat_sys_download_anim5.png
Normal file
|
After Width: | Height: | Size: 785 B |
BIN
app/src/main/res/drawable-xhdpi/stat_sys_upload_anim0.png
Normal file
|
After Width: | Height: | Size: 813 B |
BIN
app/src/main/res/drawable-xhdpi/stat_sys_upload_anim1.png
Normal file
|
After Width: | Height: | Size: 814 B |
BIN
app/src/main/res/drawable-xhdpi/stat_sys_upload_anim2.png
Normal file
|
After Width: | Height: | Size: 759 B |
BIN
app/src/main/res/drawable-xhdpi/stat_sys_upload_anim3.png
Normal file
|
After Width: | Height: | Size: 848 B |
BIN
app/src/main/res/drawable-xhdpi/stat_sys_upload_anim4.png
Normal file
|
After Width: | Height: | Size: 837 B |
BIN
app/src/main/res/drawable-xhdpi/stat_sys_upload_anim5.png
Normal file
|
After Width: | Height: | Size: 794 B |
|
|
@ -20,7 +20,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/imageView2"
|
android:id="@+id/imageView2"
|
||||||
android:src="@android:drawable/stat_sys_download" />
|
android:src="@drawable/stat_download" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="160dp"
|
android:layout_width="160dp"
|
||||||
|
|
@ -42,7 +42,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/imageView3"
|
android:id="@+id/imageView3"
|
||||||
android:src="@android:drawable/stat_sys_upload" />
|
android:src="@drawable/stat_upload" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|
|
||||||