I suspect this isn't possible, given the nature of Android, but is there a way to create a view of sorts (perhaps using a Canvas object?) that is shown on top of all applications?
My intent for this project is not malicious. I have created some simple Color Filter software for Windows that simply adds a window on top of all windows, which is filled with a user-chosen color, and has a low opacity. This adds a light tint to the screen which helps users with Scoptopic Sensitivity Syndrome use a computer for long periods of time. I would like to make an Android version of this software. For example:
The image on the left is the original, and the one on the right is what I am trying to achieve.
Is there any way at all to do this with Android? I understand that the application will have to run as a system service so that it isn't stopped unexpectedly, but to my knowledge, there is no way to generically draw on the screen on top of other applications. If possible, can you suggest what APIs to look into?
Here is what I think may work:
You will need the following values:
Store them in a preference after using sliders:
Define a Layer Class which extends the view and is used to draw the applied values on the canvas.
Next write a service which is supposed to handle the changes in these values and apply them to the windows.
//Declare views for applying the values that are stored in Prefs private static Layer view; ... public static int r; public static int b; public static int g; public static int a; public static int c;
In the onCreate method,
Get values previously stored in preferences,
set views for setting the retrieved values,
Add these views to the window
Write reusable methods
Call these methods wherever necessary using the service class
Don't forget to declare your service in the Manifest xml file
I might have missed a thing or two as I did this on the fly, but I think this should do it.