artcom /
unity-android-watchdog-plugin
a java library for Unity Android apps which observes a heartbeat of the Unity App to check for blocked UI
Loading repository data…
aakashbansal / repository
App WatchDog is an android app that tracks the usage statistics of all installed apps (except system apps) and usage restriction can also be set on any app to control its usage. It is built natively in Java using Android Studio.
App WatchDog is an android app built natively in Java using Android Studio. This app tracks the usage statistics of all installed apps (except system apps) and usage restriction can also be set on any app to control its usage.
The app is currently not available on the Play Store. Here is the Google Drive Download Link : Download App WatchDog
Open the terminal:
$ cd \<required-path>
$ git clone https://github.com/aakashbansal/App-WatchDog-Android-App.git
After that open the directory from Android Studio. Go to Run -> Run app to launch the app into emulator or device.
Known Issues While Setting Up The Project
Some users may face a known issue with Android Studio while setting-up this project that says something along the lines of :
Unsupported Modules Detected : Compilation is not supported for following modules:
App-WatchDog-Android-App, app.
Unfortunately you can't have non-Gradle Java modules and Android-Gradle modules in one project.
To overcome this issue, go to File -> Invalidate Caches/Restart.... Select Invalidate and Restart from the on-screen prompt. Android Studio will restart now.
Allow the project to build afresh. This may take some time (a lot actually, depending on the CPU). Let it finish. Ignore any intermediate errors such as Error Loading Project: Cannot load 2 modules.
After this step, the project should be up and running.
If the error still persists, open the build.gradle file . Add some random white spaces in it. This will give a Sync Now option on-screen. Click on that and allow the project to sync. The App should finally be working now.
Enjoy :)
The app performs two major tasks :
It works as a tracker that tracks the app usage activity of a user by telling the following info about any given installed app(not system apps) :
The app can also serve as WatchDog that checks to see if the user has exceeded the Usage Limit Quota on any app that he himself has set up. If the usage limit is exceeded, the concerned app exits(on which limit is set up).
Following type of restrictions can be set up on an app:
App Screenshots for viewing Usage Stats
App Screenshots for Setting Usage Limit
View Added Restriction Info
Remove Restriction
Settings
Java Files
activity - contain classes corresponding to different activities.
adapter - contain list view adapters.
database - contain classes for manipulating the local SQLite Database. This is further sub-divided into two folders :
DialogController - manages the on-screen dialogs.
fragments - contain classes for displaying fragments. This is further sub-divided into two folders :
helper - contain various classes each with a different set of functions responsible for handling the different business logic of the app codebase. Each type of functions role is abstracted into different java class.
model - contain classes responsible for modelling the data into an entity.
receiver - contain various broadcast receivers, each responsible for a different role like device turned on , service stopped, sending notification,etc.
service - contain the Android services that run in background.
sharedPreferences - just a wrapper over native Android SharedPreferences API.
ToastController - just a wrapper over native Android ToastController with separate class containing all the Toast Messages.
XML Resource Files
All XML resource files exist in res->layouts directory in the code structure. Further, different views of the app are all structured into different logical directories.
To take advantage of the restructured code format of XML files,
the project should be opened in "Project" view and not the "Android" view. This setting exists in 3rd or 4th row
from upper left corner of Android Studio Screen.
For more info on how to open the Android Project in Project View, see this
At its core, the app has two services that constantly run in background :
These two services perform the core tasks of the whole app. Everything major that is happening in the app is being constantly performed by these services in one way or the another using various helper functions defined in /helper directory.
How does the App ensure that the services continue to run in background even after the app is removed from memory ?
There are two broadcast receivers in place, one for each service; that restarts each one of them respectively when they are terminated by the User or Android OS.
The app requires the USAGE STATS PERMISSION to work. Without it, nothing in the app is going to work.
In some devices (such as Xiaomi), "AUTOSTART" permission will also
be required to ensure smooth functioning of the app.
The goal of this project was to learn basic Android but it grew complex with time. If you need any help or support to understand any part of the code,please let me know. Any improvements, bug fixes, bug reporting, new features or suggestions are definitely welcome. Those looking to contribute to this code base can also do so via Pull Requests. Any contribution is more than welcome and well appreciated. :)
Email Id : aakashbansals23@gmail.com
Licensed under the GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 : https://www.gnu.org/licenses/gpl-3.0.en.html
Copyright (C) 2007 Free Software Foundation, Inc. http://fsf.org/
Selected from shared topics, language and repository description—not editorial ratings.
artcom /
a java library for Unity Android apps which observes a heartbeat of the Unity App to check for blocked UI