Skip to content

Commit e3cd39a

Browse files
authored
Merge pull request #40 from itsdrnoob/dev/2.0.0
Dev/2.0.0
2 parents 35ed9a6 + 102da50 commit e3cd39a

File tree

1,405 files changed

+6108
-815
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,405 files changed

+6108
-815
lines changed

CHANGELOG.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Changelogs
2+
3+
All notable changes to Data Monitor will be documented in this file.
4+
5+
6+
## v2.0.0
7+
8+
Data Monitor v2.0.0 release <br>
9+
This major release includes many changes and improvements.
10+
11+
- Added live network speed monitor
12+
- Redesigned Data Usage widget
13+
- Added the ability to check for updates
14+
- Revamped the user interface
15+
- Added the ability to select monthly data reset date
16+
- New date and time picker
17+
- Added haptic feedback
18+
- Added long press to view each day's data usage in weekly overview
19+
- Fixed delay while opening app data usage stats view
20+
- Updated network diagnostics connection method
21+
- Updated mothly data usage calculation. If on a monthly data plan, monthly data usage will be calculated according to the reset date.
22+
- Fixed not able to set Simplified Chinese as app language
23+
- Added manual request for READ_PHONE_STATE permission on Android 9 and below
24+
- Switched from Google OSS license plugin to internal OSS license View
25+
- Added Telegram support group and Play store listing in about section
26+
- Fixed error while refreshing App data usage
27+
- Added new theme picker. Now app will follow system theme by default
28+
- Added Simplified Chinese, Traditional Chinese, French, Arabic, Malayalam and Italian translations
29+
- Minor code improvements and fixes
30+
31+
32+
## v1.6.9
33+
34+
Data Monitor v1.6.9 release <br>
35+
36+
- Added Romanian Language
37+
- Added Data usage in notification title
38+
- Fixed system apps data usage stats not opening when app is opened from widget
39+
- Fixed minor UI flaws
40+
41+
42+
## v1.6.1
43+
44+
Data Monitor v1.6.1 release <br>
45+
46+
- Fixed crash while starting Data Usage receiver
47+
48+
49+
## v1.6.0
50+
51+
Data Monitor v1.6.0 release <br>
52+
53+
- Added app usage time
54+
- Minimal core changes
55+
56+
57+
## v1.5.1
58+
59+
Data Monitor v1.5.1 hotfix release
60+
61+
- Fixed crash when using network diagnostics without network connection
62+
- Optimized code
63+
64+
# v1.5
65+
66+
Data Monitor v1.5 release
67+
68+
- Added feature Network diagnostics
69+
- Check Data speed and latency
70+
- Fixed distorted icon shapes
71+
- Fixed OEM battery settings in unsupported devices
72+
- Updated some ui elements
73+
- Bumped up targetSdkVersion to 31
74+
- Updated app dependencies
75+
76+
77+
## v1.0
78+
79+
Data Monitor v1.0
80+
81+
- Initial release

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
[![License](https://shields.io/badge/version-v1.6.9-087AFF.svg)](https://github.com/itsdrnoob/DataMonitor)
2-
[![License](https://shields.io/badge/platform-android-green.svg)](https://github.com/itsdrnoob/DataMonitor)
1+
[![Version](https://shields.io/badge/version-v2.0.0-087AFF.svg)](https://github.com/itsdrnoob/DataMonitor)
2+
[![Platform](https://shields.io/badge/platform-android-green.svg)](https://github.com/itsdrnoob/DataMonitor)
33
[![License](https://img.shields.io/badge/license-GPL3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html)
4-
[![License](https://shields.io/badge/release-v1.6.9-blue.svg)](https://github.com/itsdrnoob/DataMonitor/releases)
4+
[![Release](https://shields.io/badge/release-v2.0.0-blue.svg)](https://github.com/itsdrnoob/DataMonitor/releases)
55
[![Chat](https://img.shields.io/badge/Telegram%20Chat-blue?logo=telegram)](https://t.me/datamonitor)
6+
[![Downloads](https://img.shields.io/github/downloads/itsdrnoob/DataMonitor/total)](https://github.com/itsdrnoob/DataMonitor/releases)
67

78
<div align="center">
89
<img src="https://raw.githubusercontent.com/itsdrnoob/DataMonitor/master/images/icon.png" width="20%" height="20%"></img>
@@ -21,19 +22,20 @@ Track all your data usage - at one place
2122
- Data usage alert
2223
- Custom mobile data reset time
2324
- Network diagnostics
25+
- Live network speed monitor
2426
- App usage time
2527
- No ads or In-app purchases
2628
- Light-weight and Open Source
2729

2830
## Screenshots
29-
![Home light](https://github.com/itsdrnoob/DataMonitor/blob/29d1595dccb0ebc145be49e74fbdb6b5d11078f4/images/ss_all_light.png)<br><br>
30-
![Home Dark](https://github.com/itsdrnoob/DataMonitor/blob/29d1595dccb0ebc145be49e74fbdb6b5d11078f4/images/ss_all_dark.png)
31+
![Home Part 1](https://github.com/itsdrnoob/DataMonitor/blob/0afb0f0ff795b3df153dc80622b55d4b42748bf0/images/ss_part_1.png)<br><br>
32+
![Home Part 2](https://github.com/itsdrnoob/DataMonitor/blob/0afb0f0ff795b3df153dc80622b55d4b42748bf0/images/ss_part_2.png)
3133
<br><br>
3234

3335
## Download
3436
[<img alt="Get it on Google Play" height="85" src="./images/google-play-badge.png">](https://play.google.com/store/apps/details?id=com.drnoob.datamonitor)<br><br>
35-
[<img alt="Get it on AFH" height="50" src="https://www.androidfilehost.com/images/afh.png">](https://www.androidfilehost.com/?fid=15664248565197194635)<br><br>
36-
Or check <a href = "https://github.com/itsdrnoob/DataMonitor/releases/tag/v1.6.9">releases</a>
37+
[<img alt="Get it on AFH" height="50" src="https://www.androidfilehost.com/images/afh.png">](https://www.androidfilehost.com/?fid=14871746926876819885)<br><br>
38+
Or check <a href = "https://github.com/itsdrnoob/DataMonitor/releases/tag/v2.0.0">releases</a>
3739

3840
## Telegram support
3941
Cick <a href="https://t.me/datamonitor">here</a> to join the telegram support chat. If that didn't work try searching for <code>@datamonitor</code> in telegram instead.
@@ -48,4 +50,4 @@ Click <a href = "CONTRIBUTING.md">here</a> to learn how to contribute.
4850
Check xda thread <a href = "https://forum.xda-developers.com/t/app-v1-0-data-monitor-track-all-your-data-usage-at-one-place.4356129/">here</a>.
4951

5052
## NOTE
51-
Play store release differs in signature with Github and other releases. This means that if you have apk from Github or AFH installed, you won't be able to update directly from Play store. If you have the Github variant installed and want to use Playstore one, you have yo uninstall the app and reinstall from Playstore.
53+
Play store release differs in signature with Github and other releases. This means that if you have apk from Github or AFH installed, you won't be able to update directly from Play store. If you have the Github variant installed and want to use Playstore one, you have to uninstall the app and reinstall from Playstore.

VERSION.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v2.0.0

app/build.gradle

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
plugins {
22
id 'com.android.application'
3-
id 'com.google.android.gms.oss-licenses-plugin'
43
}
54

65
android {
@@ -11,8 +10,8 @@ android {
1110
applicationId "com.drnoob.datamonitor"
1211
minSdkVersion 23
1312
targetSdkVersion 31
14-
versionCode 6
15-
versionName 'v1.6.9'
13+
versionCode 7
14+
versionName 'v2.0.0'
1615

1716
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1817
}
@@ -37,6 +36,7 @@ android {
3736
}
3837
}
3938

39+
4040
dependencies {
4141

4242
implementation 'androidx.appcompat:appcompat:1.4.1'
@@ -54,7 +54,6 @@ dependencies {
5454
implementation 'com.google.code.gson:gson:2.8.8'
5555
implementation 'androidx.preference:preference:1.0.0'
5656
implementation "com.github.skydoves:progressview:1.1.2"
57-
implementation 'com.google.android.gms:play-services-oss-licenses:17.0.0'
5857
implementation 'com.airbnb.android:lottie:5.0.3'
5958
implementation 'com.github.antonKozyriatskyi:CircularProgressIndicator:1.3.0'
6059
implementation 'fr.bmartel:jspeedtest:1.32.1'

app/src/main/AndroidManifest.xml

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,19 @@
1414
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
1515

1616
<uses-permission android:name="android.permission.VIBRATE" />
17-
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"
18-
tools:ignore="QueryAllPackagesPermission" />
17+
<!-- <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"-->
18+
<!-- tools:ignore="QueryAllPackagesPermission" />-->
1919
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
20+
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
2021
<uses-permission android:name="android.permission.INTERNET"/>
2122
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
23+
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
24+
25+
<queries>
26+
<intent>
27+
<action android:name="android.intent.action.MAIN"/>
28+
</intent>
29+
</queries>
2230

2331
<application
2432
android:allowBackup="true"
@@ -67,7 +75,6 @@
6775
android:name=".utils.DataUsageMonitor"
6876
android:enabled="true"
6977
android:exported="true" />
70-
7178
<receiver android:name=".utils.DataUsageMonitor$DataMonitor"
7279
android:exported="true">
7380
<intent-filter>
@@ -104,6 +111,20 @@
104111
</intent-filter>
105112
</receiver>
106113

114+
<receiver android:name=".utils.LiveNetworkMonitor$LiveNetworkReceiver"
115+
android:exported="true">
116+
<intent-filter>
117+
<action android:name="android.intent.action.BOOT_COMPLETED"/>
118+
<action android:name="android.intent.action.SCREEN_ON"/>
119+
<action android:name="android.intent.action.SCREEN_OFF"/>
120+
<action android:name="android.intent.action.USER_PRESENT"/>
121+
</intent-filter>
122+
</receiver>
123+
124+
<service android:name=".utils.LiveNetworkMonitor"
125+
android:exported="true"
126+
android:enabled="true" />
127+
107128
<activity
108129
android:name=".ui.activities.MainActivity"
109130
android:fitsSystemWindows="true"
@@ -112,18 +133,6 @@
112133
android:exported="false"
113134
tools:ignore="LockedOrientationActivity">
114135
</activity>
115-
<activity
116-
android:name="com.google.android.gms.oss.licenses.OssLicensesMenuActivity"
117-
android:theme="@style/Theme.License"
118-
android:screenOrientation="portrait"
119-
android:exported="false"
120-
tools:ignore="LockedOrientationActivity"/>
121-
<activity
122-
android:name="com.google.android.gms.oss.licenses.OssLicensesActivity"
123-
android:theme="@style/Theme.License"
124-
android:screenOrientation="portrait"
125-
android:exported="false"
126-
tools:ignore="LockedOrientationActivity"/>
127136
</application>
128137

129138
</manifest>

app/src/main/java/com/drnoob/datamonitor/Common.java

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,22 @@
1919

2020
package com.drnoob.datamonitor;
2121

22+
import android.Manifest;
2223
import android.app.Activity;
2324
import android.app.AppOpsManager;
2425
import android.content.Context;
26+
import android.content.Intent;
2527
import android.content.pm.ApplicationInfo;
2628
import android.content.pm.PackageManager;
2729
import android.content.res.Configuration;
2830
import android.content.res.Resources;
2931
import android.view.View;
3032

33+
import androidx.core.content.ContextCompat;
34+
import androidx.preference.PreferenceManager;
35+
36+
import com.drnoob.datamonitor.utils.LiveNetworkMonitor;
37+
import com.drnoob.datamonitor.utils.NotificationService;
3138
import com.google.android.material.snackbar.Snackbar;
3239

3340
import java.util.Locale;
@@ -51,6 +58,11 @@ public static Boolean isUsageAccessGranted(Context context) throws PackageManage
5158
return (mode == AppOpsManager.MODE_ALLOWED);
5259
}
5360

61+
public static Boolean isReadPhoneStateGranted(Context context) {
62+
return ContextCompat.checkSelfPermission(context, Manifest.permission.READ_PHONE_STATE)
63+
== PackageManager.PERMISSION_GRANTED;
64+
}
65+
5466
public static Boolean isAppInstalled(Context context, String packageName) {
5567
PackageManager pm = context.getPackageManager();
5668
try {
@@ -62,12 +74,31 @@ public static Boolean isAppInstalled(Context context, String packageName) {
6274
return false;
6375
}
6476

65-
public static void setLanguage(Activity activity, String languageCode) {
77+
public static void setLanguage(Activity activity, String languageCode, String countryCode) {
6678
Resources res = activity.getResources();
6779
Configuration conf = res.getConfiguration();
68-
conf.locale = new Locale(languageCode);
69-
conf.setLayoutDirection(new Locale(languageCode));
80+
Locale locale;
81+
if (countryCode.equals("rTW")) {
82+
locale = Locale.TAIWAN;
83+
}
84+
else if (countryCode.equals("rCN")) {
85+
locale = Locale.CHINESE;
86+
}
87+
else {
88+
locale = new Locale(languageCode, countryCode);
89+
}
90+
conf.locale = locale;
91+
conf.setLayoutDirection(locale);
7092
res.updateConfiguration(conf, res.getDisplayMetrics());
7193

7294
}
95+
96+
public static void refreshService(Context context) {
97+
if (PreferenceManager.getDefaultSharedPreferences(context).getBoolean("network_signal_notification", false)) {
98+
context.startService(new Intent(context, LiveNetworkMonitor.class));
99+
}
100+
if (PreferenceManager.getDefaultSharedPreferences(context).getBoolean("setup_notification", false)) {
101+
context.startService(new Intent(context, NotificationService.class));
102+
}
103+
}
73104
}

0 commit comments

Comments
 (0)